From 92435dd7146f43736656cf722b58b97ac3617595 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 02:49:01 +0200 Subject: [PATCH] the first translation in fpdb! i did a few strings and hardcoded the language to de_DE just for testing. this is more a proof of concept --- pyfpdb/HandHistoryConverter.py | 2 +- pyfpdb/create-mo-files.sh | 1 + pyfpdb/create-po-file.sh | 2 + pyfpdb/fpdb.pyw | 16 ++--- pyfpdb/locale/de_DE/LC_MESSAGES/fpdb.mo | Bin 0 -> 528 bytes pyfpdb/locale/fpdb-de_DE.po | 85 ++++++++++++++++++++++++ pyfpdb/locale/fpdb-en_GB.po | 85 ++++++++++++++++++++++++ 7 files changed, 182 insertions(+), 9 deletions(-) create mode 100755 pyfpdb/create-mo-files.sh create mode 100755 pyfpdb/create-po-file.sh create mode 100644 pyfpdb/locale/de_DE/LC_MESSAGES/fpdb.mo create mode 100644 pyfpdb/locale/fpdb-de_DE.po create mode 100644 pyfpdb/locale/fpdb-en_GB.po diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index 2adf6f13..c6d26fc7 100644 --- a/pyfpdb/HandHistoryConverter.py +++ b/pyfpdb/HandHistoryConverter.py @@ -42,7 +42,7 @@ from Exceptions import FpdbParseError import Configuration #import gettext -#trans=gettext.translation("fpdb", "/home/steffen/poker/fpdb-dev/pyfpdb/locale", languages=["de"]) +#trans = gettext.translation("fpdb", "locale", languages="de_DE") #trans.install() import pygtk diff --git a/pyfpdb/create-mo-files.sh b/pyfpdb/create-mo-files.sh new file mode 100755 index 00000000..85937036 --- /dev/null +++ b/pyfpdb/create-mo-files.sh @@ -0,0 +1 @@ +python /usr/share/doc/python-2.7/examples/Tools/i18n/msgfmt.py --output-file=locale/de_DE/LC_MESSAGES/fpdb.mo locale/fpdb-de_DE.po diff --git a/pyfpdb/create-po-file.sh b/pyfpdb/create-po-file.sh new file mode 100755 index 00000000..c2cdfefe --- /dev/null +++ b/pyfpdb/create-po-file.sh @@ -0,0 +1,2 @@ +python /usr/share/doc/python-2.7/examples/Tools/i18n/pygettext.py --output-dir=locale --default-domain=fpdb --output=fpdb-en_GB.po *.py* + diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index 7ec549f7..700633fd 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -20,9 +20,9 @@ import sys import re import Queue -#import gettext -#trans=gettext.translation("fpdb", "locale", ["en_GB"]) -#trans.install() +import gettext +trans = gettext.translation("fpdb", "locale", ["de_DE"]) +trans.install() # if path is set to use an old version of python look for a new one: # (does this work in linux?) @@ -824,11 +824,11 @@ class fpdb: actiongroup = gtk.ActionGroup('UIManagerExample') # Create actions - actiongroup.add_actions([('main', None, '_Main'), - ('Quit', gtk.STOCK_QUIT, '_Quit', None, 'Quit the Program', self.quit), - ('LoadProf', None, '_Load Profile (broken)', 'L', 'Load your profile', self.dia_load_profile), - ('SaveProf', None, '_Save Profile (todo)', 'S', 'Save your profile', self.dia_save_profile), - ('Preferences', None, 'Pre_ferences', 'F', 'Edit your preferences', self.dia_preferences), + actiongroup.add_actions([('main', None, _('_Main')), + ('Quit', gtk.STOCK_QUIT, _('_Quit'), None, 'Quit the Program', self.quit), + ('LoadProf', None, _('_Load Profile (broken)'), 'L', 'Load your profile', self.dia_load_profile), + ('SaveProf', None, _('_Save Profile (todo)'), 'S', 'Save your profile', self.dia_save_profile), + ('Preferences', None, _('Pre_ferences'), 'F', 'Edit your preferences', self.dia_preferences), ('import', None, '_Import'), ('sethharchive', None, '_Set HandHistory Archive Directory', None, 'Set HandHistory Archive Directory', self.select_hhArchiveBase), ('bulkimp', None, '_Bulk Import', 'B', 'Bulk Import', self.tab_bulk_import), diff --git a/pyfpdb/locale/de_DE/LC_MESSAGES/fpdb.mo b/pyfpdb/locale/de_DE/LC_MESSAGES/fpdb.mo new file mode 100644 index 0000000000000000000000000000000000000000..e609cdaeb81dc817430104423c4eb97baba792a9 GIT binary patch literal 528 zcmYjNO;6k~5H(eyD5{Xkp{E{vEJEI9X^~J$5hiiBQS-6gEJ*Doa+BHMHrSEltyum= z52z>p8vO_T4V?%i80qPa?WggZcf0-cnqaLXULm64@TgkspCc|1FA-OWLHqlj{~+@< zLT-?^5Pz|Mf&3471DQM_WE1HbGMQQ^7hpkG(33JTvZhmO7ODmM`nxqhLGO?DuY%85nzM-0PkE5WyWjFmc!}&Cn_H>-Rytz?`tdYLXvR}P z4@Ju31YBQK3p@!)=EicJQDZykKlh=*rYeHvtt{m`8Co@g|_b;?gxcSp~FP tHQh)j|41VGoQ_z!1QjvoL3 literal 0 HcmV?d00001 diff --git a/pyfpdb/locale/fpdb-de_DE.po b/pyfpdb/locale/fpdb-de_DE.po new file mode 100644 index 00000000..0ea895a7 --- /dev/null +++ b/pyfpdb/locale/fpdb-de_DE.po @@ -0,0 +1,85 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2010-08-13 02:45+CEST\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: ENCODING\n" +"Generated-By: pygettext.py 1.5\n" + + +#: Hand.py:1102 +msgid "*** DEALING HANDS ***" +msgstr "" + +#: Hand.py:1107 +msgid "Dealt to %s: [%s]" +msgstr "" + +#: Hand.py:1112 +msgid "*** FIRST DRAW ***" +msgstr "" + +#: Hand.py:1122 +msgid "*** SECOND DRAW ***" +msgstr "" + +#: Hand.py:1132 +msgid "*** THIRD DRAW ***" +msgstr "" + +#: Hand.py:1142 Hand.py:1360 +msgid "*** SHOW DOWN ***" +msgstr "" + +#: Hand.py:1157 Hand.py:1375 +msgid "*** SUMMARY ***" +msgstr "" + +#: Hand.py:1300 +msgid "*** 3RD STREET ***" +msgstr "" + +#: Hand.py:1314 +msgid "*** 4TH STREET ***" +msgstr "" + +#: Hand.py:1326 +msgid "*** 5TH STREET ***" +msgstr "" + +#: Hand.py:1338 +msgid "*** 6TH STREET ***" +msgstr "" + +#: Hand.py:1348 +msgid "*** RIVER ***" +msgstr "" + +#: fpdb.pyw:827 +msgid "_Main" +msgstr "_Datei" + +#: fpdb.pyw:828 +msgid "_Quit" +msgstr "_Beenden" + +#: fpdb.pyw:829 +msgid "_Load Profile (broken)" +msgstr "_Profil Laden (kaputt)" + +#: fpdb.pyw:830 +msgid "_Save Profile (todo)" +msgstr "" + +#: fpdb.pyw:831 +msgid "Pre_ferences" +msgstr "_Einstellungen" + diff --git a/pyfpdb/locale/fpdb-en_GB.po b/pyfpdb/locale/fpdb-en_GB.po new file mode 100644 index 00000000..479adcc0 --- /dev/null +++ b/pyfpdb/locale/fpdb-en_GB.po @@ -0,0 +1,85 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2010-08-13 02:45+CEST\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: ENCODING\n" +"Generated-By: pygettext.py 1.5\n" + + +#: Hand.py:1102 +msgid "*** DEALING HANDS ***" +msgstr "" + +#: Hand.py:1107 +msgid "Dealt to %s: [%s]" +msgstr "" + +#: Hand.py:1112 +msgid "*** FIRST DRAW ***" +msgstr "" + +#: Hand.py:1122 +msgid "*** SECOND DRAW ***" +msgstr "" + +#: Hand.py:1132 +msgid "*** THIRD DRAW ***" +msgstr "" + +#: Hand.py:1142 Hand.py:1360 +msgid "*** SHOW DOWN ***" +msgstr "" + +#: Hand.py:1157 Hand.py:1375 +msgid "*** SUMMARY ***" +msgstr "" + +#: Hand.py:1300 +msgid "*** 3RD STREET ***" +msgstr "" + +#: Hand.py:1314 +msgid "*** 4TH STREET ***" +msgstr "" + +#: Hand.py:1326 +msgid "*** 5TH STREET ***" +msgstr "" + +#: Hand.py:1338 +msgid "*** 6TH STREET ***" +msgstr "" + +#: Hand.py:1348 +msgid "*** RIVER ***" +msgstr "" + +#: fpdb.pyw:827 +msgid "_Main" +msgstr "" + +#: fpdb.pyw:828 +msgid "_Quit" +msgstr "" + +#: fpdb.pyw:829 +msgid "_Load Profile (broken)" +msgstr "" + +#: fpdb.pyw:830 +msgid "_Save Profile (todo)" +msgstr "" + +#: fpdb.pyw:831 +msgid "Pre_ferences" +msgstr "_Einstellungen" +