diff options
author | Peter <Peter.Gijsels@gmail.com> | 2010-03-07 15:37:00 (GMT) |
---|---|---|
committer | Peter <Peter.Gijsels@gmail.com> | 2010-03-07 15:37:00 (GMT) |
commit | b02beb3e24ea95ae1ef10537f965a162ebf39ab5 (patch) | |
tree | 19b151a70876ca15023cd85c367b706c5ebbdff0 /i18n/example | |
parent | ea211eca1f3aebf2381577f0092f494248c617d4 (diff) |
Added initial support for translating html strings.
Diffstat (limited to 'i18n/example')
-rw-r--r-- | i18n/example/index.es.html | 48 | ||||
-rw-r--r-- | i18n/example/index.html | 24 | ||||
-rw-r--r-- | i18n/example/messages.es.po | 25 | ||||
-rw-r--r-- | i18n/example/messages.mo | bin | 0 -> 607 bytes | |||
-rw-r--r-- | i18n/example/messages.po | 26 | ||||
-rw-r--r-- | i18n/example/messages.pot | 26 |
6 files changed, 149 insertions, 0 deletions
diff --git a/i18n/example/index.es.html b/i18n/example/index.es.html new file mode 100644 index 0000000..041b8ab --- /dev/null +++ b/i18n/example/index.es.html @@ -0,0 +1,48 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> + <head> + <title class="translate"> + Un Titulo en Castellano + </title> + </head> + <body> + <h1 class="translate"> + Un Encabezado en Castellano + </h1> + <p> + <div class="someClass translate"> + Eso es un 'div' con <i>'markup'</i>. + </div> + <h1> + Instructions + </h1> + To translate (part of) this page I followed these steps: + <ul> + <li> + I added a class "translate" to each html element that needs to be + translated. + </li> + <li> + I ran the script ../html2po.py to generate messages.po (this + xgettext(1) equivalent for html) + </li> + <li> + I moved messages.po to messages.pot + </li> + <li> + msginit -l es -i messages.pot -o messages.es.po + </li> + <li> + I added the Spanish translations to messages.es.po + </li> + <li> + msgfmt -i messages.es.po + </li> + <li> + ../translate-html.py -o index.es.html + </li> + </ul> + </p> + </body> +</html> + diff --git a/i18n/example/index.html b/i18n/example/index.html new file mode 100644 index 0000000..b0ef394 --- /dev/null +++ b/i18n/example/index.html @@ -0,0 +1,24 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> <head> +<title class="translate">An English Title</title> +</head> + +<body> +<h1 class="translate">An English Header</h1> +<p><div class="someClass translate">This is a div with <i>markup</i>.</div> + +<h1>Instructions</h1> +To translate (part of) this page I followed these steps: +<ul> + <li>I added a class "translate" to each html element that needs to be + translated.</li> + <li>I ran the script ../html2po.py to generate messages.po (this + xgettext(1) equivalent for html)</li> + <li>I moved messages.po to messages.pot</li> + <li>msginit -l es -i messages.pot -o messages.es.po</li> + <li>I added the Spanish translations to messages.es.po</li> + <li>msgfmt -i messages.es.po</li> + <li>../translate-html.py -o index.es.html</li> +</ul> + +</body> </html> diff --git a/i18n/example/messages.es.po b/i18n/example/messages.es.po new file mode 100644 index 0000000..e7f3d73 --- /dev/null +++ b/i18n/example/messages.es.po @@ -0,0 +1,25 @@ +# Spanish translations for PACKAGE package. +# Copyright (C) 2010 ORGANIZATION +# Peter Gijsels <peter.gijsels@gmail.com>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2010-03-07 15:51+CET\n" +"PO-Revision-Date: 2010-03-07 16:02+0100\n" +"Last-Translator: Peter Gijsels <>\n" +"Language-Team: Spanish\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ASCII\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: html2po.py 1.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "An English Header" +msgstr "Un Encabezado en Castellano" + +msgid "An English Title" +msgstr "Un Titulo en Castellano" + +msgid "This is a div with <i>markup</i>." +msgstr "Eso es un 'div' con <i>'markup'</i>." diff --git a/i18n/example/messages.mo b/i18n/example/messages.mo Binary files differnew file mode 100644 index 0000000..d3d72bd --- /dev/null +++ b/i18n/example/messages.mo diff --git a/i18n/example/messages.po b/i18n/example/messages.po new file mode 100644 index 0000000..4c06dee --- /dev/null +++ b/i18n/example/messages.po @@ -0,0 +1,26 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2010-03-07 16:25+CET\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: ENCODING\n" +"Generated-By: html2po.py 1.0\n" + + +msgid "An English Header" +msgstr "" + +msgid "An English Title" +msgstr "" + +msgid "This is a div with <i>markup</i>." +msgstr "" + diff --git a/i18n/example/messages.pot b/i18n/example/messages.pot new file mode 100644 index 0000000..e614122 --- /dev/null +++ b/i18n/example/messages.pot @@ -0,0 +1,26 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2010-03-07 15:51+CET\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: ENCODING\n" +"Generated-By: html2po.py 1.0\n" + + +msgid "An English Header" +msgstr "" + +msgid "An English Title" +msgstr "" + +msgid "This is a div with <i>markup</i>." +msgstr "" + |