Resposive Help localize UI strings

Oxygen general issues.
Michael95
Posts: 7
Joined: Fri Aug 21, 2015 3:33 pm

Resposive Help localize UI strings

Post by Michael95 »

I refer to https://www.oxygenxml.com/doc/versions/ ... responsive
I need to add two languages for Webhelp Responsive UI localized label support (ES and FR-CA).

In step 3
Can we define multiple languages here?
And if so
In step 7 it states we need to localize strings-en-us.xml.

Here are my questions:
In step 7, it doesn't mention that we should rename strings-en-us.xml to signify the corresponding language.
So my question is if you can define multiple files in step 3 how does oxygen know what language strings-en-us.xml relate to?

Thank you
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: Resposive Help localize UI strings

Post by julien_lacour »

Hello,

Yes, in step 3 you can define as many language as needed in webhelp-extension-strings.xml by simply adding a new <lang> element following the structure given in the example.
Step 7 mention that you need to "copy the common DITA-OT strings" not the file itself (it only gives its location). I took note of this and I will complete the step to make it easier to read.

Regards,
Julien
Michael95
Posts: 7
Joined: Fri Aug 21, 2015 3:33 pm

Re: Resposive Help localize UI strings

Post by Michael95 »

Thanks, Julien for your reply.
Now it makes a bit more sense.
Although there still appears to be an issue with the guidance, Step 7 states:
Copy the common DITA-OT strings defined in the DITA-OT-DIR/xsl/common/strings-en-us.xml file. It defines a set generated text available for HTML based transformations (such as note, fig, and table elements). Translate the content of each <str> element.

But the only folder I could find "Figure" was the language files in DITA-OT-DIR\plugins\org.dita.base\xsl\common. There I found the file strings-fr-ca.xml which contains localized strings I need to add to strings-fr-ca.xml in my ...\com.oxygenxml.webhelp.localization folder.

The only issue is that the file from DITA-OT-DIR\plugins\org.dita.base\xsl\common contains localized strings in the following format:

Code: Select all

<variables>
   <variable id="Figure">Figure</variable>
   <variable id="Table">Tableau</variable>
   <variable id="Next topic">Sujet suivant</variable>
...
which is of a different format to the file in ...\com.oxygenxml.webhelp.localization folder, i.e.

Code: Select all

  <str name="linkToThis" js="true" php="false">Fr-ca translated string</str>
  <str name="ExpandAll" js="true" php="false">Fr-ca translated string</str>
  <str name="printThisPage" js="true" php="false">Fr-ca translated string/str>
 ....
Can the <variable id...> items be included in strings-fr-ca.xml, in my ...\com.oxygenxml.webhelp.localization folder?
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: Resposive Help localize UI strings

Post by julien_lacour »

Hello,

Sorry for the delayed answer, I did not get the notification for the previous post.
You can "convert" the <variable> elements into <str> in your com.oxygenxml.webhelp.localization plugin, you will get:

Code: Select all

<str name="Figure">Figure</str>
<str name="Table">Tableau</str>
<str name="Next topic">Sujet suivant</str>
You don't need to set both js and php attributes for strings coming from org.dita.base.

Regards,
Julien
Michael95
Posts: 7
Joined: Fri Aug 21, 2015 3:33 pm

Re: Resposive Help localize UI strings

Post by Michael95 »

oxy1.PNG
Thank you Julien.
It's almost all working now, except on the search page.
Please see the attachment.
I have translated strings in \DITA-OT\plugins\com.oxygenxml.webhelp.localization in:
  • strings-es-es.xml

Note: I can see the localized strings in strings-es-es.xml, i.e.:
<str name="Results for:" js="true" php="false">documento(s) encontrado(s) para</str>
<str name="next.page" js="true" php="false">Siguiente</str>
<str name="prev.page" js="true" php="false">Anterior</str>
  • webhelp-extension-strings.xml and plugin.xml are configured correctly
There may be other strings that cannot be referenced but I'm unaware of them.
You do not have the required permissions to view the files attached to this post.
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: Resposive Help localize UI strings

Post by julien_lacour »

Hello,

I tried on my side using <oXygen/> XML Editor 26.1, build 2024073008 and a simple DITA Map having xml:lang="es" attribute set.
I attached the plugin I'm using, I added your strings and a few more to test them too, the strings appear in my WebHelp output:
com.oxygenxml.webhelp.localization.zip
You should try to clean the output folder or set the 'clean.output' parameter in the transformation.

Other non translated strings should trigger a warning similar to this one:
[DOTX052W]: No string named 'jump.to.content' was found when creating generated text; using the value 'jump.to.content' in your output file.
Regards,
Julien
You do not have the required permissions to view the files attached to this post.
Post Reply