Translations

From Axel Public Wiki
Jump to navigation Jump to search

Download Translator

  • Download the Translator package from here
  • Unpack it inside the root of your SetupKit (so you will have a Translator folder at the same level of Catalog, LogicLab5, etc.)

Extracting the strings to translate

  • Execute ExtractLogicLab5.bat script to extract the list of all strings that should be translated. The .BAT will generate a set of .MAS ("master") files inside the Common\Dict folder, that are plain text files with the raw strings extracted, grouped by source
  • The .MAS files are tipically grouped by the source of the strings: so the various CatalogXXX.MAS files contains strings from your target devices only
  • You can repeat this operation everytime you need, for example after receiving a new LogicLab release or after creating new target devices
  • Please note that you may need to ajust this script to match your SetupKit structure (for example if you renamed your LogicLab5 folder), or you if want to group the various .MAS files differently

Creating a new dictionary

  • Launch the Translator tool by executing Translator\Translator.exe
  • On the first time choose File/Set dictionary folder and set it to the Common\Dict folder of your SetupKit, if not already set
  • Choose File/New, and insert a short Language code (for example "IT") and a longer Language description (for example "Italian")
  • Choose the .MAS files to use as the source for the strings to translate. Just select all the .MAS files if you want to create a single dictionary for all the strings (recommended and tipical use); but you can also decide to create multiple dictionaries for the same language, if you want to separate the sources of the strings (for example, you could create a IT_LogicLab.DIC for the strings coming from LogicLab core and a IT_Catalog.DIC for the strings coming from your specific catalog)
  • Save the new .DIC dictionary inside your Common\Dict folder of your SetupKit (for example as "IT.DIC")
  • Please remember that ALL dictionaries that match with the current selected language will be loaded and merged

Translating strings

  • You can translate strings by using the Translator tool using the grid view, or by just editing the .DIC files by hand with a text editor (as they are plain text files in UTF-8 format, with paris of original/translated strings, prefixed by "<" and ">" characters)
  • You have to take special care to preserve all the special characters in the strings such as & %s \n \t etc. Also the order of printf-style placeholder must be preserved
  • Please note that the empty strings will NOT be translated, and the original string will be used
  • You can also use the File/Export missing command to generate a .DIC with only a subset of the missing strings only (for example to give it to an external translator), and you can then merge it back with the File/Import command

Updating existing dictionaries

  • Repeat the "Extracting the strings to translate" step to update the .MAS files with all the new strings
  • Open the .DIC file that you want to update with Translator
  • Choose File/Update command, and choose the .MAS files with the source strings (tipically all, but not necessarily, see above)
  • New strings will be added in the current dictionary at the end. You can then edit them here, or export them with File/Export missing (see above)