Hi Brian,
Brian Raymond wrote:
I was looking at how the localization framework handles things using getResText and it seems pretty straightforward given the classes which exist to extract values.
Not sure what you are referring to here. What 'localization framework' do you have in mind?
I was referring to OOo's localization framework which looks like it uses language.xba and .src files in the OOo source to build up the strings into modules. I looked at the source of some of the java wizards to see how they did it.
Sorry, I don't know how l10n is handled in the Java wizards. The OOo l10n framework probably requires a full OOo build environement to create the files and installing them right into the core product installation. So this probably more suitable for extending the OOo product than for an add-on component.
I have a Java UNO component deployed using the package manager.
If not what is the most direct way to add support? I looked at some stuff using the registry with support in my code for determining the local, I assume that's the standard way to localize?
If with 'registry' you mean the OOo configuration services, yes, you can use them. Even OOo itself uses them (in version 2.0) to localize its menus. And you don't need to determine the locale yourself. If running in the openoffice.org process that is handled for you automatically.
To do this, you have to create a configuration schema (xcs-file) defining properties of type 'xs:string' which are marked as 'oor:localized="true"'. Then you can provide a data file (xcu) that provides the localized texts.
The only thing I've seen code on are things that use the configuration services and in the java code uses the locale setting to pull the right string out. I haven't seen anything that does it automatically as you suggest. Is it possible for you to point me to a code sample showing how to do this in java?
You simply read settings from the configurations services, just as you do with the locale now (also see the configuration chapter of the Developer's Guide). If a setting is characterized as localized in the configuration schema, then the data files can contain different values for different languages. When using the configuration services the right value for the current language is selected automatically. You can provide the desired language as a parameter; otherwise it will use the language that is set on the default ConfigurationProvider by the application. In the office this is the UI language under which the office is running.
You can look in the schema files under share/registry/schema/ and the data files under share/registry/data/ in your OOo installation for examples of how configuration files for this purpose can look. Unfortunately the installed data files contain only a single language. You can find examples for multi-lingual xcu files in the source code of version 1.1.x.
There might also be existing examples or snippets showing this approach. The api project and its mailing list could be a better place to look for them.
Ciao, Joerg
-- Joerg Barfurth Sun Microsystems - Desktop - Hamburg >>>>>>>>>>>>>>>>>> using std::disclaimer <<<<<<<<<<<<<<<<<<<<<<< Software Engineer [EMAIL PROTECTED] OpenOffice.org Configuration http://util.openoffice.org
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
