XML i18n Best Practices, BP 21 comments

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

XML i18n Best Practices, BP 21 comments

Yves Savourel-2

Hello Kara,


> Best Practice 21
>
> The sentence "Error messages, quotations are an example of inserted
> text that usually would not cause problem." is not correct. Error
> messages in particular frequently contain automatically inserted text that
> is not independent and therefore problematic to translate. I would remove
> this sentence.


I don't think error message are more problematic than for example a section title. They are usually grammatically independent from
the surrounding text, etc.

For example, inserting an error message like this:

<p>If you see the error message: "<ref err='er12'/>" call your supervisor.</p>

Seems to me, as OK as inserting a reference to a section title like this:

<p>See "<specref id="DevTerm"/>" for more information.</p>

>From the viewpoint of the caller of the reference, the inserted text is a self-contained phrase.


Yes, many error messages contain themselves inserted text (as any other referenced text), but this is a separate issue that needs to
be resolved separately. For example:

<msg id="nofile">File {0} not found.</msg>

Is a Java-type message where {0} is mark inserted text. Using it directly as a reference would show a glaring problem in the final
result since {0} would be part of the text.

But the issue is not coming from inserting the error message in the referencing text. You would have the same problem (presence of
{0}) if you were just providing the list of the error messages, without inserting them anywhere.

The issue is coming from the fact that the referenced text is not really a text but a piece of code.

I have seen people work around that issue by doing this:

<msg id="nofile">
 <replace by="{0}>[Filename]</replace>
 <text>File [Filename] not found.</msg>
</msg>

And generating their Java properties file from XML.

This way: a) the translator gets some good context; b) the message is translated only once, and c) the doc always consistent with
the software. The cost: one tiny XSLT template to generate the properties file.

I guess I'm trying to show that even error messages with parameters can be used as inserted text. If they are self-contained
sentence they do not break BP10.


Now, all this said, I do agree that using "error message" as an example in the BP may lead to some confusion. So I propose to use
this instead:

"Titles or quotations are examples of inserted text that usually would not cause problem."


Cheers,
-yves