DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Auto Generated Text for WebHelp

  • mmoulder

    Auto Generated Text for WebHelp

    Participants 5
    Replies 6
    Last Activity 11 years, 3 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?

    Reply

    Derek Read

    Reply to: Auto Generated Text for WebHelp

    All of the standard HTML output types supported by the DITA OT use the XML files here:

    xslcommon

    …and so does Webhelp output (because it is simply consuming the same HTML that the others such as CHM consume).

    Reply

    mmoulder

    Reply to: Auto Generated Text for WebHelp

    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:
    xml:lang=”ja-jp

    I also tried ja_JP and ja-JP, and none of them see to work.

    Reply

    Derek Read

    Reply to: Auto Generated Text for WebHelp

    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.

    Reply

    mmoulder

    Reply to: Auto Generated Text for WebHelp

    Thanks for the info I remember that now. Will fix on my side.

    Reply

    Derek Read

    Reply to: Auto Generated Text for WebHelp

    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.

    Reply

    Derek Read

    Reply to: Auto Generated Text for WebHelp

    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.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support