Re: translated keys


ekimber@contrext.com
 

When you say "multilingual content" do you mean that a single publication reflects multiple languages?

If so, then you either need language-specific names for the keys (DITA 1.2) or you need to have each language-specific part of the publication in its own key scope (DITA 1.3). This assumes that the languages are not mixed within the same part of the map--if they are then your only solution is to have language-specific keys and key references (which makes it possible to have the same key *references* for DITA 1.2 and 1.3 but use key scopes in DITA 1.3 to simplify the management of the key definitions themselves).

There are two ways to use key scopes in this case:

1. Have each branch of the map be in its own scope and include the translation maps within those scopes.
2. Put each translation map in its own scope and use scope-qualified key references reflecting the language of the content.

Option 1 works when each branch of the map is a separate language:

<chapter xml:lang="en-US" keyscope="en-US" ...>
<mapref href="translations/en-US/keydefs.ditamap"/>
...
</chapter>
<chapter xml:lang="ja-JP" keyscope="ja-JP" ...>
<mapref href="translations/ja-JP/keydefs.ditamap"/>
...
</chapter>

With this approach the key references used in each branch can be directly to the keys and they will resolve to the definitions included within the scope. This is because each branch (the <chapter> elements in this example) is it's own key scope.

Option 2 works (and is required) when the languages are mixed within branches (e.g., different languages within a single topic or different language-specific topics within a single branch):

<bookmap>
...
<frontmatter>
<mapref keyscope="en-US" href="translations/en-US/keydefs.ditamap"/>
<mapref keyscope="ja-JP" href="translations/ja-JP/keydefs.ditamap"/>
...
</frontmatter>
<chapter ...>
...
</chapter>
<chapter ...>
...
</chapter>
</bookmap>

With this approach, the key references need to be qualified with the locale-specific key scope:

For Japanese:

<p>Blah blah <keyword keyref="ja-JP.some-term"/> ....

For English:

<p>Blah blah <keyword keyref="en-US.some-term"/> ....

Which means you'll have to do some modification of the key references in each translation to set the scope prefix.

Cheers,

E.
--
Eliot Kimber
http://contrext.com


´╗┐On 3/11/19, 5:33 AM, "4nxsknkaj7zji4zfh6snc6zk64ck3nhsqsvkwcsr@yahoo.com [dita-users]" <dita-users@yahoogroups.com> wrote:


Hi All,

We have a DITA map with multilingual content.
The map uses keys and the keys are translated. In the ditamap there are references to the translated keys.ditamap. There are multiple keys.ditamap.

We use DITA-OT2 to publish the map to PDF, but the keys are not translated in the output.
Only the first keys.ditamap is used, for all languages in the map.

We tested this also with DITA-OT3 and it is the same thing.

I am aware of the linguistic problems there can be with translation of variables (grammar and syntax), in our case the keys are used in a CE declaration of conformity to identify the kind of product.

Is this a bug? Or is it considered 'not done'?

Best regards,
Anneke Von den Hoff

Join main@dita-users.groups.io to automatically receive all group messages.