Skip to main content

How do I switch between different languages in the same book manuscript?

Keywords: language, languages, switch, different, multiple

Leanpub Support avatar
Written by Leanpub Support
Updated this week
How do I switch between different languages in the same book manuscript?

Yes, you can switch between languages in the same book!

We'll show you how to do this in three different ways: switching languages on a section-by-section basis, switching languages on a paragraph-by-paragraph basis, and switching languages in a sentence.

Setting the Main Language for Your Book

You set the main language for your book in the Settings section for your book.

Here is an article on this topic:

Finding the Language Code

Before you can switch languages in your book, you'll need to look up the language code here: IS0 639-3.

There are two exceptions:

  1. Traditional Chinese is zh-Hant.

  2. Simplified Chinese is zh-Hans.

Please note the capitalzation matters, i.e. use H in Hant and Hans.

Switching Languages in a Sentence

Here is how you would switch to a different language in a sentence, in this case from English to Japanese:

This is some paragraph text which defaults to English, and it
contains [古池や蛙飛び込む水の音]{lang: jpn} a span which is in Japanese.

Note that you're surrounding the text of the different language with square brackets [ ] and then adding the language attribute after it in curly braces { }.

The language attribute in this example is `{lang: jpn}`.

If you wanted to switch to French, you would do `{lang: fra}`.

Switching a Single Paragraph to a Different Language

Here is how you would switch languages on a paragraph-by-paragraph basis:

Here is some English text.

{lang: jpn}
古池や蛙飛び込む水の音

{lang: jpn}
春過ぎて夏来にけらし白妙の衣干すてふ天の香具山

This is some paragraph text which still defaults to English.

In this example, we're adding {lang: jpn} on a line above each paragraph that we want to be in Japanese.

Please make sure that the language attribute (e.g. {lang: jpn} ) has a blank line above it.

Switching a Section to a Different Language

Here is how you switch languages on a section-by-section basis:

Here is some English text.

The Markua Processor knows it is in English since there is no document settings
block, so the default document setting for `lang` is `eng`.

{lang-jpn}

古池や蛙飛び込む水の音

春過ぎて夏来にけらし白妙の衣干すてふ天の香具山

{lang-eng}

Here is some more English text.

Basically, by putting the language directive {lang-jpn} on a line by itself, with an empty line underneath it AND above it, you're switching all subsequent paragraphs to Japanese.

In the example above, we then switch the book back to English with {lang-eng} on a line by itself, with an empty line underneath it,

Questions or Feedback

If you have any questions or feedback for this article, please email the Leanpub Team at hello@leanpub.com.


To learn about amazing new books and authors, subscribe to our YouTube channel here: https://www.youtube.com/leanpub.

If you have any feedback or questions about this article, please email the Leanpub team about it at hello@leanpub.com!

If you have any questions or thoughts on writing and self-publishing with Leanpub, please join our global community of authors in our Authors Forum here!

Are you interested in self-publishing, and creating your first Leanpub book? Here are some quick tutorials for our most popular writing modes: http://help.leanpub.com/en/articles/3088382-quick-walkthroughs-for-getting-started-on-a-leanpub-book

Are you looking for great deals on Leanpub ebooks, ebook bundles, and courses? Sign up for our Weekly and Monthly newsletter sales here!

You can also follow Leanpub in lots of other places!

Did this answer your question?