LOCALES

Introduction

Sailwave is designed with UK English character strings. However, Sailwave facilitates the translation of these strings into other languages or English variations at run time. Locale files created and maintained by Sailwave users can be downloaded from the Sailwave web site download page. Alternatively, you can create your own locale files as described below, and then optionally donate them to the Sailwave site by sending as an attachment to enquiries@sailwave.com.

Selecting a locale

The Locale tab on the Edit+GlobalOptions window in Sailwave allows you to select a locale from the set of locales you have installed. Initially this will just be the UK English locale: eng. You also need to turn on the locale facility using the check box on this tab.

Location of locale files

Locale files must be saved to or created in the Locales sub-folder of your sailwave installation folder; usually c:\program files\sailwave. This is as much as you need to know if you are using locales created by other users. The following paragraphs describe how to create locale files.

File format

Locale files are Windows ini files and follow the standard syntax conventions of such files. Each file is divided into sections called for example: [id] and [wineditcompetitor]. The contents of each section is then a list (one per line) of string pairs separated by a = character: for example Author=Colin Jenkins and BUTTON:New=New. Any white space either side of the equal sign is ignored. Windows ini files are not case-sensitive. Comment lines can be included in the file by starting them with a ; character. Blank lines are ignored.

Creating a new locale file

eng.ini is supplied completely defined with English translations. To create you own locale file copy eng.ini and rename to something appropriate, remembering it must have a .ini extension.

Section list

Each locale file can contains the following sections:-

  • [id] - identification of the author.
  • [Winwindow name] - a section per window containing translations for each window.

[id] section

The [id] section contains information about the author. The contents of this section is in continual development; please use eng.ini as an example and edit as necessary.

[Winwindow name] sections

The window name sections contain translations that apply to all controls in that window. Controls that are associated with text, and thus can be translated, are:-

  • Buttons
  • Entry field prompts
  • Check boxes
  • Radio buttons
  • Radio button groups
  • Fixed strings
  • Tab names
  • Window names
  • Tooltips
  • Menu names
  • Menu items

The left hand side of a translation is the name of the control. Names are 20 characters long and constructed from the control type followed by the start of the English translation; with (for technical reasons) spaces and = characters replaced by _ characters. Control names must never be changed; they are created by Sailwave and need to remain constant so that they can be found in the locale. The right hand side is the translation text itself; initially supplied in English; just edit as appropriate. The translation text can optionally include the specification of a hot key by prefixing the key with the & character. Use the | character to force your translations to include NewLine sequences; mostly used for tool tips.

Here is an example of a complete window section:-

[WinViewPickList] WINDOW:History=History TAB:Folders=&Folders BUTTON:Clear_lists=Cle&ar lists BUTTON-TIP:Clear_the_list_of_se=Clear the list of series and the list of folders BUTTON:Open_the_selected_se=&Open the selected series BUTTON-TIP:Open_the_selected_se=Open the selected series BUTTON:Close=&Close TAB:Series=&Series BUTTON:Delete_from_list=&Delete from list BUTTON-TIP:Delete_the_selected_=Delete the selected series from the list. This|does NOT delete the series; just removes it from|the history list. BUTTON:Open_a_series_in_the=&Open a series in the selected folder BUTTON-TIP:Open_a_series_in_the=Open a series in the selected folder

Keeping your locale file up to date

Sailwave is continually changing and so is the content of eng.ini. It would be a huge job to check for changes with each release manually so Sailwave provides facilities to help you maintain your locale files with minimum effort.

When you start Sailwave one of the first things it does is check to see if your selected locale is up to date. If there are missing strings, Sailwave will update your locale file with English translations in the appropriate sections and let you know what has happened. You should then edit your locale file, looking for English text on the right hand side of any translation and edit it as you like. For example you may see a new line like BUTTON:Generate_RYA_=Generate RYA return form. It is likely that a single person has volunteered to keep the locale for your region up to date, so instead of editing the file, you could just look on the web site to see if there is a new version of your locale available for download, or post a message on the SUG to see what's happening. Attempts will be made to get new copies of Sailwave out to these volunteers early so that the locales are up to date when a new version is announced.

Notes

  • Never under any circumstances edit the left hand side of a translation.
  • If a control has a tool tip, you'll usually find it immediately after the translation for the control itself.
  • Entry fields have a tip but no text because the text is variable.
  • Keep a translation on one line.
  • The controls in Sailwave are a fixed size so try and replace the English text with something of about the same size otherwise you may see truncation effects on controls where the text cannot wrap.
  • When a window or tab sheet has a paragraph of text made up of individual text strings, rather then a paragraph in an entry control, each text string (each line) must be translated separately.
  • You can edit your locale files while running Sailwave, but the changes will not affect any windows that were open before the changes. In the case of the main Sailwave frame window, you must close and then restart Sailwave to see the changes.
  • We recommend the ISO 3166-2 or Microsoft XP locale naming conventions, but there is in fact no restriction on locale file names, other then they have a .ini extension. The list of MS XP locale names can be found at microsoft.com/globaldev/winxp/langtla.asp.

www.sailwave.com enquiries@sailwave.com