There are three levels of localization. Level 1 means translation of user interface text. Level 2 means translation of the most important turtle commands. Level 3 means localization of samples.
- Translate Bundle.properties to your local language, giving it the name Bundle_xx.properties, where xx is your language code.
- In LangMenuFactory.scala, add your language code to
val supportedLanguagesin line 31 and your language name to
private val langNamesin line 75.
If you want to know the key of a UI text item, create (in your home directory) a file called
.kojo/lite/kojo.propertiesand put the following entry in there:
Then (re)start Kojo. You will now see all localized UI text in the format localText[key].
Turtle command localization: You have a couple of options:
- Easy Option: Translate level2.properties and send it to the kojo-dev mailing list for further processing.
- Option with more control: Create translations of the swedish files svInit.scala as well as sv.tw.kojo using your language code instead of "sv". Add a call to your xxInit.init in LangInit.scala.
You need to use only one of the options above. If you go with option (2), you can also use option (1) to auto-generate xxInit.scala, which you can then refine as needed.
If you want to, for example, localize the following sample for Swedish:
Then you just need to just create the following localized version of the sample:
The version of
svdirectory will get picked up when Kojo is running in Swedish mode.
If any of this is confusing, feel free to ask questions on the kojo-dev mailing list.