Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » ViewPart and Translatable Name
ViewPart and Translatable Name [message #75164] Fri, 22 February 2008 05:37 Go to next message
Eclipse UserFriend
Hi,

I need to translate the tab title of a viewPart at its initialization. I
try to use setPartName() in createPartControl(), but it only updates the
tab title when I set the focus on the viewPart.

I have seen that in the Extensions view of plugin.xml, the "name" field
has the following description :

"A translatable name that will be used in the UI for this view"

So, I would like to know if there is a way to parameter the name of the
viewpart at the initialization ?

Thanks for your help.

Regards,

Cédric G.
Re: ViewPart and Translatable Name [message #75181 is a reply to message #75164] Fri, 22 February 2008 06:11 Go to previous messageGo to next message
Eclipse UserFriend
Hi Cédric,

RAP provides I18N support since the 1.0.1 release to help with such
cases. Unfortanetly we didn't update the help center yet but you can
still find a tutorial:
* in your eclipse help system if you have installed the latest tooling
* go to [1]


[1]
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.rap/org .eclipse.rap.help/help/html/advanced/internationalization.ht ml?revision=1.2&root=Technology_Project

But changing the name of a viewpart should work without problem. Do you
have a test case / snippet to reproduce the problem? In that case it
would be great if open a new bug with the snippet.

Greets
Benny

Cédric G. wrote:
> Hi,
> I need to translate the tab title of a viewPart at its initialization. I
> try to use setPartName() in createPartControl(), but it only updates the
> tab title when I set the focus on the viewPart.
>
> I have seen that in the Extensions view of plugin.xml, the "name" field
> has the following description :
>
> "A translatable name that will be used in the UI for this view"
>
> So, I would like to know if there is a way to parameter the name of the
> viewpart at the initialization ?
>
> Thanks for your help.
>
> Regards,
>
> Cédric G.
>
Re: ViewPart and Translatable Name [message #75199 is a reply to message #75181] Fri, 22 February 2008 08:09 Go to previous messageGo to next message
Eclipse UserFriend
Hi Benjamin,

In fact, the setPartName() works well. But when, I put it in the
createPartControl(), I still have to focus the viewPart on the browser to
see the title updating.

More generally, it has been asked to the application on which I'm working
to support Internationalization but not multisession-users
internationalization.

So, on the server side, I have an .ini file where I set the language of
the application.

Then, in the Activator class of the plugin, I read it and then use the
classic bundle implementation of RCP.
The application support two languages :

- resource_en.properties
- resource_fr.properties

All works well, but I have encountered the problem I have explained above.

Thanks for the tutorial :

I have tried to create a plugin.properties and export the viewPart name
from the
plugin.xml file to this file. That works well :)

But I got another question now :

I have created two files :

- plugin_en.properties
- plugin_fr.properties

In the start() method of the Activator class, I'm doing a SetLocale()
But the plugin is always starting with plugin_fr.properties. I think that
is because
my computer is set in French.

Is there a way to tell OSGi to start in a specific Locale ?

Thanks for your help,

Regards,

Cédric G.
Re: ViewPart and Translatable Name [message #75247 is a reply to message #75199] Fri, 22 February 2008 14:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-dev.volanakis.de

Hi Cedric,

in Eclipse, try adding "-nl en" or "-nl fr" to the "Program Arguments"
in your launch configuration.

For your deployed app, you should add this either to the commandline
parameter in the web.xml file (see below) or use the 'osgi.nl' property
in your config.ini instead.

<init-param>
<param-name>commandline</param-name>
<param-value>-nl fr</param-value>
</init-param>

See also
http://help.eclipse.org/help33/topic/org.eclipse.platform.do c.isv/reference/misc/runtime-options.html

Regards,
Elias.


Cédric G. wrote:

> In the start() method of the Activator class, I'm doing a SetLocale()
> But the plugin is always starting with plugin_fr.properties. I think
> that is because
> my computer is set in French.
> Is there a way to tell OSGi to start in a specific Locale ?
Re: ViewPart and Translatable Name [message #77020 is a reply to message #75247] Thu, 06 March 2008 07:22 Go to previous message
Eclipse UserFriend
Hi Elias,

Thanks for your answers.

I have tried the two ways and it works fine now.

Regards,

Cédric G.
Previous Topic:LifeCycleLock workaround for 1.1 M2
Next Topic:Preferences missing some elements
Goto Forum:
  


Current Time: Sun Aug 31 06:57:28 EDT 2025

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

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

Back to the top