Using xml:lang attributes to switch content?
Posted: Tue Mar 08, 2016 9:54 am
I may have painted my company into a corner. Any help for a way out? oXygen 17.1, transforming to WebHelp.
In EN, we have made extensive use of <keywords> (because we have many standard terms, and they also get revised pretty often). We have a big file listing all the keywords, included as a mapref in each ditamap as required. Works great for English.
Now we are localizing. Worse, we are *partially* localizing, since the budget doesn't allow the whole help system at once. So imagine we have two topics, topicA and topicB, and that both include a <keyword keyref="adopt"/> embedded in their content. At launch time, only topicA will be localized, and topicB will be published in English. The desired outcome is that <keyword keyref="adopt"/> would output localized text in topicA and English in topic B.
I had hoped it might work like this:
(1) In the file of keywords, define localized variations:
(2) Add the language attribute to the topics:
and
I rather hoped that Author view for topicA would now include the "Angenommen" value, based on the language attribute switching the choice of keywords to a definition with the matching language attribute. But it does not (unless, perhaps, it would change the output values after a transformation?? But I expect not...).
So, is there any way to achieve the desired goal of these "text variables" in our keywords being published in different languages based on the xml:lang attribute of each topic? Or any other ideas? Or am I just plain busted?
Thanks in advance
In EN, we have made extensive use of <keywords> (because we have many standard terms, and they also get revised pretty often). We have a big file listing all the keywords, included as a mapref in each ditamap as required. Works great for English.
Now we are localizing. Worse, we are *partially* localizing, since the budget doesn't allow the whole help system at once. So imagine we have two topics, topicA and topicB, and that both include a <keyword keyref="adopt"/> embedded in their content. At launch time, only topicA will be localized, and topicB will be published in English. The desired outcome is that <keyword keyref="adopt"/> would output localized text in topicA and English in topic B.
I had hoped it might work like this:
(1) In the file of keywords, define localized variations:
Code: Select all
<keydef keys="adopt">
<topicmeta>
<keywords>
<keyword xml:lang="en">Adopted</keyword>
<keyword xml:lang="de">Angenommen</keyword>
</keywords>
</topicmeta>
</keydef>
Code: Select all
<task id="task_topicA" xml:lang="de"> ...
Code: Select all
<task id="task_topicB" xml:lang="en">
So, is there any way to achieve the desired goal of these "text variables" in our keywords being published in different languages based on the xml:lang attribute of each topic? Or any other ideas? Or am I just plain busted?
Thanks in advance