User Tools

Site Tools


translate_mail2voice

This is an old revision of the document!


How to translate Mail2Voice?

Generalities

In Mail2Voice, the translation is made with XML files (named with the .lng extension). All locales files are in the locales folder.

In a .lng file, there are two types of translations: the widgets labels and the vocal messages. The widgets labels are grouped by panel whereas all vocal messages are grouped in the “voiceSentences” section.

Note: the translations are sorted alphabetically in each section.

Widgets

For Widgets, Mail2Voice is capable of translating the Text and TextHeader properties of any widget. So, when translating, it looks in the .lng file and translate these properties for each “setting” entry (except for the “vocalSentences” section of course).

There are two rules:

  1. Every translatable widget must be created in *.Designer.cs files.
  2. in your code, you must use the widget name as the widget variable identifier, like this:

this.mailtoContactButton.Name = “mailtoContactButton”;

Vocal messages

Vocal messages work differently. In your code, you must register vocal messages like this:

  SpeechObject.Singleton.AddVoiceString("emailAddError", "You must specify an email to add this contact.");
  

The first parameter is the identifier of the string which will be used in the .lng file.

Unlike widgets, these messages must be created in *.cs files.

Update translations

To update locales files, you must :

  1. generate the default file (default.lng),
    1. in Mail2Voice root folder, open Git Bash : right click > Git Bash,
    2. type: utils/generate_locale_file.sh
    3. check for the default.lng file in the locales folder.
  2. replace the english.lng file with the default.lng file,
  3. merge changes between the new english.lng and the other locales files and translate the new strings.
translate_mail2voice.1429791482.txt.gz · Last modified: 2023/04/25 16:52 (external edit)