Skip to content

Adding a new Language

jorgehortelano edited this page Feb 9, 2017 · 1 revision

Adding a new language

If you are interested into translate this character sheet to a different language, you only need to translate some specific files. No programming skills are required for this purpose, you only need to open some files and add your translations. All of them in the translations folder:

  • [languages.xml] (./translations/languages.xml) Defines the available languages in the application.
  • [character_sheet.xml] (./translations/character_sheet.xml) Contains all tags and words used into the PDF file. All texts are shown exactly as written, therefore take care about whitespaces, length of underscores, etc.
  • [skills] (./translations/skills/) A folder for each language containin two files: Natural Skills and Learned Skills. Any skill added here will be shown in the correct place of the character sheet. All skills are sorted alphabetically.

The firsts two files are defined as XML, but do not worry if you do not know what it is, because it is very easy to change. The first thing to do is add the language. For this, you should modify the file included in the translations folder called languages.xml.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<translator> 
  <languages abbrev="en" >English</languages> 
  <languages abbrev="es" >Español</languages> 
</translator>

Basically, what you must do is to add a new line under the one containing the word “Español” the same way and BEFORE the one that contains the code </translator>. Changing the name of the language that we want the program show and the content of “abbrev” with a code that connect with it. This code will be the one we use on the files for searching the available languages. For example, if we want to add Italian to the program we should add a line containing:

<languages abbrev="it" >Italiano</languages>

Also the abbrev value will be used in the next steps of the translation.

After adding a language, you must now translate the file character_sheet.xml. Add the new translations using the tag defined in the previous file. In our example, you need to write the new text as <it>Some new italian text</it>. Create a translation for any element thats appear on this file.

The last step is adding the skills that you want to shown into the character sheet. This must be done in a folder called with the same language tag as defined before. In our example, create a folder called it in the skills folder that is inside the translations folder. Here you must create two files called exactly skills-natural.txt and skills-learned.txt. In each file add each skill in a separate row. The application will add the skills in the correct place of the character sheet and will sort it alphabetically for you.

If you have any doubt, check the already existing files as examples to see the structure of the needed files. It is really easy to do. When all texts are translated, the character sheets is ready to be generated.

Clone this wiki locally