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 obtained from the Sailwave web site download page, or you can create your own based on the details below. If you would like to donate your locale file to the site, please send it to enquiries@sailwave.com.

Selecting a locale

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.

Locatiion 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.

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 [editcompetitor]. The contents of each section is then a pair of strings separated by a = character: for example Author = Colin Jenkins and Fleet = Division. Any white space 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 - some sections can get quite big so its useful to structure them using comments. Blank lines are ignored.

Section list

Each locale file must contain an [id] section followed by an option section for each window in Sailwave. If a window has not been translated, the section for it need not exist in the locale file. If the section does exist it can be empty; having the effect of an untranslated window. Refer to the eng.ini for a complete list of window section names.

[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.

[window name] sections

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

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

The translation can optionally include the specification of a hot key by prefixing the key with the & character.

Here are some example translations.

  • fleet = &Division
  • nationality = &Nationalität
  • default rating = &Rating
  • Fleet = Fl&eet
  • Helm = S&kipper

The text on the left (of the = character) is the text to be translated and must correspond exactly with the text on a control but it is not case-sensitive. The text on the right is the translation and is reproduced in the user interface exactly as typed. In the Fleet example shown above, the translation is simply changing the hot key, which is on the F by default.

Creating a new locale

If you cannot find a locale file for your nationalityor dialect on the Sailwave web site, you can create you own locale by following these steps:-

  • Use MyComputer (for example) to navigate to the Sailwave locales folder.
  • Copy eng.ini and rename it appropriately; e.g. nor.ini.
  • Open the file (for example by double-clicking on it) and edit the right-hand-side translations appropriately. You do not need to do them all at once; do a few and see what it looks like. Read the Notes section below for some tips.

Keeping your locale file up to date

Sailwave is continually changing and thus so is the content of eng.ini. It would be a huge job to check for changes with each release manually so Sailwave provides a helper function for this. When you start Sailwave using a locale other than eng.ini one of the first things it does is check to see if your locale is up to date. If there are missing strings it shows you them in a list and gives you the option of adding them to your locale file there and then. If you accept this option, you then simply go and edit your locale file, scanning for English text (easily detected) and translate it as appropriate. For example it may ad a line like Generate RYA return form = Generate RYA return form.

Notes

  • The controls in Sailwave are a fixed size so try and replace the Engligh 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.
  • eng.ini is unconditionally updated when you install a new version of Sailwave. Please do not edit this file directly; make a copy of it and edit that.
  • Watch out for the trailing ... on some menu items; its part of the string and thus must be included in the left hand side of the translation. The standard Windows meaning of ... is to signify that the menu item is going to open a window; we recommend that you keep this standard.

www.sailwave.com enquiries@sailwave.com