From 3f499b12c6e2a7951508c92c7faab9d8471807d9 Mon Sep 17 00:00:00 2001 From: dbs Date: Sun, 9 Dec 2007 05:02:28 +0000 Subject: [PATCH] Make BaseL10N more flexible about creation timestamp. Add one test for loading PO files, along with required data files. git-svn-id: svn://svn.open-ils.org/ILS/trunk@8180 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- build/i18n/scripts/basel10n.py | 7 ++++--- build/i18n/tests/data/complex.po | 29 +++++++++++++++++++++++++++++ build/i18n/tests/data/complex.pot | 29 +++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 build/i18n/tests/data/complex.po create mode 100644 build/i18n/tests/data/complex.pot diff --git a/build/i18n/scripts/basel10n.py b/build/i18n/scripts/basel10n.py index 8073af5f46..bb816e6a8f 100755 --- a/build/i18n/scripts/basel10n.py +++ b/build/i18n/scripts/basel10n.py @@ -29,19 +29,20 @@ class BaseL10N: def __init__(self): self.pot = polib.POFile() - def pothead(self, version=None): + def pothead(self, version=None, date=None): """ Initializes the header for a POT file to reasonable defaults """ # We should be smarter about the Project-Id-Version attribute if version is None: version = 'Evergreen 1.4' - date = time.strftime("%Y-%m-%d %H:%M:%S") + if date is None: + date = time.strftime("%Y-%m-%d %H:%M:%S") + '-0400' self.pot.metadata['Project-Id-Version'] = version self.pot.metadata['Report-Msgid-Bugs-To'] = \ 'open-ils-dev@list.georgialibraries.org' # Cheat and hard-code the time zone offset - self.pot.metadata['POT-Creation-Date'] = "%s %s" % (date, '-0400') + self.pot.metadata['POT-Creation-Date'] = date self.pot.metadata['PO-Revision-Date'] = 'YEAR-MO-DA HO:MI+ZONE' self.pot.metadata['Last-Translator'] = 'FULL NAME ' self.pot.metadata['Language-Team'] = 'LANGUAGE ' diff --git a/build/i18n/tests/data/complex.po b/build/i18n/tests/data/complex.po new file mode 100644 index 0000000000..48dc35488c --- /dev/null +++ b/build/i18n/tests/data/complex.po @@ -0,0 +1,29 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: Evergreen 1.4" +"Report-Msgid-Bugs-To: open-ils-dev@list.georgialibraries.org" +"POT-Creation-Date: 1999-12-31 23:59:59 -0400" +"PO-Revision-Date: 2007-12-08 23:14:20 -0400" +"Last-Translator: Dan Scott " +"Language-Team: fr-CA " +"MIME-Version: 1.0" +"Content-Type: text/plain; charset=utf-8" +"Content-Transfer-Encoding: 8-bit" + +#: 240:field.aihu.org_unit.label 257:field.ancihu.org_unit.label +msgid "Using Library" +msgstr "Utiliser la bibliothèque" + +#: 2475:field.rxbt.voided.label +msgid "" +"Super crazy long and repetitive message ID from hell" +"Super crazy long and repetitive message ID from hell" +"Super crazy long and repetitive message ID from hell" +"Super crazy long and repetitive message ID from hell" +"Super crazy long and repetitive message ID from hell" +msgstr "ôèàéç" + +#: 524:field.bre.source.label +msgid "Record Source" +msgstr "" diff --git a/build/i18n/tests/data/complex.pot b/build/i18n/tests/data/complex.pot new file mode 100644 index 0000000000..cb4ddc7e35 --- /dev/null +++ b/build/i18n/tests/data/complex.pot @@ -0,0 +1,29 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: Evergreen 1.4" +"Report-Msgid-Bugs-To: open-ils-dev@list.georgialibraries.org" +"POT-Creation-Date: 2007-12-06 23:16:35 -0400" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE" +"Last-Translator: FULL NAME " +"Language-Team: LANGUAGE " +"MIME-Version: 1.0" +"Content-Type: text/plain; charset=utf-8" +"Content-Transfer-Encoding: 8-bit" + +#: 240:field.aihu.org_unit.label 257:field.ancihu.org_unit.label +msgid "Using Library" +msgstr "" + +#: 2475:field.rxbt.voided.label +msgid "" +"Super crazy long and repetitive message ID from hell" +"Super crazy long and repetitive message ID from hell" +"Super crazy long and repetitive message ID from hell" +"Super crazy long and repetitive message ID from hell" +"Super crazy long and repetitive message ID from hell" +msgstr "" + +#: 524:field.bre.source.label +msgid "Record Source" +msgstr "" -- 2.43.2