Skip to content

languagefile

Hika van den Hoven edited this page May 5, 2017 · 3 revisions

The language files

You can create a language-file so all message can be displayed in your own language. At present this involves some manual work, but we are working on a better solution.
Inside the tvgrabpyAPI/texts directory you'll find the current text files. For every language:

  • a script create_texts_**.py
  • the actual file containing a pickeled dict tv_grab_text.**

To create your own file

  • copy create_texts_en.py replacing en with your own language short. For instance de for german.
  • Inside that script replace the lang and language variables to show your own language. E.g. de and Deutsch.
  • Inside the load_texts function you find the texts dict. Replace all the texts to show your own language, where:
  • you should keep the '%' (%s, %d, etc) markers in place as they get replaced by things like the name of a file
  • if there is an EOL '\n' at the end, leave it also in place, but also do not add your own.
  • however in some situations you can spread the text over multiple lines
  • keep any indentations at the start
  • run this new created script to create the language file for your own use
  • send us this new created script and we probably include it with the language file in the package.
  • check regularly if you need to update the script, update the version and send us the updated version.

There are a few special categories:

  • In texts[u'config][u'help'] you should check that the output on the --help option does not excede a width of 80. Else use spaces and newlines to layout.
  • In texts[u'config][u'confighelp'] there are several groups followed by empty lines. If empty they are not printed, but you can use them if you need more space. e.g. 1 - 10, 11 - 16, 21 - 39, 41 - 52, 61 - 67, 71 - 77, 81 - 87, 91 - 139, ...