Creator game - i18N docs?

Creator game - i18N docs?
0.0 0


Hi, im working on my 2nd Creator Game and this time the game is story based (a crossover between resource management and RPG). So internationalisation is a must.

Ive been looking for any useful doc (, unfortunately there is no information available yet in English. I’m aware of the i18n examples on example-cases-master, but it would be great to have some docs available with basic concepts and tips/tricks.

Is the documentation coming anytime soon? Any docs/examples for Creator out there available?



This is the original doc in chinese:

Any fellow Chinese developer willing to do a quick translate to english? :slight_smile:

I18n and Typescript?

I18n game multi-language support

Please download the multi-language support plug-in package [Download] ( The plugin will add the following to your project:

  • i18n / i18n.js: Responsible for initializing localized text data and providing translation output at run time.
  • i18n / polyglot.js: The i18n localization codebase from airbnb, for a complete documentation reference
  • i18n / data / zh.js: Chinese language data template, you should add your translation dictionary here
  • i18n / data / en.js: English language data template where you should add your translation dictionary
  • i18n / LabelLocalized.js: Replace the original Label with this component, and fill theText Key property of the component with the key value in the translation dictionary to display the correct translated text in the editor and at run time .

You can also download the [i18n Multilingual Support Sample Project] ( to practice with the actual project.

work process

Extracting the plug-in package into your project’s assets directory should result in the following directory structure:

  | -i18n
    | -data
    | -en.js
    | -zh.js
    | -i18n.js
    | -LabelLocalized.js
    | -polyglot.js

Customize localized data

Next you should first customize the data source files in the assets / i18n / data directory according to the needs of the multilingual category. The format of each file is as follows:

// zh.js
Module.exports = {
    "HELLO": "Hello"
    "WORLD": "World"

Where HELLO is the key, the value after the translation of the text. Here js format used to define the data in order to be normal engine reference.

The content of the data is a standard JavaScript Object, so you can use a nested structure:

Module.exports = {
    'GREETINGS': {
        'HELLO': 'Hello'
        'WORLD': 'World'

And then through the GREETINGS.HELLO form to access the key.

You can create multiple copies of the data source files, the file name of each data source file is the language of the logo, such as fr.js language identity isfr, followed by how we will show through the language logo to switch display Language.

Set the default display language for the scene editor

The language displayed in the Scene Editor is in assets / i18n / i18n.js

Const language = require ('zh');

You can change the language displayed in the scene preview by replacing zh in the above code with en or another language identifier.

Runtime text translation

In the code, you can call at any time

Var i18n = require ('i18n'); // Normally this is called at the very beginning of the script
I18n.init ('zh'); // init parameter is the language identifier, such as 'zh', 'en', etc.
Var myLocalizedText = i18n.t ('TEXT_KEY');

To get the localized string through the key in the text data source dictionary.

Text fusion

You can use the following definition in the data source:

Module.exports = {
    "Hello_name": "Hello,% {name}"

To declare a parameter that can be fused into the final text, when in use:

Var greetingText = i18n.t ('hello_name', {name: 'nantas'}); // Hello, nantas

You can enter a text to add a parameter to the dynamic code to get the string and the default translation of the text fusion.

Rendering translated effects in scene editing

In the scene, we need to use the LabelLocalized component instead of the originalLabel, LabelLocalized component thanLabel add an attribute Text Key,
In the Property Inspector, we set Text Key to the key value in the dictionary, andLabelLocalized will display the translated text in the scene.

The LabelLocalized.string property is now read-only and can not be written to by this interface.


Awesome!!! Thank you Jason! :smiley:


Sure. If you find more docs that need an English version, please let me know.


A quick follow up on the thread. I implemented i18n in my prototype, and the system works great!! I check the language usingcc.sys.language and load the attributes names from en.js or es.js.

Fantastic libraries!! Great job. Thanks!! :smiley:


I tried following this thread, but the linked libraries seem old.

This package seems much more up to date and adds i18n to the Extension menu. unlike example-cases-master or ‘’ linked above, it additionally supports localized Sprites in addition to Labels.