Hallo ich habe folgendes Problem, ich muss für einen Server ein App schreiben. Hierzu hab ich auch schon eine Anleitung gefunden...
Aber mit der folgenden Anweisung kann ich nichts anfangen, kann mir da jemand einen Tipp geben, ich habe den ganzen Tag schon probiert aber ich komm nicht drauf wie ich hier vorran komme.
Hab mich auch schon in einen Forum für Pythonprogrammierung erkundigt, da konnte man mir auch nicht weiterhelfen.
Translation can be done in three simple steps.
1. Got to the myapp-0.1.0/ui/locale directory. There you can execute the following command.
xgettext -L Python -d myapp -s --keyword=_ -o myapp.pot ../js/main.js
The xgettext command searches for strings in the main.js file and creates a pot files which is needed for the translation step. Because there is no support for JavaScript build in, the Python definition is used. This definition works really good for JavaScript files
2. The easiest way to translate this pot file is to open it with a special program like poedit. With this program you can create a new translation catalog. Save this catalog to myapp-0.1.0/ui/locale/de_DE/ or the according place of your language. With poedit you can also do all the translation work.
3. The last step is to convert the myapp.po file to a json file. For this task the po2json program in the tools directory is used. Run it in the following way:
./po2json -p ../myapp-0.1.0/ui/locale/de_DE/myapp.po > ../myapp-0.1.0/ui/locale/de_DE_LC_MESSAGES/langpack.json
Due to an issue in the po2json program you have to insert
json_locale_data=
in the first line right before the opening bracket in the /myapp-0.1.0/ui/locale/de_DE/LC_MESSAGES/langpack.json file.
Wäre gut wenn mir jemand weiterhelfen kann.
mfg dawe0006
Aber mit der folgenden Anweisung kann ich nichts anfangen, kann mir da jemand einen Tipp geben, ich habe den ganzen Tag schon probiert aber ich komm nicht drauf wie ich hier vorran komme.
Hab mich auch schon in einen Forum für Pythonprogrammierung erkundigt, da konnte man mir auch nicht weiterhelfen.
Translation can be done in three simple steps.
1. Got to the myapp-0.1.0/ui/locale directory. There you can execute the following command.
xgettext -L Python -d myapp -s --keyword=_ -o myapp.pot ../js/main.js
The xgettext command searches for strings in the main.js file and creates a pot files which is needed for the translation step. Because there is no support for JavaScript build in, the Python definition is used. This definition works really good for JavaScript files
2. The easiest way to translate this pot file is to open it with a special program like poedit. With this program you can create a new translation catalog. Save this catalog to myapp-0.1.0/ui/locale/de_DE/ or the according place of your language. With poedit you can also do all the translation work.
3. The last step is to convert the myapp.po file to a json file. For this task the po2json program in the tools directory is used. Run it in the following way:
./po2json -p ../myapp-0.1.0/ui/locale/de_DE/myapp.po > ../myapp-0.1.0/ui/locale/de_DE_LC_MESSAGES/langpack.json
Due to an issue in the po2json program you have to insert
json_locale_data=
in the first line right before the opening bracket in the /myapp-0.1.0/ui/locale/de_DE/LC_MESSAGES/langpack.json file.
Wäre gut wenn mir jemand weiterhelfen kann.
mfg dawe0006