I18N.txt 2.09 KB
Newer Older
1 2 3 4 5 6
----------------------------------------------------------------------
Internationalization
----------------------------------------------------------------------

(1) Declaration of available languages:

7 8 9 10 11 12
    <languages>
      <language code="de">Deutsch</language>
      <language code="en">English</language>
    </languages>

    Optional image for every language.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85

(2) Localization of layouts:

- The @LANG@ variable contains the language suffix.

  Example: Using @LANG@ to select a localized image:

  <layout name="foo">
     <![CDATA[ ... <img src="prefix-@LANG@.png"> ... ]]>
  </layout>

- Message catalogs:

  First, define the messages:

  <msg name="foo" lang="en">To Page Start</msg>
  <msh name="foo" lang="de">Zum Seitenanfang</msg>

  Refer to messages from layouts:

  <layout name="bar">
    <![CDATA[ ... <img ... title="@MSG:foo@"> ... ]]>
  </layout>

(3) Localization of pages:

- One does the language selection on section and/or paragraph level:

  <page id="foo">
    <title lang="en">...</title>
    <title lang="de">...</title>

    <sect1 lang="en">...</sect1>
    <sect1 lang="de">...</sect1>

    <sect1>
      <title lang="en">...</title>
      <title lang="de">...</title>
      <p lang="en">...</p>
      <p lang="de">...</p>
    </sect1>
  </page>

(4) Cross-language links

  <a idref="foo" lang="en">...</a>

(5) Localization of "related" links:

  <related idref="foo">The Title of The Book</related>

    Generates a language-independent link

  <related idref="foo" lang="en">The sun</related>
  <related idref="foo" lang="de">Die Sonne</related>

    Language-specific related links

----------------------------------------------------------------------
Language Representation in HTML
----------------------------------------------------------------------

- Generate type map files for Apache

- Generate foo.html.LANG instead of foo.html

- All languages are generated by default.
  If no <languages> element exists, the whole I18N stuff is disabled.

- Include language code also in the HTML element:
  <html lang="en">...</html>

- Hyperlinks: Are always expanded and use foo.html.LANG syntax