# Entities and translation

## Use entities with extreme caution

Entities offer convenience but they should be used with extreme caution in documents that will be translated. Writing (for example) `&FDS&semi;` instead of Fedora Directory Server saves the writer time but transformed entities do not appear in the portable object (PO) files that translators use. Complete translations of documents containing entities are, as a consequence, impossible.

Entities present special obstacles to translators and can preclude the production of high-quality translations. The very nature of an entity is that the word or phrase represented by the entity is rendered exactly the same way every time that it occurs in the document, in every language. This inflexibility means that the word or word group represented by the entity might be illegible or incomprehensible in the target language and that the word or word group represented by the entity cannot change when the grammatical rules of the target language require them to change. Furthermore, because entities are not transformed when XML is converted to PO, translators cannot select the correct words that surround the entity, as required by the grammatical rules of the target language.

If you define an entity — `<!ENTITY LIFT "Liberty Installation and Formatting Tome">` — you can enter `&LIFT&semi;` in your XML and it will appear as `Liberty Installation and Formatting Tome` every time the book is built as HTML, PDF or text.

Entities are not transformed when XML is converted to PO, however. Consequently, translators never see `Liberty Installation and Formatting Tome`. Instead they see `&LIFT&semi;`, which they cannot translate.

Consider something as simple as the following English sentence fragment being translated into a related language: German.

> As noted in the Liberty Installation and Formatting Tome, Chapter 3…

A translation of this might be as follows:

> Wie in dem Wälzer für die Installation und Formatierung von Liberty, Kapitel 3, erwähnt…

Because there is no text missing, the title can be translated into elegant German. Also, note the use of ‘dem’, the correct form of the definite article ('the') when referring to a Wälzer ('tome') in this grammatical context.

By contrast, if entities are used, the entry in the PO file says:

    #. Tag: para
    #, no-c-format
    msgid "As noted in the <citetitle>&LIFT&semi;</citetitle>, Chapter 3…"
    msgstr ""

The translation of this would probably run thus:

    #. Tag: para
    #, no-c-format
    msgid "As noted in the <citetitle>&LIFT&semi;</citetitle>, Chapter 3…"
    msgstr "Wie in <citetitle>&LIFT&semi;</citetitle>, Kapitel 3, erwähnt…"

And the presentation would be thus:

> Wie in Liberty Installation and Formatting Tome, Kapitel 3, erwähnt…

This, of course, leaves the title in English, including words like 'Tome' and 'Formatting' that readers are unlikely to understand. Also, the translator is forced to omit the definite article ‘dem’, a more general construction that comes close to a hybrid of English and German that German speakers call Denglisch or Angleutsch. Many German speakers consider this approach incorrect and almost all consider it inelegant.

Equivalent problems emerge with a fragment such as this:

> However, a careful reading of the Liberty Installation and Formatting Tome afterword shows that…

With no text hidden behind an entity, a German translation of this might be:

> Jedoch ergibt ein sorgfältiges Lesen des Nachworts für den Wälzer für die Installation und Formatierung von Liberty, dass…

If an entity was used to save the writer time, the translator has to deal with this:

    #. Tag: para
    #, no-c-format
    msgid "However, a careful reading of the <citetitle>&LIFT&semi;</citetitle> afterword shows that…"
    msgstr ""

And the translation would be subtly but importantly different:

    #. Tag: para
    #, no-c-format
    msgid "However, a careful reading of the <citetitle>&LIFT&semi;</citetitle> afterword shows that…"
    msgstr "Jedoch ergibt ein sorgfältiges Lesen des Nachworts für <citetitle>&LIFT&semi;</citetitle>, dass…"

When presented to a reader, this would appear as follows:

> Jedoch ergibt ein sorgfältiges Lesen des Nachworts für Liberty Installation and Formatting Tome, dass…

Again, note the missing definite article (den in this grammatical context). This is inelegant but necessary since the translator can otherwise only guess which form of the definite article (den, die or das) to use, which would inevitably lead to error.

Finally, consider that although a particular word never changes its form in English, this is not necessarily true of other languages, even when the word is a proper noun such as the name of a product. In many languages, nouns change (inflect) their form according to their role in a sentence (their grammatical case). An XML entity set to represent an English noun or noun phrase therefore makes correct translation impossible in such languages.

For example, if you write a document that could apply to more than one product, you might be tempted to set an entity such as `&PRODUCT&semi;`. The advantage of this approach is that by simply changing this value in the `Doc_Name.ent` file, you could easily adjust the book to document (for example) Red Hat Enterprise Linux, Fedora, or CentOS. However, while the proper noun `Fedora` never varies in English, it has multiple forms in other languages. For example, in Czech the name `Fedora` has six different forms, depending on one of seven ways in which you can use it in a sentence:

## 'Fedora' in Czech

Case | Usage | Form
--- | --- | ---
Nominative | the subject of a sentence | Fedora
Genitive | indicates possession | Fedory
Accusative | the direct object of a sentence | Fedoru
Dative | the indirect object of a sentence | Fedoře
Vocative | the subject of direct address | Fedoro
Locative | relates to a location | Fedoře
Instrumental | relates to a method | Fedorou

For example:

- Fedora je linuxová distribuce. — Fedora is a Linux distribution.

- Inštalácia Fedory — Installation of Fedora

- Stáhnout Fedoru — Get Fedora

- Přispějte Fedoře — Contribute to Fedora

- Ahoj, Fedoro! — Hello Fedora!

- Ve Fedoře 10… — In Fedora 10…

- S Fedorou získáváte nejnovější… — With Fedora, you get the latest…

A sentence that begins S Fedora získáváte nejnovější… remains comprehensible to Czech readers, but the result is not grammatically correct. The same effect can be simulated in English, because although English nouns lost their case endings during the Middle Ages, English pronouns are still inflected. The sentence, 'Me see she' is completely comprehensible to English speakers, but is not what they expect to read, because the form of the pronouns `me` and `she` is not correct. `Me` is the accusative form of the pronoun, but because it is the subject of the sentence, the pronoun should take the nominative form, `I`. Similarly, `she` is nominative case, but as the direct object of the sentence the pronoun should take its accusative form, `her`.

Nouns in most Slavic languages like Russian, Ukrainian, Czech, Polish, Serbian, and Croatian have seven different cases. Nouns in Finno–Ugaric languages such as Finnish, Hungarian, and Estonian have between fifteen and seventeen cases. Other languages alter nouns for other reasons. For example, Scandinavian languages inflect nouns to indicate definiteness — whether the noun refers to 'a thing' or 'the thing' — and some dialects of those languages inflect nouns both for definiteness and for grammatical case.

Now multiply such problems by the more than 40 languages that Publican currently supports. Other than the few non-translated strings that Publican specifies by default in the `Doc_Name.ent` file, entities might prove useful for version numbers of products. Beyond that, the use of entities is tantamount to a conscious effort to inhibit and reduce the quality of translations. Furthermore, readers of your document in a language that inflects nouns (whether for case, definiteness, or other reasons) will not know that the bad grammar is the result of XML entities that you set — they will probably assume that the translator is incompetent.