Webhelp responsive language checking for Chinese
Posted: Mon Jan 29, 2018 7:51 pm
Hi,
We had trouble in getting some Chinese localized strings into the responsive webhelp pages produced by the oXygen plugin.
We currently have 2 variants (zh-cn and zh-tw). By default, the build_dita.xml file will take only the first 2 characters of the language definition (see code below). Although it works with most of the languages, it is causing problem with Chinese or any language variants with a dedicated language file (en-us, en-gb).
Any rational behind your code decision?
We had trouble in getting some Chinese localized strings into the responsive webhelp pages produced by the oXygen plugin.
We currently have 2 variants (zh-cn and zh-tw). By default, the build_dita.xml file will take only the first 2 characters of the language definition (see code below). Although it works with most of the languages, it is causing problem with Chinese or any language variants with a dedicated language file (en-us, en-gb).
Any rational behind your code decision?
Code: Select all
<!-- Set webhelp.language property -->
<if>
<isset property="document.locale"/>
<then>
<!-- Use use propertyregex from antcontrib -->
<propertyregex property="webhelp.language" input="${document.locale}" regexp="(..)" select="\1" defaultvalue="en" override="true"/>
</then>
...