|
Re: Maintain different languages in a model [message #175574 is a reply to message #175559] |
Tue, 04 March 2008 14:35 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Jörg,
I don't think Eclipse generally supports dynamic changes to the locale.
It would generally be necessary to exit and start Eclipse with a
different -nl argument to ensure that properties from the appropriate
*.properties files are loaded consistently throughout the IDE. That's
because lookups tend to be cached based on the locale at the time of
first lookup...
Jörg Kiegeland wrote:
> Has anyone any experience when there is the requirement that a model
> needs to be edited in several languages? The information must be
> stored somehow in the EMF model itself or e.g. in a properties file.
> It is only required to edit a model in one language at one point of
> time, however switching between different languages while editing
> should be possible within the GMF editor.
|
|
|
|
Re: Maintain different languages in a model [message #175645 is a reply to message #175582] |
Tue, 04 March 2008 16:10 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Jörg,
I see. I can imagine having a different instance being edited for each
language; that would be relatively simple I guess. The alternative
starts to sound more like each property should be a EMap from language
code to the actual value the property has for that language, but that's
obviously modifying the metamodel. I can't think of much else that
doesn't modify the metamodel in some way...
Jörg Kiegeland wrote:
> Ed,
>
> it is no requirement that the locale is switched. The UI can be shown
> in one language. My requirement is "only" to say for which language I
> just edit the model. E.g. the user edits the name of a model element
> in a GMF diagram and since the global switch "English language" is
> turned on, the edited content is associated to the English language.
> Then, the user shall have the opportunity to switch to the Japanese
> language. The caption shall be empty again and if the user edits the
> caption, it shall be associated to the Japanese language, while the
> string for the English language is also hold in the model (somewhere).
> So for each attribute in the metamodel which intends to store some
> string of a human language, one need that facility. However best would
> be to not modify the metamodel for this multi-language support but to
> find a generic solution, which needs little adjustments for our
> existing GMF editors (and we have also some custom editors).
>
>
>
> > I don't think Eclipse generally supports dynamic changes to the locale.
> > It would generally be necessary to exit and start Eclipse with a
> > different -nl argument to ensure that properties from the appropriate
> > *.properties files are loaded consistently throughout the IDE. That's
> > because lookups tend to be cached based on the locale at the time of
> > first lookup...
|
|
|
Re: Maintain different languages in a model [message #175680 is a reply to message #175559] |
Tue, 04 March 2008 16:56 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Jörg,
This sounds similar to what the MDT UML2 component's editor for UML models
does, to localize the names of model elements in *.properties files.
The keys of these properties are constructed from the qualified names of the
elements. I imagine that extending this syntax with, for example, an
attribute name could be a simple way of localizing attribute values.
Note also that the UUIDs generated by EMF are valid keys in *.properties
files, if you are using UUIDs.
Take a look at the org.eclipse.uml2.uml.edit plug-in to see how its item
label providers access localized text.
HTH,
Christian
Jörg Kiegeland wrote:
> Has anyone any experience when there is the requirement that a model
> needs to be edited in several languages? The information must be stored
> somehow in the EMF model itself or e.g. in a properties file. It is only
> required to edit a model in one language at one point of time, however
> switching between different languages while editing should be possible
> within the GMF editor.
|
|
|
Powered by
FUDForum. Page generated in 0.04383 seconds