Why Enumerators save the Literal into the file [message #1863926] |
Wed, 06 March 2024 12:34  |
Eclipse User |
|
|
|
I've an application that is using EMF at the core.
As long as I have English speaking customers, I have no issues.
But now I have Japanese customer and I need to translate all the "Literals" of the Enumerator classes to Japanese.
That when I notice that the XMIResource actually saves the "Literal" value and not the "Name" value. Therefore my Japanese version fails loading since it can't load the data that the values are in English and the eCore has Japanese for Literal..
I assumed that the Name will not change since it is the Enumeration definition and build ny application around that idea. like:
N41(0, "N41", "Two State"),
The Resource saves the "Two State" into the file, but that can't be loaded since the Japanese version has other literal value.
Is there a way to make the XMIResource save and load the "Name" and not the "Literal"?
Thanks
Yigal
[Updated on: Wed, 06 March 2024 12:35] by Moderator
|
|
|
|
|
|
Re: Why Enumerators save the Literal into the file [message #1863958 is a reply to message #1863950] |
Fri, 08 March 2024 01:48  |
Eclipse User |
|
|
|
The debugger would help you figure that out. For XML serialization, the work is done by these methods:
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.convertToString(EFactory, EDataType, Object)
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.createFromString(EFactory, EDataType, String)
It seems strange to create a serialization that is not portable across locales...
|
|
|
Powered by
FUDForum. Page generated in 0.04301 seconds