How To Translate A Gambas Project
1. Mark all strings that need to be translated
- The Text property of controls are 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.
2. Do the translation
To do that, click on translate...
in the Project
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.
Select an untranslated string in the table.
Then enter its translation into the text field on the bottom of the ../../comp/gb.form/dialog
Repeat this process until every string is translated. When you have finished, click on the Close
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 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