Clone wiki

kojo / Kojo Localization

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.

  1. UI localization:

    • 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 supportedLanguages in line 31 and your language name to private val langNames in 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.properties and put the following entry in there:

    i18n.string.showkey=true

    Then (re)start Kojo. You will now see all localized UI text in the format localText[key].

  2. Turtle command localization: You have a couple of options:

    1. Easy Option: Translate level2.properties and send it to the kojo-dev mailing list for further processing.
    2. 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.

  3. Sample Localization
    If you want to, for example, localize the following sample for Swedish:
    src/main/resources/samples/spiral.kojo

    Then you just need to just create the following localized version of the sample:
    src/main/resources/samples/sv/spiral.kojo

    The version of spiral.kojo under the sv directory 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.

Updated