Pages: 1
Print
Author Topic: Auto Generated Text for WebHelp  (Read 4354 times)
mmoulder
Member

Posts: 43


« on: May 03, 2011, 01:59:14 PM »

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?
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: May 04, 2011, 03:27:03 PM »

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

<DITA OT>\xsl\common

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

Posts: 43


« Reply #2 on: May 05, 2011, 10:50:20 AM »

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.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: May 06, 2011, 02:56:31 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.
Logged
mmoulder
Member

Posts: 43


« Reply #4 on: May 06, 2011, 04:19:07 PM »

Thanks for the info I remember that now. Will fix on my side.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #5 on: May 06, 2011, 04:44:56 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 <topicref> elements) would not need altering using this strategy.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #6 on: May 06, 2011, 04:50:42 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):

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.
Logged
Pages: 1
Print
Jump to: