Overview and quick start
What L10N does
L10N is the PinK extension for managing multilingual content in a COCOS project. It keeps translations and language-specific media together so you can check how they appear in the game.
For example, the same button can display Restart in English and “重新开始” in Simplified Chinese. Images containing text, voice recordings and fonts may also need different assets for each language. The PinK editor's display language is a separate setting.
What can it help you do?
L10N provides a panel for editing and reviewing individual entries and a Chat interface for asking Agent to query or modify project content within a defined scope. Start with the bilingual example on this page, then use these guides as needed.
| What you want to do | Read next |
|---|---|
| Collect content; manage languages, translations, variants, components and media; exchange files or clear data | Manage localization content |
| Generate translation drafts or ask Chat for help | Automatic translation and Chat |
| Read text, use plural forms, switch languages and listen for changes in scripts | Scripting API |
| Check the result and select build languages | Preview and build |
Translation services are optional. You can enter the first translation by hand, so no AI or third-party service account is required.
How languages map to content
The translation table identifies each entry by a Key. The same entry stores text or media for several languages. Components and the runtime use the content for the selected language.
For a Label, L10nLabel connects the scene node to an entry through its Key. The entry stores translations, and the preview selects the language to show. Changing a translation normally does not require changing the Key. Saving a translation, linking a node and choosing a preview language are separate steps.
Translate your first text
Use the game Demo to translate its existing Restart button. The workflow is collect the source → save a translation → check the node's Key → preview both languages.
This example uses the existing scene and button. You do not need to add nodes, change the source text, prepare translation files or create a packaged build.
Before you start
- Open the Demo project root in PinK.
- Open
assets/main.sceneand locateCanvas/ResetButton/Labelin Hierarchy. - Run the preview and confirm that the button displays
Restartand resets the score.
Use a recoverable project copy: collecting text may add localization components and save scene resources.
Make sure Restart is visible before continuing. If the button text is missing, check the scene preview first. Enabling localization will not fix an existing display problem.
1. Choose English as the source language
Choose Project → Open Localization Editor. On first use, select Enable and wait for preparation to finish. Set Source language (original text) to English (en), because the Demo's original text is English.
You can leave the automatic translation service alone for this tutorial.
2. Collect Restart
- Under Collect from resource files, expand Configure collection group.
- Use the directory picker to select the Demo's
assetsroot. Keep one group and leave the optional filters empty. - Select Collect and count and wait for completion.
- In the language list, select Complete source text on the English row.
- Open Completed source text, select
Restart, and expand Entry details at the bottom of the page.
Copy or note the Key. It connects the scene node to this entry; do not translate it. Other scene text and media may also appear in the table.
If you cannot find the entry, confirm that assets/main.scene is saved and the collection directory is the Demo's assets folder. In an existing localized project, compare the entry with the Key on the node's L10nLabel. Find the source entry before adding another language.
3. Save a Simplified Chinese translation
Return to the language list:
- Select Add new language, choose Simplified Chinese (
zh-Hans), and select Add. - Select Translate on its row.
- Under Untranslated, find the same Key and confirm that the source is
Restart. - Enter “重新开始” and select Save at the top right.
Typing changes the draft. Page Save writes it to the project. Reopen the language page and check Translated to confirm the saved value.
The language row's Translate button opens the editor. The automatic translation button inside that editor requests a draft from a service; this example uses manual editing and saving.
4. Check the node's Key
Return to assets/main.scene, select Canvas/ResetButton/Label, and find L10nLabel in Inspector.
- If its Key matches the entry, keep it and save the scene.
- If it differs, open the key picker, select the
Restartentry, save the Key, then save the scene.
The Key row provides Select, Generate and Edit icons. Save and Reset appear when the Key has been changed. No Key save is needed when it is unchanged. Saving a Key association and saving a translation are separate actions; later translation edits can keep the same Key.
5. Preview both languages
In the language list, select Preview on the Simplified Chinese row and check the Restart button in the game. Then select English Preview and check the same position.
| Preview language | Expected button text |
|---|---|
| English | Restart |
| Simplified Chinese | 重新开始 |
Other untranslated text can stay in English. You have now connected a saved translation, the node's Key and the preview language.
If the result is unexpected, check these in order:
- Reopen the Simplified Chinese translation page. If “重新开始” is missing, save the translation first.
- Compare the node's Key with the entry's Key. Correct the association and save the scene if they differ.
- Confirm that you selected Preview on the Simplified Chinese row and are viewing the Demo's
assets/main.scene.
If Preview is unavailable, check the project or connection hint in the panel. Do not delete translation data to fix a connection problem.
Next steps
Use Manage localization content to handle more entries. Try Automatic translation and Chat for a larger batch, or follow Scripting API to add in-game language buttons. Before delivery, check Preview and build.