Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Question about translating the plug-in manifest
Question about translating the plug-in manifest [message #133443] Tue, 19 May 2009 10:30 Go to next message
Eclipse UserFriend
Originally posted by: benjamin.wolff.web.de

hi,


i have a question concerning the plug-in manifest translation.
in my application i make extensive use of command and menuContribution
extension points. like the name of views, perspectives etc. there
are end-user representable strings defined in the plugin.xml for menus
and commands.
one demand of the application is to choose between english and german
language for the UI during login, a usual case of internationalization i think.
since this seems to work well with RAP in conjunction with translatable
strings in the java code (with the NLS class) i don't exactly see how
can i achieve such an i18n for the plugin.xml strings.
i need to translate these strings (which are notated for example %courseView.title,
and located in a *.properties file) on a per-rap-session basis.

after reading the RAP i18n guide ( http://help.eclipse.org/ganymede/topic/org.eclipse.rap.help/ help/html/advanced/internationalization.html)
i dont really see how this can be accomplished. is it basically possible what i'm trying
to achieve? is the article mentioned above still up-to-date?!

do i have to/can i use e.g. plugin_de_DE.properties files in my classpath?!

moreover, i planned to set the locale during login (rap-ui-session already created)
by setting RWT.setLocale(Locale.GERMAN);
does this reflect on the RWT.NLS class or where does this class get
the language information??!


would be great if someone could shed some light on this :). thx!


greetings,
ben
Re: Question about translating the plug-in manifest [message #133457 is a reply to message #133443] Tue, 19 May 2009 11:08 Go to previous messageGo to next message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Hi Ben,

did you add the bundle org.eclipse.equinox.rap.registry [1] to your
application? This patches the default translation handling as per
default, translated strings are hold statically.

Regards,
Stefan.

[1] CVS: /cvsroot/rt/org.eclipse.rap/runtime.ui/

Ben W. schrieb:
> hi,
>
>
> i have a question concerning the plug-in manifest translation.
> in my application i make extensive use of command and menuContribution
> extension points. like the name of views, perspectives etc. there
> are end-user representable strings defined in the plugin.xml for menus
> and commands.
> one demand of the application is to choose between english and german
> language for the UI during login, a usual case of internationalization i
> think.
> since this seems to work well with RAP in conjunction with translatable
> strings in the java code (with the NLS class) i don't exactly see how
> can i achieve such an i18n for the plugin.xml strings.
> i need to translate these strings (which are notated for example
> %courseView.title,
> and located in a *.properties file) on a per-rap-session basis.
>
> after reading the RAP i18n guide
> ( http://help.eclipse.org/ganymede/topic/org.eclipse.rap.help/ help/html/advanced/internationalization.html)
>
> i dont really see how this can be accomplished. is it basically possible
> what i'm trying
> to achieve? is the article mentioned above still up-to-date?!
>
> do i have to/can i use e.g. plugin_de_DE.properties files in my classpath?!
>
> moreover, i planned to set the locale during login (rap-ui-session
> already created)
> by setting RWT.setLocale(Locale.GERMAN);
> does this reflect on the RWT.NLS class or where does this class get
> the language information??!
>
>
> would be great if someone could shed some light on this :). thx!
>
>
> greetings,
> ben
Re: Question about translating the plug-in manifest [message #133497 is a reply to message #133457] Tue, 19 May 2009 12:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: benjamin.wolff.web.de

hi stefan,


it works!! thanks a lot!

so i'll sum up my results in case someone is interested in this issue:

1. internationalize strings in the java code (buttons, messages etc.) works like a charm as described
in the RAP i18n guide [1]
2. the RWT#NLS class works with the RWT#getLocale() method to determine which language to use.
so setting the locale manually to e.g. RWT.setLocale(Locale.GERMAN) (during e.g. a login process)
the strings from a *_de.properties file are used, the same is true for Locale.ENGLISH
and a *_en.properties file.
3. to internationalize the plug-in manifest (strings in plugin.xml and manifest.mf) the following steps
are required:
- checkout org.eclipse.equinox.registry as a source project [2]
- checkout org.eclipse.rap.equinox.registry as a source project [3]
- add these two bundles to your launch configuration, be careful to use the org.eclipse.equinox.registry
bundle from the workspace, not from the target platform!
- now the plug-in manifest will be translated on a per-rap-session base. one can use plugin_de.properties
and plugin_en.properties for example in conjunction with Locale.GERMAN and Locale.ENGLISH. works like a charm!
- don't forget to add 'Bundle-Localization: plugin' to the manifest.mf file of your RAP application


[1] http://help.eclipse.org/ganymede/topic/org.eclipse.rap.help/ help/html/advanced/internationalization.html
[2] CVS: /cvsroot/rt/org.eclipse.equinox/components/bundles/org.eclip se.equinox.registry
[3] CVS: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.equin ox.registry



there is one question though, when running the application the following message is displayed:

!ENTRY org.eclipse.equinox.registry 2 0 2009-05-19 13:54:31.475
!MESSAGE The extensions and extension-points from the bundle "org.eclipse.rap.equinox.registry" are ignored. The bundle is not marked as singleton.


can this be ignored or should i be nervous about that? :)


greetings,
ben


Stefan Roeck schrieb:
> Hi Ben,
>
> did you add the bundle org.eclipse.equinox.rap.registry [1] to your
> application? This patches the default translation handling as per
> default, translated strings are hold statically.
>
> Regards,
> Stefan.
>
> [1] CVS: /cvsroot/rt/org.eclipse.rap/runtime.ui/
>
> Ben W. schrieb:
>> hi,
>>
>>
>> i have a question concerning the plug-in manifest translation.
>> in my application i make extensive use of command and menuContribution
>> extension points. like the name of views, perspectives etc. there
>> are end-user representable strings defined in the plugin.xml for menus
>> and commands.
>> one demand of the application is to choose between english and german
>> language for the UI during login, a usual case of internationalization
>> i think.
>> since this seems to work well with RAP in conjunction with translatable
>> strings in the java code (with the NLS class) i don't exactly see how
>> can i achieve such an i18n for the plugin.xml strings.
>> i need to translate these strings (which are notated for example
>> %courseView.title,
>> and located in a *.properties file) on a per-rap-session basis.
>>
>> after reading the RAP i18n guide
>> ( http://help.eclipse.org/ganymede/topic/org.eclipse.rap.help/ help/html/advanced/internationalization.html)
>>
>> i dont really see how this can be accomplished. is it basically
>> possible what i'm trying
>> to achieve? is the article mentioned above still up-to-date?!
>>
>> do i have to/can i use e.g. plugin_de_DE.properties files in my
>> classpath?!
>>
>> moreover, i planned to set the locale during login (rap-ui-session
>> already created)
>> by setting RWT.setLocale(Locale.GERMAN);
>> does this reflect on the RWT.NLS class or where does this class get
>> the language information??!
>>
>>
>> would be great if someone could shed some light on this :). thx!
>>
>>
>> greetings,
>> ben
Re: Question about translating the plug-in manifest [message #133523 is a reply to message #133497] Tue, 19 May 2009 12:57 Go to previous messageGo to next message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Ben W. schrieb:
>
> there is one question though, when running the application the following
> message is displayed:
>
> !ENTRY org.eclipse.equinox.registry 2 0 2009-05-19 13:54:31.475
> !MESSAGE The extensions and extension-points from the bundle
> "org.eclipse.rap.equinox.registry" are ignored. The bundle is not marked
> as singleton.
>

I noticed this, too. However, there aren't any extension-points in this
fragment, so you can ignore the error.

I filed a bug on this issue:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=276880

Regards,
Stefan.
Re: Question about translating the plug-in manifest [message #507162 is a reply to message #133497] Tue, 12 January 2010 11:04 Go to previous messageGo to next message
Peter  is currently offline Peter Friend
Messages: 3
Registered: January 2010
Junior Member
Any ideas on if this fix also works (or at least should work) for RCP application?
Re: Question about translating the plug-in manifest [message #507184 is a reply to message #507162] Tue, 12 January 2010 12:00 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
I am afraid, I don't understand what fix you are referring to

On 12.01.2010 12:04, Peter wrote:
> Any ideas on if this fix also works (or at least should work) for RCP
> application?
Re: Question about translating the plug-in manifest [message #507189 is a reply to message #507184] Tue, 12 January 2010 12:38 Go to previous messageGo to next message
Peter  is currently offline Peter Friend
Messages: 3
Registered: January 2010
Junior Member
Ah of course! Embarrassed
Ben mentions solving the problem with translation by downloading and including two plugins,

"
3. to internationalize the plug-in manifest (strings in plugin.xml and manifest.mf) the following steps
are required:
- checkout org.eclipse.equinox.registry as a source project [2]
- checkout org.eclipse.rap.equinox.registry as a source project [3]
"

I was wondering if this problem/fix is specific for RAP, or would also apply for RCP?
Re: Question about translating the plug-in manifest [message #507191 is a reply to message #507189] Tue, 12 January 2010 12:53 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
On 12.01.2010 13:38, Peter wrote:
> Ah of course! :blush: Ben mentions solving the problem with translation
> by downloading and including two plugins,
>
> "
> 3. to internationalize the plug-in manifest (strings in plugin.xml and
> manifest.mf) the following steps
> are required:
> - checkout org.eclipse.equinox.registry as a source project [2]
> - checkout org.eclipse.rap.equinox.registry as a source project [3]
> "
>
> I was wondering if this problem/fix is specific for RAP, or would also
> apply for RCP?
Yes, this problem is specific for RAP. The extension registry wasn't
multi-user aware, hence we had to find a way to make multi-user.
Meanwhile the extension registry can be configured to support multiple
locales and therefore the above described plug-ins become obsolete. See
[1] for more details.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=295630

--
Rüdiger Herrmann
http://eclipsesource.com
Re: Question about translating the plug-in manifest [message #507222 is a reply to message #507191] Tue, 12 January 2010 14:49 Go to previous message
Peter  is currently offline Peter Friend
Messages: 3
Registered: January 2010
Junior Member
OK. Many thanks for your reply! Smile
Previous Topic:TableViewer and vertical scrolling
Next Topic:Drag&Drop in RAP: State of affairs, tutorials/examples?
Goto Forum:
  


Current Time: Thu Apr 25 19:24:44 GMT 2024

Powered by FUDForum. Page generated in 0.03831 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top