From ago control wiki
Revision as of 09:21, 14 June 2014 by Jaeger (Talk | contribs)

Jump to: navigation, search


Translation of ago control

Core translation files for RPC Interface

Template files with translation have a special syntax, so don't just copy a "translated" html to a .in.html. Always take a .in.html as template if you want to add a new file. During the build, they're merged with the .po files into the .html files. You need to base your work on a .in.html file only. The .in.html has text bindings which will be translated.

Example of device translation

If you have a look at [1] we have this:

<ko opts="if: state() == 0">
        <_span data-translateable="true">OFF</_span>

So it will show "OFF" when the state is set accordingly. After .po merge by the built or manual triggering, this becomes:

 <ko opts="ifnot: state ">
         <span data-translateable="true">OFF</span>
         <span xml:lang="de" data-translateable="true">AUS</span>
         <span xml:lang="fr" data-translateable="true">OFF</span>
         <span xml:lang="nl" data-translateable="true">UIT</span>

For each language you will get the "xml:lang" records with the translated content.

translation inside Tags

<input data-translateable="true" placeholder="Your text to translate"></input>

Adding translation for template

we have a in the core/rpc/html/po directory, this lists all files that should be handled during translation. You are perhaps confused about the naming "templates/devices/". You just need to rename your real template name "templates/devices/" to "templates/devices/". This is by design and perhaps we will find some more nice way in future.

After you included your template for translation you need to trigger the translation scripts to get the .po and .pot file filled with the "requested" translation. You now can have a look into for e.g. de.po and you will find - mostly at the end - missing translations:

#: ../plugins/zwave/templates/
msgid "Reset controller"
msgstr ""

Or even "automatic" translation which may be fuzzy:

#: ../plugins/zwave/templates/
#, fuzzy
msgid "Download configuration"
msgstr "Raum Konfiguration"

Your translation will start in the "msgstr" lines. Please mind the original text - not to loose some special chars or something like this. After you are finished with your local translation you need to run the merge translations script to see the result.

Trigger manual translation

You can trigger this merge for tests on your dev server with this two commands:

cd core/rpc/html/

Note: You will need the packages realpath and intltool installed for this

Add new language

If you want to add a new language you can copy an existing .po file to your language code. If you have any questions or problems at this point contact us at IRC #agocontrol-devel on the

Development note

If you might want to point agorpc to your git checkout directory you can change the option in conf.d/rpc.conf:

Personal tools