Skip navigation

The core language for localization of the Ministra TV platform interface is English.

To translate localization po-files of the Ministra TV platform interface, it is recommended to use Poedit editor.
Each application in the form of npm-package contains its own json-files of localizations generated based on po-files with translation.
An example of a path to json-files of localization: /stalker_launcher_apps/magcore-app-tv/2.2.8/app/lang ,
where
magcore-app-tv
- package name
2.2.8
- version of the package.

Work procedure

The recommended procedure of working with po-files:

1. Create new or update existing po-files by the programmer. For more information, see section Generating localization files.
2. Transfer po-file to the person responsible for the collection and systematization of po-files, as well as work with translators. Check if all the required files exist.
3. Transfer of po-files to the translator. Translation. More in the section Translation implementation.
4. Return of po-files, check for all the required files and their translation.
5. Return po-files as a single archive to the programmer. Implementation.

Generation of localization files

To localize applications, the gettext internationalization system is used. It is recommended to use the gettext command of magsdk, spasdk, stbsdk platforms to scan the code, create and update localization files.
To do this, specify in index.js file (located at the root of the project) the codes of the desired languages.

require('magsdk/node_modules/spa-plugin-gettext/config').default.languages = ['de', 'ru', 'sl', 'uk'];

Next, in the console (while in the root of the project) run the command "magsdk gettext". When you run it, you generate (or update, if they already exist) the po-files, and also create json-files with translation on their basis. These json-files are placed in the application and are used when the program is running.
To get up-to-date translation in the code, use npm-package cjs-gettext. To work with po-files, use the editor Poedit. ISO 639-1 standard is used to denote languages.
After performing these steps po-files are sent for translation. Upon return of files with the translation, replace the old po-files with the translated. Then run the gettext command. The command will scan the po-files and update the json-files.

Translation implementation

1. Download Poedit editor from the official website http://www.poedit.net/download.php
2. Install the program.
3. Run Poedit editor. Select FileOptionsGeneral. Enter your name and email.

Poedit editor interface description

The program appearance when opening po-file

Smart Launcher localization

The following elements of the program are described in the picture:
(1) - the text that requires translation
(2) - text translated in automatic mode and therefore requiring verification.
If it is correct, then you need to confirm its correctness by pressing the button "Fuzzy" (at the top, with painted clouds).
Or fix it manually.
(3) - the text that requires translation
(4) - in fact, a place for inscribing a translation.
(5) - a comment to the source text is often used if the text for translation is part of a larger sentence. Or, if you need to specify an error in the source text to the developer.
(6) - this text has a comment
(7) - this text has been translated or corrected by you and is considered accurate.

Translation

To add a translation to po-file:

  1. Open the file with localization using Poedit;
  2. Choose a phrase with missing translation;
  3. Enter the translation in the appropriate field (element (4) in the picture).

Correcting errors in the file with ready translation is done by editing the Translation field. Correcting errors in source keys (English localization) is impossible. So that the programmer in the future could make corrections in the Source text field (element (3)), make a note in the Comment field (element (5)).

It is also important to remember the features of program translation.
After changing the language in the application, all the text parts of one localization will be replaced with the corresponding parts of the other localization. For correct translation display:

  • the volume of the translated text should not significantly exceed the original;
  • avoid using extra spaces or line breaks.

For example:
In the source key, there is a phrase "Hello world!". Suppose that in the process of translation into Russian, this phrase turned into " Здравствуй дивный большой мир! ". Plus, at the end of the phrase, the Enter key is pressed several times. After changing the localization to Russian, all characters will be displayed (along with extra spaces or line breaks). As a result, the text will take several lines and deforms the program interface. Or only the part of the text that will fit into the text area will be displayed.

Need Help

Cindy is an expert on the Ministra TV platform and the author of this article.

Was this article helpful?

Yes No

Sorry to hear that.
How can we improve this article?

We use cookies in order to optimise our website, provide you with the best possible user experience and help us promote our products. Please read our Cookie Policy to find out how we use cookies and how you can control cookies.
By using this website or closing this message, you acknowledge our Privacy Policy and agree to our use of cookies as described in our Cookie Policy.