Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Internationalization of EMF
Internationalization of EMF [message #399037] Mon, 06 March 2006 09:20 Go to next message
John Watson is currently offline John WatsonFriend
Messages: 15
Registered: July 2009
Junior Member
Hi All,

is there an easy way to internationalize the code generated by EMF? I have
no much expirience with ganarated code and I was wondering how can be done
that?

Eric
Re: Internationalization of EMF [message #399052 is a reply to message #399037] Mon, 06 March 2006 12:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Eric,

What needs to be internationalized? Anything we expect needs to be
translated is already generated to strings in .properties files...


Eric Rodrigue wrote:

>
>
> Hi All,
>
> is there an easy way to internationalize the code generated by EMF? I
> have no much expirience with ganarated code and I was wondering how
> can be done that?
>
> Eric
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Internationalization of EMF [message #723036 is a reply to message #399037] Wed, 07 September 2011 13:43 Go to previous messageGo to next message
Andreas Gellendin is currently offline Andreas GellendinFriend
Messages: 12
Registered: July 2009
Junior Member
Hi everybody,

I generated my model with EMF.
It generated some _UI_PropertyDescriptor_description and so on in the plugin.properties file.

Now I created fragment of my plugin, which has also a plugin_de.properties, which contains all the translated strings and also the plugin name (bundle-localization=plugin in manifest file).

When I start my app in german language, the bundle name is loaded correctly from the properties file, but all strings are still loaded from the english version.

What have I done wrong? Or is there a bug in model generation?
I used EMF 2.7.0.
Re: Internationalization of EMF [message #723060 is a reply to message #723036] Wed, 07 September 2011 14:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Andreas,<br>
<br>
I'm not sure how fragments work (that's a question to ask on the
platform newsgroup) but I do know that translations in general do
work when set up correctly because IBM has been using translated
versions for many languages...  <br>
<br>
You could set a breakpoint in EMFPlugin to see by getResourceBundle
isn't returning the German translation.<br>
<br>
<small>    public String getString(String key, boolean translate)<br>
    {<br>
      ResourceBundle bundle = translate ? resourceBundle :
untranslatedResourceBundle;<br>
      if (bundle == null)<br>
      {<br>
        if (translate)<br>
        {<br>
           bundle = resourceBundle =
Platform.getResourceBundle(getBundle());<br>
        }</small><br>
<br>
<br>
<br>
<br>
On 07/09/2011 6:43 AM, Andreas Gellendin wrote:
<blockquote cite="mid:j47roa$5al$1@news.eclipse.org" type="cite">Hi
everybody,
<br>
<br>
I generated my model with EMF.
<br>
It generated some _UI_PropertyDescriptor_description and so on in
the plugin.properties file.
<br>
<br>
Now I created fragment of my plugin, which has also a
plugin_de.properties, which contains all the translated strings
and also the plugin name (bundle-localization=plugin in manifest
file).
<br>
<br>
When I start my app in german language, the bundle name is loaded
correctly from the properties file, but all strings are still
loaded from the english version.
<br>
<br>
What have I done wrong? Or is there a bug in model generation?
<br>
I used EMF 2.7.0.
<br>
</blockquote>
</body>
</html>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Internationalization of EMF [message #723092 is a reply to message #723036] Wed, 07 September 2011 15:15 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Am 07.09.11 15:43, schrieb Andreas Gellendin:
> Hi everybody,
>
> I generated my model with EMF.
> It generated some _UI_PropertyDescriptor_description and so on in the
> plugin.properties file.
>
> Now I created fragment of my plugin, which has also a
> plugin_de.properties, which contains all the translated strings and also
> the plugin name (bundle-localization=plugin in manifest file).
>
> When I start my app in german language, the bundle name is loaded
> correctly from the properties file, but all strings are still loaded

Where from do you know that it is loaded?

Tom
Re: Internationalization of EMF [message #723280 is a reply to message #723092] Thu, 08 September 2011 08:45 Go to previous message
Andreas Gellendin is currently offline Andreas GellendinFriend
Messages: 12
Registered: July 2009
Junior Member
Thanks for your anwers.
After some debugging I relaized that I had the class, that extends EMFPlugin twice in different packages.

When the plugin was loaded one of them was instanciated and the other one was used for
the location of strings. So getPluginRecourceLocator returned always null.

After removing one of the classes it worked.
Seems that there was some old generated stuff that was not deleted.

Andreas
Previous Topic:extending generated editor: patterns?
Next Topic:ManyToOne Lazy loading
Goto Forum:
  


Current Time: Fri Apr 19 15:01:44 GMT 2024

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

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

Back to the top