From 606cadcd39837e6b6925a72c305e6a667ee9626b Mon Sep 17 00:00:00 2001 From: "Leonardo J. Caballero G" Date: Wed, 8 Jan 2020 18:18:56 -0400 Subject: [PATCH] Added more improvements about i18n support #2 --- opencore/feed/browser/feed_snippet.pt | 4 +- opencore/feed/browser/headlink.pt | 2 +- .../feed/browser/portrait_feed_snippet.pt | 4 +- opencore/feed/configure.zcml | 9 ++-- .../feed/locales/en/LC_MESSAGES/opencore.po | 42 +++++++++++++++++ .../feed/locales/es/LC_MESSAGES/opencore.po | 46 +++++++++++++++++++ opencore/feed/locales/opencore.pot | 43 +++++++++++++++++ opencore/feed/locales/rebuild_i18n | 31 +++++++++++++ 8 files changed, 173 insertions(+), 8 deletions(-) create mode 100644 opencore/feed/locales/en/LC_MESSAGES/opencore.po create mode 100644 opencore/feed/locales/es/LC_MESSAGES/opencore.po create mode 100644 opencore/feed/locales/opencore.pot create mode 100755 opencore/feed/locales/rebuild_i18n diff --git a/opencore/feed/browser/feed_snippet.pt b/opencore/feed/browser/feed_snippet.pt index f713e7e..58042cd 100644 --- a/opencore/feed/browser/feed_snippet.pt +++ b/opencore/feed/browser/feed_snippet.pt @@ -11,7 +11,7 @@

There are currently no - items + items

@@ -52,7 +52,7 @@
- from + from diff --git a/opencore/feed/browser/headlink.pt b/opencore/feed/browser/headlink.pt index 829ba89..5759e34 100644 --- a/opencore/feed/browser/headlink.pt +++ b/opencore/feed/browser/headlink.pt @@ -1,2 +1,2 @@ - diff --git a/opencore/feed/browser/portrait_feed_snippet.pt b/opencore/feed/browser/portrait_feed_snippet.pt index 61be89a..7d2a0b3 100644 --- a/opencore/feed/browser/portrait_feed_snippet.pt +++ b/opencore/feed/browser/portrait_feed_snippet.pt @@ -10,7 +10,7 @@

There are currently no - items + items

