Adding multilingual text

jAlbum has a mechanism to simplifiy writing skins that support texts in several languages (usually navigation strings like "Next" and "Previous" etc). Look at this example:

$text.previousPage

Given the example above, jAlbum will look for a mapping for the "previousPage" "key" in the current language of the user running jAlbum. jAlbum will look into certain property files. The format of such a file is simply a list of key=value mappings, one for each row. Here is a sample Swedish property file (texts_sv.properties):

up=Upp en nivå
previousPage=Föregående sida
nextPage=Nästa sida
firstPage=Första sidan
lastPage=Sista sidan
atFirstPage=Det här är första sidan
atLastPage=Det här är sista sidan
indexPage=Till index sidan
originalImage=Originalbild
cameraInfo=Kamerainformation
Translator.png


The default language file, used by jAlbum if there is no file for the current language, is texts.properties and contains English texts. To support a new language, say German, simply copy and paste such a file, rename it to texts_de.properties and translate the text strings inside. Finally save it as a UTF-8 encoded text file under a "texts" folder. Note: You can force the use of a certain language by setting a "language" variable to an ISO two character code that the current skin has support for.

Auto-translation

Translator skin not prepared.png

When using the auto-translate functions you need to ensure the skin in use supports multilingual texts, look for a 'texts' directory inside the skin's directory. If that directory does not exist, or the default texts.properties file does not exist you will get an alert when trying to auto translate. jAlbum itself must also support the language to be translated, if the language you want to use is not listed then use the same method to translate jAlbum texts!


jAlbum will use the English texts, texts.properties file as the base language to translate from, hence you cannot translate to English.

Bundled skin warning.png

If you are trying to translate a bundled skin you will see another alert telling you saving changes will not survive a skin update. If you are not the developer of the skin in use, even if it is not a bundled skin, the same will hold true. Either send the file to the skin developer or just repeat the process below to automatically translate the updated skin to your language.

The next step in auto-translation of a single language is to go to preferences>General and change the language to the one you want to translate, in the example above the would be change from English to German. Now go to the tools menu and invoke the translation tool. If using the update all choice you do not need to change language in preferences, just invoke the tool. The update all also lets you add new languages, just add empty language files, then run this tool.

Once the translation has started you will get a progress window, detailing what part of the file is being translated.

If the translation does not happen for any reason just delete your language file and run the auto-translate tool again.

Translator progress.png

Once the translation has finished if you get a warning that the file needs to be encoded in a specific way, usually UTF-8, then go to the 'File' menu and select 'Save with encoding'. Once saved that way you can just close the open text editor window. However, before doing that you may want to do a manual check of the translated texts, changes will be flagged with something like '# Google Translated 99 texts. Please check!'

If you later want to change any of the translations you can either delete the whole file and use the translate all function or delete the whole line(s). Do not delete just the translated text to the right of the equals sign, delete the entire line.