Dialog Localization

From Apache OpenOffice Wiki
Jump to: navigation, search



Beginning with OpenOffice.org 2.2.0 it is possible to localize dialogs created in the Dialog Editor. The localization always refers to complete Dialog Libraries, not to single dialogs. A Dialog Library's default state is “Not localized”. In this state dialogs behave and are stored in the same way as before the localization feature was available.

The entry point for localizing a Dialog Library is the Manage User Interface Languages dialog that can be openend by clicking the Manage Language button in the dialog tool window. The following illustration shows the dialog editor with an opened Manage User Interface Languages dialog.

Dialog Editor with Manage User Interface Languages dialog

Initially no language is defined, so the Present Languages list has no entry. The dialog captions shows that the localization refers to the complete library Standard. To enable localization for this library the Add... button has to be used. It opens another dialog allowing to chose the first language to be supported (see the next illustration). The currently active UI language is preselected.

Set Default User Interface Language dialog

Template:Documentation/Note

After choosing a language and clicking the OK button this language becomes the only entry in the Present Languages list of the Manage User Interface Languages dialog:

Manage User Interface Languages dialog with one language

The first language also becomes the first default language. As stated in the comment on the dialog itself the Default language is relevant in two situations.

  • If a dialog does not support the language that is required the strings for the default language will be displayed. Example: A dialog supports English and French with English beeing the Default Language. If this dialog is used with German being the Office's user interface language, English strings will be displayed.
  • When a new language is added, all strings are taken from the default language. Example: A button label is “Thanks” for English and “Merci” for French with English being the default language. When adding German as another language the label initially will also be “Thanks”. The idea behind this behavior is that a user creating a localized dialog usually will like to take his own mother language or a common language like English as reference for translating to any other language.

Now - or any time later - other languages can be added by again clicking the Add... button. This time a slightly different dialog is used:

Add User Interface Languages dialog

It allows to choose more than one language. As also described in the comment on the dialog the strings for the new languages will be copied from the current default language. After checking one or more languages and clicking the OK button these languages also become entries in the Present Languages list of the Manage User Interface Languages dialog:

Manage User Interface Languages dialog with three languages

The default language can be changed by selecting another language and clicking the Default button. One ore more languages can be deleted by selecting them and clicking the Delete button. As deleting a language also deletes all strings associated with this language this action will only be completed after a corresponding warning message has been acknowledged by the user. If the Default Language is deleted the first of the remaining languages will become Default Language.

If all languages are deleted the Library will return to the “not localized” state. The Resource IDs (see Technical Background) stored in the localizable dialog/control properties will be replaced by the corresponding strings assigned to the last Default Language.

If a Dialog Library is localized an additional Language toolbar is visible. It allows to select the current language as shown in the next illustration. Besides the List Box containing the Languages another Manage Language button is placed allowing to open the Manage User Interface Languages dialog also from the Language toolbar.

Dialog Editor with Locale Toolbar

All localizable dialog/control strings are displayed for this current language. So the button label in the illustration is “English” if English is selected as current language but it can be different for the other languages. If a localized property is changed using the Properties Dialog this change also is only related to the current language. The next illustration shows how the dialog could look after switching the current language to French.

Dialog Editor with French as current locale

The following list shows which dialog/control properties are localizable at all:

  • Label (Button, Check Box, Option Button)
  • Text (Text Box, Combo Box)
  • StringItemList (List Box, Combo Box)
  • Title (Dialog)
  • CurrencySymbol (Currency Field)
  • HelpText (all controls)

Currently the localization is limited to strings that are visible in the dialog or that could become visible in another context like the help text.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages