Hi Frank,
Thanks for your answer. The StringResourceWithLocation service is exactly what
I was looking for. I also found some helpful example code under
http://markmail.org/message/sv2z4cvsgmgyctht, but it does not work yet because
I do need a Component Context which I do not have (the drivers main class has a
constructor with a parameter for the Component Context, but the constructor is
called with null for this parameter) and I could not bootstrap for some reason
(I get an exception that the OOo executable could not be found). Any ideas what
I could do? My code looks like this (essentially the same as shown under
http://markmail.org/message/sv2z4cvsgmgyctht):
XPackageInformationProvider xPkgInfo =
PackageInformationProvider.get(m_xContext);
String resUrl = xPkgInfo.getPackageLocation("com.ingres.sdbcx") + "/resources/";
XStringResourceWithLocation xResources =
StringResourceWithLocation.create(m_xContext, resUrl, true, new Locale("en",
"US", ""), "Messages", "", null);
String resString1 = xResources.resolveString("exMessage1");
Best Regards,
Micha
-----Ursprüngliche Nachricht-----
Von: Frank Schoenheit, Sun Microsystems Germany
[mailto:[email protected]]
Gesendet: Mi 23.09.2009 20:41
An: [email protected]
Betreff: Re: [dba-dev] internationalization of exception messages in a database
driver extension
Hi Michael,
> I'm looking for a possiblity to provide the user with custom
> exception messages in a database driver extension, according to the
> locale of his installation/system. The prefered solution from my side
> would be to provide the messages strtings in some sort of plain text
> ressource file(s) and fetch them from there in the driver.
I know that css.resource.OfficeResourceBundle is working fine (we use it
in our drivers, too), but its drawback is that it's based on .res files,
compiled from .src files when building OOo. Since I assume that your
driver is not built in an OOo build env, but with the ODK, this is
probably no option.
I also know that the dialog localization feature is based on text files,
but I'm somewhat lost on the details. AFAIK, the css.resource services
can be used to access such files, but that's an educated guess only. I
suggest you play a little with the StringResourceWithLocation service.
The documentation of those services/interfaces seems to be ... above
average :), so
http://api.openoffice.org/docs/common/ref/com/sun/star/resource/StringResourceWithLocation.html
might indeed help you.
Ciao
Frank
--
- Frank Schönheit, Software Engineer [email protected] -
- Sun Microsystems http://www.sun.com/staroffice -
- OpenOffice.org Base http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]