Wool editor translation tutorial

Wool handles multilinguality through a folder structure convention. The top level folders represent the available languages. Folder names represent language codes, like "en", or "pt-PT". The editor follows this convention. Currently, the editor expects all Wool files to be in one language, called the source language. The other folders contain JSON-formatted translation files, which are basically lists containing source and translated phrases. Translation files have the same name as the wool files. Note that you can have any number of subfolders within each top-level folder. The Wool editor saves the translation files in the same relative subfolders as the Wool files.

In the figure on the right, you see the folder tree as shown in the Wool editor. You can see markdowntest.wool in the "en" folder, and a translation markdowntest.json in the "nl" folder. So, to set up your folder structure, just create a folder for every language you want to include.

When you open a project, make sure you open the right top-level folder, with the language codes in it.

When the editor loads the project folder tree, it autodetects the source language as the folder that contains Wool files. The other folders it finds are assumed to be languages to be translated to. If there is only one folder, that will be the source language.

You can select your desired language from the Run menu, which lists all the detected languages. If you now run your Wool file, it will be displayed in the selected language, if translations are available. If no translation file is available, it will show a warning popup.

To start translating, select the "translate" option from the "file" menu. See the figure on the right.

You will get the translation screen, which shows the available translations in the selected language. See the figure below.

Note that there are also other translation functions, in particular "Export POEditor terms", "Load translation" and "Remove translation". These are for importing and exporting terms and translations for use with an external translation tool, such as poeditor.com. When you use the built-in translate function, you will not need these.

Press "Save changes" to save your translations to a json file. If the json file or the subfolder does not exist yet, they will be created. Note that if any translations are missing, the system will show the texts in the source language.

Markdowntest.wool has Markdown-formatted text in it. For example, an empty line indicates a paragraph break. The translation should also be formatted in the same way, which can again be done using Markdown. In some cases, code is included in the source text, such as a link or an action. These should usually be copied verbatim into the appropriate position in the translated text. For example, a Markdown link, like this one:

[This is a link to Google](http://www.google.nl/)
can be translated as:
[Dit is een link naar Google](http://www.google.nl/)
Or an input statement, like this one:
My name is <<input type="text" value="$userFirstName" min="1" max="30">>
can be translated as:
Mijn naam is <<input type="text" value="$userFirstName" min="1" max="30">>

When changing any text in a Wool file, you will have to re-translate the text. The text that was changed is no longer in the translation file as a source text, instead there is still the old source text. The translation screen shows it like this: the translation of the new text is empty, whereas the translation of the old text is in a separate section at the bottom, called "Orphaned translations". You can copy/paste the old translation from there and insert it in the appropriate new translation box.

The orphaned translations will remain until you clear them. Once cleared, they will be removed altogether.

For example, imagine I changed a user response from:

Quotes, images links
Quotes, images, links
The figure below shows the translation screen with the empty and the orphaned translation: