Recommendations for creating translation files for multiple platforms

Currently, we are faced with the problem of creating and placing a translation for an application for several platforms (iOS, Android, HTML5, BlackBerry ...). Are there any recommendations on placing translations and creating the necessary translation files (en.lproj / Localizable.string, values-fr / strings.xml, ...) on the fly?

I think about placing translations and their keys at the table in Google Docs (or other platforms) and exporting data to csv, as well as using scripts to create files.

I am searching on the internet, but have not yet found a good starting point.

+7
source share
6 answers

You can try Loco or Shuttle as a cross-platform localization tool.

+4
source

Do you know Transifex ?

Transifex is a modern open source localization platform. Its a web-based system that automates the translation workflow for complex international projects.

+3
source

We have successfully used PhraseApp for several platforms. They have an API, so we can provide shell scripts in the project tree to update translations with a quick command. You can even do this as a build step.

Keep in mind that for these services there seem to be some difficult obstacles, since different localized platforms have different sets of functions. For example, Android supports pluralization, in which iOS does not support IIRC.

+2
source

There is http://www.getlocalization.com/

It's free if you are ready to publish and publish your individual lines and translate them publicly.

+1
source

I make applications in English and Japanese. What I do is to save both translations in a file, access to which I can get anywhere in the application, that is, a global variable, instance, singleton, or whatever is comfortable for you. Do all the translations you need in the house because computer translators are not telling the truth. Then, wherever you use them, pull it out of the list based on a boolean that speaks either English or Japanese.

+1
source

An open source online translation tool (deployable to your server) that can meet your requirements, a Pootle that is built on top of the Translate Toolkit . I used Pootle as a translator for LibreCAD . You can view the LibreCAD Translation Server and see it in action. LibreCAD uses Qt as its base structure, and Pootle handles the upload and download of TS files, which are used for translations in Qt. Using Transifex as well, I can tell you that Pootle is not a fantasy (you can see it for yourself, although keep in mind that LibreCAD Translation Server uses an older version of Pootle), but it's nice to work with it. You just need to establish that the files that your application needs to translate can be exported (and possibly imported) from (and possibly to) your translation server. You can translate using a web browser, or you can translate offline, and then proceed to download the edited files and batch submit all your changed translations. Another web-based translation tool that seems to provide a similar but more modern approach than Pootle (looks better and has tight integration with version control), while the Translate Toolkit also has Weblate . It is also open source and can be deployed to your server of choice.

To provide a deeper understanding, if you look at โ€œTranslation-based file formats,โ€ you will have a better idea of โ€‹โ€‹what Pootle and Translate Toolkit is capable of exporting / importing. From this list and from my translation experience, I can tell you that INI files are used for translations in the core and Joomla extensions! , PHP translation arrays are used for translations in Yii applications, and Qt Linguist TS files are used, as mentioned earlier, for translations in Qt applications. I also experimented with the GNU gettext , which is approved by the Foundation Free Software for Localization. GNU gettext uses PO files for translations that can be processed using translation tools.

The basic idea of โ€‹โ€‹all approaches to localization, regardless of the platform, is more or less the same. You develop your code with a special core language and use that language in your code. English would be an ideal choice, but it is not necessary. You must choose a language that all developers can work with, a language that does not slow down development (when searching for several shortcuts for buttons, you would not want to think through only one shortcut for several minutes), and the language used by your main target audience, only in the event that there is a main target audience and at the same time developing taking into account a different language, perhaps the application will look unnatural for your main target audience after it is transferred to your main target s audience. It is also the language in which all your translators will receive the strings of the source language in (and therefore have reference points as a point) to translate to all other target languages. You may have to compromise because we are talking about one and only one development language. Moving at any time during development, you need to insert a language string into your code, you do not directly insert it, but add it to a special function call that is specified on the localization platform you use. In a Qt application, for example, instead of QLabel *label = new QLabel("Password:"); you should write QLabel *label = new QLabel(tr("Password:")); . At run time, the user language is determined inside the tr function call, the corresponding language file for the user language is scanned, and the translated message corresponding to "Password:" for the user language is retrieved and used as a label. Definition / definition of a language is a separate mechanism that essentially receives / sets a global / static variable, the one that is viewed when the tr function is called in the above example. Multiple forms can be applied to each platform (conditional translation based on some parameter). For example, in Yii, you could have 'n==1#one book|n>1#many books' as a translation string. In your application, you would use Yii::t('app', 'n==1#one book|n>1#many books', 1); , that is, you would also indicate the actual number as a parameter so that you can use the correct form (the 'app' parameter used in the translation function belongs to a certain category of translations called app , since in each language you can use different categories of translations for parts of your application).

To add some kind of final understanding, using a common common source code for translations will allow you to reuse the vast majority of translated lines when moving from one structure to another, or even if there are several different implementations for the same application at the same time, for example, a browser-based application exists together with the native application. For plural forms, special processing and separate translations for the same language string are required due to the fact that it is really platform-specific (but if necessary, most plural forms can be eliminated by moving the condition from the translation string domain to the code domain). But the vast majority of translations in the application are direct mappings of one line to another. Some environments, such as Qt, have tools for scanning source files and updating translation files based on new uses of the special translation function ( tr in Qt). If such a tool exists for the framework of your choice, you will not need to add the translation display manually to the translation file. After scanning the source files, the display will be displayed in the translation files, by default, as the source line, as a translation, and waiting for the translation of this line. Explore possible workflows before embarking on an approach.

+1
source

All Articles