How to translate texts in SaltOS

Translate different literals that have applications SaltOS  It's very simple. With just two steps achieve our purpose. In this mini tutorial two possible cases when you want to edit an existing translation, or when you want to add a new language were addressed.

First we will explain briefly how the system works language SaltOS. To do just enough to know two types of file.

Archive languages.

Path to the file: SaltOS/xml/common/langs.xml

This is the file that contains the information of different languages, their structure is very simple, containing rows xml <row>  two values. First <label> Language (Country) </label>  It is used to indicate text that appears in the user profile selector, the current format is language name in brackets country. And <value> file name </value>  which is the name of the file where that language texts are, the current format stands for both linked to underscore and the country in capitals (language_country).

Example of a row of langs.xml file:

  <row>
  	<label>Español (España)</label>
  	<value>es_ES</value>
  </row>

Files translated texts.

Path to folder: SaltOS/xml/lang.

This is the file that contains the texts in different languages, one file per language. The file name consists of the name of the language and the Country (language_country), the file structure is very simple, containing rows xml <aplicación>With the name of each application SaltOS, each of these rows contains multiple values, each of these values ​​is a text in the application, <variable_interna> Translation Text </variable_interna>. Within these xml tags internal variable, can be found with two different attributes (revised and translated), if not find any attribute means that the text is translated and confirmed.

Attributes:

  • revised="False"This attribute indicates that the text is translated by an automatic translator.
  • translated="False"This attribute indicates that the text is not translated.

Example of a row texts contacts file:

  <contactos>
  	<list>Listado de contactos</list>
  	<create>Nuevo contacto</create>
  	<formview>Detalle del contacto</formview>
  	<forminsert>Alta de un nuevo contacto</forminsert>
  	<formupdate>Modificación del contacto</formupdate>
  	<defaultdata>Datos del contacto</defaultdata>
  	<add>Añadir contacto</add>
  </contactos>

Having explained this, if you want to add a new language, edit the langs.xml file and add a new row with the information in your language and then create a new file in the folder of translated files (xml / lang) with the appropriate name. Use file as shown in another language, please es_ES.xml file as it is with which the application is developed. Acronyms languages ​​and countries are based on ISO 639 you can find more information ISO 639.


XML lines
60,895
PHP lines
18,657
JS lines
11,620
XSLT lines
2,498
CSV lines
1,919
CSS lines
577