website update; added bash scripts
This commit is contained in:
@@ -56,6 +56,29 @@ Set the locale in your script, somewhere like _ready() or on a 'change language'
|
||||
<br>
|
||||
Now that everything's in place, you can keep adding new ids + translations, and Godot will automatically use your changes in-game. <br>
|
||||
<br>
|
||||
<br>
|
||||
<h2>step 6 - insert values into text </h2>
|
||||
<br>
|
||||
Languages differ in syntax, so use format strings. <br>
|
||||
<br>
|
||||
In your spreadsheet, write <code>%s</code> where your inserted text will go.
|
||||
<br>
|
||||
<center>
|
||||
<img src="/static/img/ent/internationalization_formatcsv.png" alt="(image: in the .CSV, id= character_level, en= Level %s, ja= レバル %s)"><br>
|
||||
</center>
|
||||
<br>
|
||||
Then in your script, write <code>tr("key") % inserted_val</code> in place of the formatted string. <br>
|
||||
<br>
|
||||
<center>
|
||||
<img src="/static/img/ent/internationalization_formatscript.png" alt="(image: in the script, set_text(tr("character_level") % String(level))"><br>
|
||||
</center>
|
||||
<br>
|
||||
Now the formatted string will appear in-game. <br>
|
||||
<br>
|
||||
<center>
|
||||
<img src="/static/img/ent/internationalization_formatgame.png" alt="(image: screenshot: Level 1)"><img src="/static/img/ent/internationalization_formatgame2.png" alt="(image: screenshot: レベル 1)"><br>
|
||||
</center>
|
||||
<br>
|
||||
<h2>that's the basics </h2>
|
||||
<center>
|
||||
<img src="/static/img/ent/internationalization_japanese.png" alt="(image: blessfrey screenshot in Japanese)" width="500" height="370.46"><br>
|
||||
|
||||
Reference in New Issue
Block a user