Add new language in Oxygen framework for localization
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 168
- Joined: Fri Jan 20, 2017 1:11 pm
Add new language in Oxygen framework for localization
Hello,
We use oxygen-18.1.0.0.jar, and we need to add the Portuguese, Spanish and Chinese language to our "translation.xml" file.
I have read this page http://www.oxygenxml.com/doc/versions/1 ... works.html and I have updated the "translation.xml" file this way :
However, when I select one of this 3 new languages, I only get english value.
So I have tested the value of.
The value is correct for English and French but stay in English for Portuguese, Spanish and Chinese.
Can you explain me how to add this 3 new languages, please ?
Thanks.
Regards,
Isabelle
We use oxygen-18.1.0.0.jar, and we need to add the Portuguese, Spanish and Chinese language to our "translation.xml" file.
I have read this page http://www.oxygenxml.com/doc/versions/1 ... works.html and I have updated the "translation.xml" file this way :
Code: Select all
<languageList>
<language description="English" lang="en_US"/>
<language description="French" lang="fr_FR"/>
<language description="Portuguese" lang="pt_BR"/>
<language description="Spanish" lang="es_AR"/>
<language description="Chinese" lang="zh_CN"/>
</languageList>
<key value="font_style">
<val lang="en_US">Font style</val>
<val lang="fr_FR">Style</val>
<val lang="pt_BR">Test Portuguese</val>
<val lang="es_AR">Test Spanish</val>
<val lang="zh_CN">Test Chinese</val>
</key>
However, when I select one of this 3 new languages, I only get english value.
So I have tested the value of
Code: Select all
ro.sync.exml.workspace.api.PluginWorkspaceProvider.getPluginWorkspace().getUserInterfaceLanguage()
The value is correct for English and French but stay in English for Portuguese, Spanish and Chinese.
Can you explain me how to add this 3 new languages, please ?
Thanks.
Regards,
Isabelle
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Add new language in Oxygen framework for localization
Hi Isabelle,
What "translation.xml" are you referring to? The one in your custom framework folder?
About this remark:
It will not be enough I'm afraid.
If you open the "oxygen-18.1.0.0.jar" in a zip utility, it will contain a "languageList.properties" file. Those are the only language our code knows of. So you would also need to update that properties file with more languages.
In the same JAR there are also files like "Messages_en_US.properties" containing translations for all the Oxygen common keys in that specific language.
You will probably need to create such files also for your languages. There are a lot of keys so probably for starters you will just copy the content of the English translation properties file.
These keys are used for error messages and various common action names which are not contributed by the framework.
But once the ""languageList.properties"" has been modified to contain the additional languages, and the default locale has been set to one of those languages, Oxygen should also pick up from the framework "translation.xml" the translations for those specific languages for the framework keys.
Regards,
Radu
What "translation.xml" are you referring to? The one in your custom framework folder?
About this remark:
Did you set the default locale to the corresponding language in your Java code before initializing the AuthorComponentFactory?The value is correct for English and French but stay in English for Portuguese, Spanish and Chinese.
It will not be enough I'm afraid.
If you open the "oxygen-18.1.0.0.jar" in a zip utility, it will contain a "languageList.properties" file. Those are the only language our code knows of. So you would also need to update that properties file with more languages.
In the same JAR there are also files like "Messages_en_US.properties" containing translations for all the Oxygen common keys in that specific language.
You will probably need to create such files also for your languages. There are a lot of keys so probably for starters you will just copy the content of the English translation properties file.
These keys are used for error messages and various common action names which are not contributed by the framework.
But once the ""languageList.properties"" has been modified to contain the additional languages, and the default locale has been set to one of those languages, Oxygen should also pick up from the framework "translation.xml" the translations for those specific languages for the framework keys.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 168
- Joined: Fri Jan 20, 2017 1:11 pm
Re: Add new language in Oxygen framework for localization
Radu,
Yes, I was referring to the "translation.xml" file in my custom framework folder.
And yes I set the default locale to the corresponding language in my Java code before initializing the AuthorComponentFactory.
I have tested to add the 3 languages in the file "languageList.properties" and it works fine now.
It was the information I missed.
Thanks for your help.
Regards,
Isabelle
Yes, I was referring to the "translation.xml" file in my custom framework folder.
And yes I set the default locale to the corresponding language in my Java code before initializing the AuthorComponentFactory.
I have tested to add the 3 languages in the file "languageList.properties" and it works fine now.
It was the information I missed.
Thanks for your help.
Regards,
Isabelle
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Add new language in Oxygen framework for localization
Hi Isabelle,
No problem, sorry for the cumbersome way in which you need to be doing this right now. In a future version we'll try to have some proper API to add new languages to Oxygen.
Regards,
Radu
No problem, sorry for the cumbersome way in which you need to be doing this right now. In a future version we'll try to have some proper API to add new languages to Oxygen.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service