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
This commit is contained in:
steffen123 2010-08-13 02:49:01 +02:00
parent ac3387c85e
commit 92435dd714
7 changed files with 182 additions and 9 deletions

View File

@ -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

1
pyfpdb/create-mo-files.sh Executable file
View File

@ -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

2
pyfpdb/create-po-file.sh Executable file
View File

@ -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*

View File

@ -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)', '<control>L', 'Load your profile', self.dia_load_profile),
('SaveProf', None, '_Save Profile (todo)', '<control>S', 'Save your profile', self.dia_save_profile),
('Preferences', None, 'Pre_ferences', '<control>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)'), '<control>L', 'Load your profile', self.dia_load_profile),
('SaveProf', None, _('_Save Profile (todo)'), '<control>S', 'Save your profile', self.dia_save_profile),
('Preferences', None, _('Pre_ferences'), '<control>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', '<control>B', 'Bulk Import', self.tab_bulk_import),

Binary file not shown.

View File

@ -0,0 +1,85 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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"

View File

@ -0,0 +1,85 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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"