DITA and XMetaL Discussion
mmoulder May 3, 2011 at 7:59 pm
Auto Generated Text for WebHelpMay 3, 2011 at 7:59 pmParticipants 5Replies 6Last Activity 11 years, 7 months ago
I am building Japanese WebHelp output and can't figure out what ja_JP.xml file it is using to replace the auto generated text such as Note: and Figure. Any ideas?Derek Read May 4, 2011 at 9:27 pm
Reply to: Auto Generated Text for WebHelpMay 4, 2011 at 9:27 pm
All of the standard HTML output types supported by the DITA OT use the XML files here:
…and so does Webhelp output (because it is simply consuming the same HTML that the others such as CHM consume).mmoulder May 5, 2011 at 4:50 pm
Reply to: Auto Generated Text for WebHelpMay 5, 2011 at 4:50 pm
Any idea why the text like Notes: for example isn't being replaced? There is a strings-ja-jp.xml file in the directory you specify and I have the following in the map file:
I also tried ja_JP and ja-JP, and none of them see to work.Derek Read May 6, 2011 at 8:56 pm
Reply to: Auto Generated Text for WebHelpMay 6, 2011 at 8:56 pm
Unfortunately, my testing shows that the DITA OT won't cascade an xml:lang value from a map into the portion of code that does this string injection (which is at the topic level). Or perhaps it makes more sense to say it doesn't look back or up from within a topic to see what is in the map, it stops at the root of the topic.
So, if you set xml:lang in a map (anywhere) you aren't going to see localized strings in output.
If you set xml:lang on the topic's root element (topic, reference, task, etc) then everything in that topic will use localized strings for that language. If ony a portion of a topic is in another language then you can just set it on a child of the root element too.
For the HTML outputs the DITA OT accepts ja, ja-jp and ja-JP.
It doesn't like underscores, only hyphens.mmoulder May 6, 2011 at 10:19 pm
Reply to: Auto Generated Text for WebHelpMay 6, 2011 at 10:19 pm
Thanks for the info I remember that now. Will fix on my side.Derek Read May 6, 2011 at 10:44 pm
Reply to: Auto Generated Text for WebHelpMay 6, 2011 at 10:44 pm
Note that the DITA OT code that outputs PDF does handle xml:lang at the map level (so that might confuse things).
If you do both types of outputs (or might ever need to) it would be best to come down to the lowest common denominator so both work (ie: code xml:lang inside topics). It makes more sense to me to do it there anyway. A specific topic contains the actual content, which must be in one specific language (possibly more than one, but at least one).
You can then use the same map with topics in different languages (English and Japanese for example). When working on the local file system the easiest way to do that would be to name all the topics the same for both languages, which is usually the case if you send something out for translation. When your Japanese comes back from the translator it would have the same filenames for each topic but the content is now in Japanese. You then put those into an identical file structure but different folder from English. Then the map doesn't need to change case (provided it uses relative paths) though you do need a duplicate copy (one placed relative to the English and another placed relative to the Japanese). Of course if the map contains a title and metadata that needs translating it will need translating too, but the rest of the actual structure of the map (all the
elements) would not need altering using this strategy.Derek Read May 6, 2011 at 10:50 pm
Reply to: Auto Generated Text for WebHelpMay 6, 2011 at 10:50 pm
This is from the DITA LangRef 1.1 (with the keyword “expected” perhaps being particularly relevent when it comes to the DITA OT or a particular version of the DITA OT):
[quote=http://docs.oasis-open.org/dita/v1.1/OS/archspec/xmllang.html]Usage in maps
The xml:lang attribute can be specified on the map element. The expected language inheritance behavior on the map is similar to that on the topic. That is, the primary language for the map should be set on the map element (or assumed by the application if not explicitly set), and should remain in effect for all children unless a child specifies a different value for xml:lang.
If the xml:lang value on a topicref does not match the xml:lang value on a topic, the value on the topic takes precedence.
It could also be that the DITA OT is trying to meet the requirements of that last sentence. I have not tested that to try to confirm.
- You must be logged in to reply to this topic.