@@ -51,7 +51,7 @@ tal:replace="python:view.pretty_date(date)"/>
- from + from diff --git a/opencore/feed/configure.zcml b/opencore/feed/configure.zcml index 9059252..f35c757 100644 --- a/opencore/feed/configure.zcml +++ b/opencore/feed/configure.zcml @@ -1,6 +1,9 @@ - + + + \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: opencore\n" +"X-Poedit-Language: English\n" +"X-Poedit-Country: UNITED STATES\n" + +#: ../browser/headlink.pt:1 +msgid "RSS 2.0" +msgstr "" + +#: ../browser/portrait_feed_snippet.pt:65 +msgid "See all ${context_items_title}" +msgstr "" + +#: ../browser/feed_snippet.pt:66 +msgid "See all ${feed_items_title}" +msgstr "" + +#: ../browser/portrait_feed_snippet.pt:13 +msgid "There are currently no ${context_itemstitle}" +msgstr "" + +#: ../browser/feed_snippet.pt:14 +msgid "There are currently no ${feed_itemstitle}" +msgstr "" + +#: ../browser/feed_snippet.pt:55 +#: ../browser/portrait_feed_snippet.pt:54 +msgid "from" +msgstr "" diff --git a/opencore/feed/locales/es/LC_MESSAGES/opencore.po b/opencore/feed/locales/es/LC_MESSAGES/opencore.po new file mode 100644 index 0000000..ef08c88 --- /dev/null +++ b/opencore/feed/locales/es/LC_MESSAGES/opencore.po @@ -0,0 +1,46 @@ +# Gettext Message File for Spanish translation of opencore domain using on opencore.feed package +# Translators: +# Leonardo J. Caballero G. , 2020. +msgid "" +msgstr "" +"Project-Id-Version: opencore\n" +"POT-Creation-Date: 2020-01-08 21:44+0000\n" +"PO-Revision-Date: 2020-01-08 17:46-0400\n" +"Last-Translator: Leonardo J. Caballero G. \n" +"Language-Team: ES \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Virtaal 0.7.1\n" +"Language-Code: es\n" +"Language-Name: EspaƱol\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: opencore\n" +"X-Is-Fallback-For: es-ar es-bo es-cl es-co es-cr es-do es-ec es-es es-sv es-gt es-hn es-mx es-ni es-pa es-py es-pe es-pr es-us es-uy es-ve\n" + +#: ../browser/headlink.pt:1 +msgid "RSS 2.0" +msgstr "" + +#: ../browser/portrait_feed_snippet.pt:65 +msgid "See all ${context_items_title}" +msgstr "" + +#: ../browser/feed_snippet.pt:66 +msgid "See all ${feed_items_title}" +msgstr "" + +#: ../browser/portrait_feed_snippet.pt:13 +msgid "There are currently no ${context_itemstitle}" +msgstr "" + +#: ../browser/feed_snippet.pt:14 +msgid "There are currently no ${feed_itemstitle}" +msgstr "" + +#: ../browser/feed_snippet.pt:55 +#: ../browser/portrait_feed_snippet.pt:54 +msgid "from" +msgstr "" diff --git a/opencore/feed/locales/opencore.pot b/opencore/feed/locales/opencore.pot new file mode 100644 index 0000000..c24bd61 --- /dev/null +++ b/opencore/feed/locales/opencore.pot @@ -0,0 +1,43 @@ +# --- PLEASE EDIT THE LINES BELOW CORRECTLY --- +# SOME DESCRIPTIVE TITLE. +# FIRST AUTHOR , YEAR. +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2020-01-08 21:44+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: opencore\n" + +#: ../browser/headlink.pt:1 +msgid "RSS 2.0" +msgstr "" + +#: ../browser/portrait_feed_snippet.pt:65 +msgid "See all ${context_items_title}" +msgstr "" + +#: ../browser/feed_snippet.pt:66 +msgid "See all ${feed_items_title}" +msgstr "" + +#: ../browser/portrait_feed_snippet.pt:13 +msgid "There are currently no ${context_itemstitle}" +msgstr "" + +#: ../browser/feed_snippet.pt:14 +msgid "There are currently no ${feed_itemstitle}" +msgstr "" + +#: ../browser/feed_snippet.pt:55 +#: ../browser/portrait_feed_snippet.pt:54 +msgid "from" +msgstr "" diff --git a/opencore/feed/locales/rebuild_i18n b/opencore/feed/locales/rebuild_i18n new file mode 100755 index 0000000..9df4c8b --- /dev/null +++ b/opencore/feed/locales/rebuild_i18n @@ -0,0 +1,31 @@ +#!/bin/sh + +domain='opencore' + +# Synchronise the templates and scripts with the .pot file for opencore domain. +# i18ndude rebuild-pot --pot ./$domain.pot --create $domain --exclude ../browser/rss.pt ../ +i18ndude rebuild-pot --pot ./$domain.pot \ + --create $domain \ + --exclude ../browser/rss.pt \ + ../browser/atom.pt ../browser/feed_snippet.pt ../browser/headlink.pt ../browser/portrait_feed_snippet.pt || exit 1 + +# Synchronise the opencore's pot file (Used for the workflows) +i18ndude sync --pot ./$domain.pot ./*/LC_MESSAGES/$domain.po + +WARNINGS=`find ../ -name "*pt" | xargs i18ndude find-untranslated | grep -e '^-WARN' | wc -l` +ERRORS=`find ../ -name "*pt" | xargs i18ndude find-untranslated | grep -e '^-ERROR' | wc -l` +FATAL=`find ../ -name "*pt" | xargs i18ndude find-untranslated | grep -e '^-FATAL' | wc -l` + +echo "" +echo "There are $WARNINGS warnings (possibly missing i18n markup)" +echo "There are $ERRORS errors (almost definitely missing i18n markup)" +echo "There are $FATAL fatal errors (template could not be parsed, eg. if it's not html)" +echo "" +echo "For more details, run 'find ../ -name \"*pt\" | xargs i18ndude find-untranslated' or" +echo "Look the rebuild i18n log generate for this script called 'rebuild_i18n.log' on locales dir" + +rm ./rebuild_i18n.log + +touch ./rebuild_i18n.log + +find ../browser/ -name "*pt" | xargs i18ndude find-untranslated > rebuild_i18n.log