Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation
Controls pictures
Deprecated components
Developer Documentation
Development Environment Documentation
Error Messages
Gambas Playground
How To's
How To Change the Tab Order of GUI Controls
How To Contribute
How to Create and Open a ".gmail.txt" Archive
How to deal with Git and Gitlab concerning your Project
How to deal with Git and Gitlab for Gambas
How To Deal With Subversion for Gambas
How To Display a Chinese Character
How To Draw with gb.Cairo
How To Enter Data With gb.db.form
How To Get Gambas Web Started (1)
How To Get Started
How To Interface Gambas With External Libraries
How To make a chart with the gb.chart component
How to make a report with Gambas
How To Make KDE Run Gambas Executables Automatically
How To Open, Debug & Compile The IDE
How To Open a MySQL connection and use it
How To Open a SQLite connection and use it
How To Open a Unix ODBC connection and use it
How To Package Gambas
How To Package your Project
How To Print
How to Run Gambas and Gambas Apps on Windows using WSL
How To Run Gambas On Windows using Cygwin
How To Translate A Gambas Project
How To Translate Gambas
How To Translate The Gambas IDE (deprecated)
How To Use Parallel Port
Language Index
Language Overviews
Last Changes
Search the wiki
To Do
Wiki License
Wiki Manual

How To Translate A Gambas Project

1. Mark all strings that need to be translated

By default:
  • The Text property of controls is translated.

  • The code strings are not translated.

To mark a string to be translated, you must enclose it between braces:


PRINT "This string will not be translated"
PRINT ("This string will be!")

Strings that are to be translated are usually all text that the user will read.

Beware not to concatenate translated strings, because the order of words changes with the language. Use the Subst() instruction instead.

2. Check that you correctly enabled project internationalization

You do that in the project property dialog:

The default language allows the translation wizard to know the language used by the untranslated strings.

3. Do the translation

To do that, click on translate... in the Project menu.

If the IDE complains about msgmerge, make sure you have GNU gettext tools installed on your computer.

Then, select your translation language in the left list.

If the translation is not present in the left list, click on the New button and choose a new translation.

If you need translating into a language that does not exist in the new translation dialog, write me and I will add it.

Select an untranslated string in the table.

Then enter its translation into the text field on the bottom of the dialog.

You can indicate that a string must not be translated by entering a single minus character as translated string.

Repeat this process until every string is translated. When you have finished, click on the Close button.

You can translate the project in several shots.

You can play with the toolbar icons.

From left to right, these icons allow you to:
  • Clear the current translated string.

  • Mark a string as not translatable.

  • Copy the untranslated string to the translated one.

  • Verify the current translation, by checking that every symbol character is preserved.

  • Find the next untranslated string.

  • Find the previous untranslated string.

  • Search a text inside the strings to translate, or the translated strings.

There are other functions provided by the dialog box buttons:

From left to right, these buttons allow you to:
  • Insert a new translation in the left language list.

  • Reload the current translation. All your changes are lost.

  • Delete the current translation.

  • Import and merge a translation file into the current one.

  • Export the current translation to a file.

The translation are automatically saved when you change the current language or when you close the translation dialog box.

The result of your translation is stored in a *.po file stored in the .lang directory of the project. The name of this file depends on the language. For example, the french translation is named fr.po.

Each time you make a new version of your project, untranslated strings may change. But don't worry, your translated strings are preserved.

  • If an untranslated string disappears, the translation disappears with it.

  • If a new untranslated string is added, it gets a void translation.

  • All other untranslated strings keep their translation.