Text and Localization

Minecraft is a game with fully localized text in languages all over the world. To achieve this, Minecraft employs a system where internal translation keys are assigned values on a per-language basis. Minecraft will generate translation keys for custom entities, items, and blocks, and it is up to us to assign them a localized name in our resource pack.

Language Files

File Location

Language files typically go within the resource pack in the "texts" folder as files with the .lang file extension. These files can be placed in the behavior pack, but the only translatable text it can change is the pack manifest's name and description.

📁RP
📁texts
🈵en_US.lang
📝languages.json
📝manifest.json

Minecraft supports 29 languages currently, as described in § Vanilla Languages.

Format

The format for a language file is rather straightforward. Translations are supplied as key-value pairs separated by an equals sign (=), the key being a translation key and the value being a string. Values cannot contain newline characters.

toml
wiki.example_translation.line_1=The first line!
wiki.example_translation.line_2=Some more information following the first line.
1
2

Comments may be added with two pound signs (##), either as line comments or in-line comments. All text after the pound signs are a comment until the next line.

WARNING

Trailing spaces are not trimmed for in-line comments. If you want to indent a comment, use the Tab character.

toml
## Translator note: I thought this would be funny to put here.
item.flint_and_steel.name=Flint and Steve	##[sic]
1
2

A translation can contain substitutions in place of text. Substitutions can either be ordered (%1, %2, etc.) or not ordered (%s). Vanilla translations have their values filled in by the game, while players can manually set the substitutions' values with commands that use the raw JSON text format, like with /tellraw.

toml
commands.op.success=Opped: %s
immersive_reader.book_page_header=Page %1 of %2
1
2

Usage

Localization can be done just about anywhere text can be used, including (but not limited to):

  • Pack name and description
  • Entity, item, or block names
  • Pages in a book
  • Lines on a sign
  • /tellraw and /titleraw commands
  • Text in dialogue

Some text cannot be translated however, such as for an item renamed in an anvil.

Localization

TIP

It is good practice create a copy of your language file for each major language your pack supports. For example, to support full English one should create both an en_US.lang and an en_GB.lang file, to cover English in both the United States and Great Britain countries, respectively.

When editing language files one must also add a languages.json file in the texts folder containing an array with each of the languages you plan to change. This lets Minecraft know that it should apply localization for these languages.

RP/texts/languages.jsonCopy
json
[
  "en_US",
  "en_GB",
  "fr_FR"
]
1
2
3
4
5

Custom Languages

With a global resource pack, custom languages may be introduced through the languages.json and language_names.json files. Once the pack is applied globally the language can be changed in the "Language" tab of the in-game settings.

For the following examples, lets assume that we have 2 fully functional language files, one named xx_XX.lang, and another named yy_YY.lang.

RP/texts/languages.jsonCopy
json
[
  "xx_XX",
  "yy_YY"
]
1
2
3
4

language_names.json is an array as well, but this time to define the names to display for the languages.

RP/texts/language_names.jsonCopy
json
[
  [ "xx_XX", "New Language (Custom Language #1)" ],
  [ "yy_YY", "Wiki-Speak (Custom Language #2)" ]
]
1
2
3
4

WARNING

Whenever using a custom language, make sure to unequip the language before you disable the Resource Pack which it is stored in, or else Minecraft will crash.

Tools

If Microsoft are localizing your .lang file there are specific technical requirements that your .lang must follow.

  • Ensure <tab># before comments (not spaces).
  • Ensure line breaks are the Windows style (CR+LF), not Unix style.
  • Must not contain duplicate keys.
  • Strings must be commented to ease translation.

You can use the free browser-based LangUtil tool to assist with this.

Vanilla Languages

The following is a table of the 29 languages Minecraft supports by default.

File IDLanguageCountry
id_IDIndonesianIndonesia
da_DKDanishDenmark
de_DEGermanGermany
en_GBEnglishGreat Britain
en_USEnglishNorth America
es_ESSpanishSpain
es_MXMexican SpanishMexico
fr_CACanadian FrenchCanada
fr_FRFrenchFrance
it_ITItalianItaly
hu_HUHungarianHungary
nl_NLDutchNetherlands
nb_NOBokmålNorway
pl_PLPolishPoland
pt_BRBrazilian PortugueseBrazil
pt_PTPortuguesePortugal
sk_SKSlovakSlovakia
fi_FIFinnishFinland
sv_SESwedishSweden
tr_TRTurkishTurkey
cs_CZCzechCzech Republic
el_GRGreekGreece
bg_BGBulgarianBulgaria
ru_RURussianRussia
uk_UAUkrainianUkraine
ja_JPJapaneseJapan
zh_CNChinese (Simplified)China
zh_TWChinese (Traditional)Taiwan
ko_KRKoreanKorea

Contributors

ThijsHankelMCSirLichMedicalJewel105Fabrimat