-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Description
To simplify internationalization of context menus I added a method to
JarServiceProvider:
public static Properties readProperties(String name, Locale locale)
In contrast public static Properties readProperties(String name) this method
takes an additional Locale parameter used for overriding properties of the
default properties file with properties from a language specific file. The
method reads the properties as follows:
- 1st it reads properties from the default file (<name>.properties)
- 2nd it reads properties from language specific file
(<name>_<lang>.properties, where <lang> is language of Locale parameter) and
merges them with properties of step 1
- 3rd it reads properties from language/country specific file
(<name>_<lang>_<country>.properties, where <country> is country of Locale
parameter) and merges them with properties read in previous steps
If you want to have configurations for multiple languages, most of
configuration is identical for all langauges (e.g. classnames for action
classes, logical structure of menu).
Usually I'd expect that only ToolTip and MenuText would have to be different
for each language.
Using this method, you could have one general configuration file which includes
all properties, including menu text and tooltips for the default language.
For other languages you would only need to define those properties which differ
from the default, i.e. MenuText, ToolTip...
For example you could have
- config.properties which includes the complete configuration for English GUI
- config_de.properties which only includes German .MenuText and .ToolTip entries
- config_de_CH.properties which consists only of specific overrides for
Switzerland (as Swiss German has different spelling for some words)
I also changed DefaultSyntaxKit.loadConfig to use this new method, so that
automatically the default locale is used.
That way, a developer could use JSyntaxPane "out of the box" and to support new
localization for the menus he'd only have to provide the _<lang>.properties
variant of the configuration somewhere in his project.
Original issue reported on code.google.com by [email protected] on 8 Jul 2010 at 7:41
Attachments: