Difference between revisions of "Translations"

From BaseX Documentation
Jump to navigation Jump to search
 
(12 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
It describes how to translate BaseX into other (natural) languages.
 
It describes how to translate BaseX into other (natural) languages.
  
BaseX is currently available in '''nine''' languages, namely English, German, Japanese, French, Italian, Dutch, Indonesian, Vietnamese and Mongolian.<br/>
+
Thanks to the following contributors, BaseX is currently available in 10 languages:
 +
 
 +
* '''Dutch''': Huib Verweij
 +
* '''English''': BaseX Team
 +
* '''French''': Maud Ingarao
 +
* '''German''': BaseX Team
 +
* '''Hungarian''': Kiss-Kálmán Dániel
 +
* '''Indonesian''': Andria Arisal
 +
* '''Italian''': Massimo Franceschet
 +
* '''Japanese''': Toshio HIRAI and Kazuo KASHIMA
 +
* '''Mongolian''': Tuguldur Jamiyansharav
 +
* '''Romanian''': Adrian Berila
 +
* '''Russian''': Oleksandr Shpak and Max Shamaev
 +
* '''Spanish''': Carlos Marcos
 +
 
 
It is easy to translate BaseX into your native language! This is how you can proceed:
 
It is easy to translate BaseX into your native language! This is how you can proceed:
  
==Using the JAR file==
+
==Working with the sources==
JAR files are nothing else than ZIP archives.
+
 
All language files are placed in the <code>lang</code> directory inside the JAR file:
+
If you have downloaded all BaseX sources via [[Developing with Eclipse|Eclipse]] or [[Git]], you may proceed as follows:
# Unzip the source file <code>English.lang</code> and rename it to your target language (e.g. <code>Zulu.lang</code>)
+
 
# Enter your name and potential contact information in the second line and translate all texts
+
All language files are placed in the <code>[https://github.com/BaseXdb/basex/tree/master/basex-core/src/main/resources/lang src/main/resources/lang]</code> directory of the main project:
# Update your JAR file by copying the translated file into the zipped <code>lang</code> directory. Your new language file will be automatically scanned.
+
# Create a copy of an existing translation file (e.g., <code>English.lang</code>) and rename it to your target language (e.g. <code>Hawaiian.lang</code>).
# Start BaseX and choose your language in the GUI (''Options'' → ''Preferences...'')
+
# Enter your name and contact information in the second line.
# Restart BaseX to see the changes
+
# If you are using Eclipse, refresh the project (via ''Project'' → ''Refresh''); if you are using Maven, type in {{Code|mvn compile}}. Your new language file will be automatically detected.
 +
# Start the BaseX GUI, choose your language via ''Options'' → ''Preferences...'' and close the GUI.
 +
# Translate the texts in your language file and restart BaseX in order to see the changes.
 +
# Repeat the last step if you want to revise your translations.
 +
 
 +
If new strings are added to BaseX, they will automatically be added to your language files in English. The history view in GitHub is helpful to see which strings have recently been updated to a file.
 +
 
 +
==Updating BaseX.jar==
 +
 
 +
You can directly add new languages to the JAR file. JAR files are nothing else than ZIP archives, and all language files are placed in the <code>lang</code> directory into the JAR file:
  
==Using the sources==
+
# Unzip an existing translation file (e.g., <code>English.lang</code>) and rename it to your target language (e.g. <code>Hawaiian.lang</code>)
All language files are placed in the <code>src/main/resources/lang</code> directory of the main project:
+
# Enter your name and contact information in the second line and translate the texts
# Create a copy of the source file <code>English.lang</code> and rename it to your target language (e.g. <code>Zulu.lang</code>)
+
# Update your JAR file by copying the translated file into the zipped <code>lang</code> directory. Your new language file will be automatically detected.
# Enter your name and potential contact information in the second line and translate all texts
+
# Start BaseX.jar, choose your language via ''Options'' → ''Preferences...'' and restart BaseX to see the changes
# Copy the translated file back to the <code>lang</code> directory. Your new language file will be automatically scanned.
 
# Recompile the project, start BaseX and choose your language in the GUI (''Options'' → ''Preferences...'')
 
# Restart BaseX to see the changes
 
  
You may as well change the language in the <code>.basex</code> configuration file,
+
You can also directly assign a language in the <code>.basex</code> configuration file, which is placed in your [[Configuration|home directory]]. The language is assigned to the {{Option|LANG}} option. In order to see where the text keys are used within BaseX, you can set {{Option|LANGKEY}} to <code>true</code>.
which is placed in your [[Configuration|home directory]].
 
To see where the all text keys are used within BaseX, we recommend you to temporarily
 
set the [[Options#LANGKEY|LANGKEY]] option to <code>true</code>.
 

Latest revision as of 15:04, 23 January 2016

This page is part of the Developer Section. It describes how to translate BaseX into other (natural) languages.

Thanks to the following contributors, BaseX is currently available in 10 languages:

  • Dutch: Huib Verweij
  • English: BaseX Team
  • French: Maud Ingarao
  • German: BaseX Team
  • Hungarian: Kiss-Kálmán Dániel
  • Indonesian: Andria Arisal
  • Italian: Massimo Franceschet
  • Japanese: Toshio HIRAI and Kazuo KASHIMA
  • Mongolian: Tuguldur Jamiyansharav
  • Romanian: Adrian Berila
  • Russian: Oleksandr Shpak and Max Shamaev
  • Spanish: Carlos Marcos

It is easy to translate BaseX into your native language! This is how you can proceed:

Working with the sources[edit]

If you have downloaded all BaseX sources via Eclipse or Git, you may proceed as follows:

All language files are placed in the src/main/resources/lang directory of the main project:

  1. Create a copy of an existing translation file (e.g., English.lang) and rename it to your target language (e.g. Hawaiian.lang).
  2. Enter your name and contact information in the second line.
  3. If you are using Eclipse, refresh the project (via ProjectRefresh); if you are using Maven, type in mvn compile. Your new language file will be automatically detected.
  4. Start the BaseX GUI, choose your language via OptionsPreferences... and close the GUI.
  5. Translate the texts in your language file and restart BaseX in order to see the changes.
  6. Repeat the last step if you want to revise your translations.

If new strings are added to BaseX, they will automatically be added to your language files in English. The history view in GitHub is helpful to see which strings have recently been updated to a file.

Updating BaseX.jar[edit]

You can directly add new languages to the JAR file. JAR files are nothing else than ZIP archives, and all language files are placed in the lang directory into the JAR file:

  1. Unzip an existing translation file (e.g., English.lang) and rename it to your target language (e.g. Hawaiian.lang)
  2. Enter your name and contact information in the second line and translate the texts
  3. Update your JAR file by copying the translated file into the zipped lang directory. Your new language file will be automatically detected.
  4. Start BaseX.jar, choose your language via OptionsPreferences... and restart BaseX to see the changes

You can also directly assign a language in the .basex configuration file, which is placed in your home directory. The language is assigned to the LANG option. In order to see where the text keys are used within BaseX, you can set LANGKEY to true.