Scenario translation

From Unknown Horizons - Wiki

Jump to: navigation, search

Create yaml file

This article explains how to build translated scenario files. It assumes you use a git clone of UH. All paths are, unless specified otherwise, relative to this clone's master directory. You might need to replace python2 calls by python2.6 or python2.7.

Input
one or more .po files that contain translation strings of a particular scenario
Output
Files in Folder.png content/scenarios/ that can be started via GUI and command line
  • Create a new directory Folder.png tutdir/ in your UH main directory (where Folder.png development/ is located) and move all these .po files in there.
  • In the main UH directory (where Folder.png development/ is located) run
    user@pc: unknown-horizons
    sh development/create_scenario_pot.sh tutorial tutdir/
    Please note these three things:
    • Don't run from within Folder.png development/
    • Use the scenario name without any language suffixes (in our case use Folder.png tutorial if the filename reads File.png tutorial_en.yaml)
    • Use the relative path to your folder Folder.png tutdir as argument. Our pofiles above had the path File.png unknown-horizons/tutdir/{fi,gd,hu}.po


  • This should create the files File.png tutorial_fi.yaml, File.png tutorial_gd.yaml and File.png tutorial_hu.yaml in Folder.png unknown-horizons/content/scenarios/. Start these via our GUI or using the command line flag
    user@pc: unknown-horizons
    python2 ./run_uh.py --start-scenario tutorial_gd
    • Don't append .yaml. Neither use the full path to Folder.png content/scenarios/.


  • Now you can check if all headings and message bodies fit the logbook space (some headings most likely won't).
  • Important: You can edit the yaml files on the fly, but not modify logbook entries after they have been written. To check this, please continue reading.

Preview translated strings

This article explains how to build translated scenario files. It assumes you use a git clone of UH. All paths are, unless specified otherwise, relative to this clone's master directory.

Input
translated .yaml scenario files that contain strings you want to check
Output
A logbook widget that allows you to browse all entries and modify the yaml.
  • In the main UH directory (where File.png run_uh.py is located) run
    user@pc: unknown-horizons
    python2 ./run_uh.py --string-previewer
    after you compiled the scenario files according to the above.
    • Select the scenario you want to check. Close the logbook and click on load/reload after editing.
    • Browse through the pages and look for headings that are too wide or entries too verbose.
    • Fix them in the yaml file (which will look ugly) to test and fix in pootle when you're satisfied.
Personal tools
Summer of Code 2012