Translation
While writing scenes, you may worry about translating content into other languages.
Don’t worry: Ponder automatically generates translation files.Once you know how keys map to your code, you can edit the files directly.
Before You Start
After you finish your code and launch the game, Ponder will auto-generate an translation file (even if your text is not English).
Note: Every game launch regenerates
en_us.jsonfrom your code.
Only two simple examples are shown here:
en_us.jsonis English
zh_cn.jsonis Simplified Chinese
For more language file naming conventions:
Start
Using part of as an example:
PonderTag Section
Ponder.tags((event) => {
event.createTag(
"kubejs:iron_golem",
"minecraft:iron_block",
"Iron Golem",
"Iron golems are large, strong friendly mobs that protect players and villagers."
);
});This generates the following entries in en_us.json:
{
"kubejs.ponder.tag.iron_golem": "Iron Golem",
"kubejs.ponder.tag.iron_golem.description": "Iron golems are large, strong friendly mobs that protect players and villagers."
}
kubejsmaps to the namespace in the PonderTag id
ponder.tagindicates this is a tag entry
iron_golemmaps to the path part of the PonderTag id
Ponder Section
Ponder.registry(event => {
event.create("minecraft:iron_block")
.tag("kubejs:iron_golem")
.scene("kubejs:iron_golem_1", "Summon an Iron Golem", (scene, util) => {
scene.text(25, 'To summon an Iron Golem,\nfirst place four iron blocks in a §bT§r shape');
scene.text(20, 'Note: §4these four positions must be air blocks§r\nAny non-air block (including snow, tall grass, and water) in these positions will prevent spawning');
});
});This generates the following entries in en_us.json:
{
"kubejs.ponder.iron_golem_1.header": "Summon an Iron Golem",
"kubejs.ponder.iron_golem_1.text_1": "To summon an Iron Golem,\nfirst place four iron blocks in a §bT§r shape",
"kubejs.ponder.iron_golem_1.text_2": "Note: §4these four positions must be air blocks§r\nAny non-air block (including snow, tall grass, and water) in these positions will prevent spawning"
}
kubejs.ponder.iron_golem_1maps to the Ponder id
headermaps to the Ponder title
text_1...text_nare generated in display order