Add files to create PO (gettext) files from XML to simplify
authorJavier Fernandez-Sanguino <javier.fernandez-sanguino@projectaon.org>
Sat, 6 Feb 2021 17:03:15 +0000 (18:03 +0100)
committerJavier Fernandez-Sanguino <javier.fernandez-sanguino@projectaon.org>
Sat, 6 Feb 2021 17:03:15 +0000 (18:03 +0100)
translation creation and maintenance

common/gettext/README.txt [new file with mode: 0644]
common/gettext/gamebook.its [new file with mode: 0644]
common/gettext/gamebook.loc [new file with mode: 0644]

diff --git a/common/gettext/README.txt b/common/gettext/README.txt
new file mode 100644 (file)
index 0000000..39ba23c
--- /dev/null
@@ -0,0 +1,27 @@
+
+This directory contains the rules to convert Gamebook XML files to the
+Gettext (PO files) so that they can be translated using standard translator's
+tools (such as GNU gettext tools and those available in the translate toolkit at
+https://toolkit.translatehouse.org/download.html)
+
+
+The files included in this directory are:
+
+    - gamebook.its: the rule file to create the XML based on the Internationalization Tag Set standard (ITS, https://www.w3.org/TR/its20/).
+    
+    - gamebook.loc: the locating rule that associates its with XML
+
+For more information see: https://www.gnu.org/software/gettext/manual/gettext.html#Preparing-ITS-Rules
+
+To convert to/from PO the 'itstool' program is used (see http://itstool.org/)
+
+These rules are provided in order to simplify:
+
+ - The creation of new translations of books which are part of Project Aon
+ - The update of existing translations of books 
+ - To make it possible for translators to keep a glossary of translators,
+   simplifying the creation of new translations
+
+
+More information about the gettext format is available in https://www.gnu.org/software/gettext/manual/gettext.html
+
diff --git a/common/gettext/gamebook.its b/common/gettext/gamebook.its
new file mode 100644 (file)
index 0000000..79024b4
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
+  <its:translateRule selector="/data" translate="yes"/>
+  <its:translateRule selector="//data/p" translate="yes"/>
+
+  <!-- If 'p' has an attribute 'translatable' with the value 'no', then
+       the content is not translatable.  -->
+  <its:translateRule selector="//data/p[@translatable = 'no']"
+    translate="no"/>
+</its:rules>
+
diff --git a/common/gettext/gamebook.loc b/common/gettext/gamebook.loc
new file mode 100644 (file)
index 0000000..da648e1
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<locatingRules>
+  <locatingRule name="Messages" pattern="*.xml">
+    <documentRule localName="gamebook" target="gamebook.its"/>
+  </locatingRule>
+</locatingRules>
+