From 92435dd7146f43736656cf722b58b97ac3617595 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 02:49:01 +0200 Subject: [PATCH 01/20] 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" + From 05500cf4bd688c175f810589f2d997449dbc078f Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 03:28:27 +0200 Subject: [PATCH 02/20] more _() markings for l10n --- pyfpdb/HandHistoryConverter.py | 2 +- pyfpdb/fpdb.pyw | 136 ++++++++++++++++----------------- 2 files changed, 69 insertions(+), 69 deletions(-) diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index c6d26fc7..db02c0aa 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", "locale", languages="de_DE") +#trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"]) #trans.install() import pygtk diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index 700633fd..5c5230e7 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -21,7 +21,7 @@ import re import Queue import gettext -trans = gettext.translation("fpdb", "locale", ["de_DE"]) +trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"]) trans.install() # if path is set to use an old version of python look for a new one: @@ -37,7 +37,7 @@ if os.name == 'nt' and sys.version[0:3] not in ('2.5', '2.6') and '-r' not in sy #print "new path =", tmppath if re.search('python', tmppath, re.I): os.environ['PATH'] = tmppath - print "Python " + sys.version[0:3] + ' - press return to continue\n' + print "Python " + sys.version[0:3] + _(' - press return to continue\n') sys.stdin.readline() if os.name=='nt': os.execvpe('pythonw.exe', ('pythonw.exe', 'fpdb.pyw', '-r'), os.environ) # first arg is ignored (name of program being run) @@ -829,29 +829,29 @@ class fpdb: ('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), - ('imapimport', None, '_Import through eMail/IMAP', 'I', 'Import through eMail/IMAP', self.tab_imap_import), - ('viewers', None, '_Viewers'), - ('autoimp', None, '_Auto Import and HUD', 'A', 'Auto Import and HUD', self.tab_auto_import), - ('hudConfigurator', None, '_HUD Configurator', 'H', 'HUD Configurator', self.diaHudConfigurator), - ('graphs', None, '_Graphs', 'G', 'Graphs', self.tabGraphViewer), - ('ringplayerstats', None, 'Ring _Player Stats (tabulated view)', 'P', 'Ring Player Stats (tabulated view)', self.tab_ring_player_stats), - ('tourneyplayerstats', None, '_Tourney Player Stats (tabulated view)', 'T', 'Tourney Player Stats (tabulated view, mysql only)', self.tab_tourney_player_stats), - ('tourneyviewer', None, 'Tourney _Viewer', None, 'Tourney Viewer)', self.tab_tourney_viewer_stats), - ('posnstats', None, 'P_ositional Stats (tabulated view, not on sqlite)', 'O', 'Positional Stats (tabulated view)', self.tab_positional_stats), - ('sessionstats', None, 'Session Stats', None, 'Session Stats', self.tab_session_stats), - ('database', None, '_Database'), - ('maintaindbs', None, '_Maintain Databases', None, 'Maintain Databases', self.dia_maintain_dbs), - ('createtabs', None, 'Create or Recreate _Tables', None, 'Create or Recreate Tables ', self.dia_recreate_tables), - ('rebuildhudcache', None, 'Rebuild HUD Cache', None, 'Rebuild HUD Cache', self.dia_recreate_hudcache), - ('rebuildindexes', None, 'Rebuild DB Indexes', None, 'Rebuild DB Indexes', self.dia_rebuild_indexes), - ('databasestats', None, '_Statistics', None, 'View Database Statistics', self.dia_database_stats), - ('dumptofile', None, 'Dump Database to Textfile (takes ALOT of time)', None, 'Dump Database to Textfile (takes ALOT of time)', self.dia_dump_db), - ('help', None, '_Help'), - ('Logs', None, '_Log Messages', None, 'Log and Debug Messages', self.dia_logs), - ('About', None, 'A_bout, License, Copying', None, 'About the program', self.dia_about), + ('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), + ('imapimport', None, _('_Import through eMail/IMAP'), 'I', 'Import through eMail/IMAP', self.tab_imap_import), + ('viewers', None, _('_Viewers')), + ('autoimp', None, _('_Auto Import and HUD'), 'A', 'Auto Import and HUD', self.tab_auto_import), + ('hudConfigurator', None, _('_HUD Configurator'), 'H', 'HUD Configurator', self.diaHudConfigurator), + ('graphs', None, _('_Graphs'), 'G', 'Graphs', self.tabGraphViewer), + ('ringplayerstats', None, _('Ring _Player Stats (tabulated view)'), 'P', 'Ring Player Stats (tabulated view)', self.tab_ring_player_stats), + ('tourneyplayerstats', None, _('_Tourney Player Stats (tabulated view)'), 'T', 'Tourney Player Stats (tabulated view, mysql only)', self.tab_tourney_player_stats), + ('tourneyviewer', None, _('Tourney _Viewer'), None, 'Tourney Viewer)', self.tab_tourney_viewer_stats), + ('posnstats', None, _('P_ositional Stats (tabulated view, not on sqlite)'), 'O', 'Positional Stats (tabulated view)', self.tab_positional_stats), + ('sessionstats', None, _('Session Stats'), None, 'Session Stats', self.tab_session_stats), + ('database', None, _('_Database')), + ('maintaindbs', None, _('_Maintain Databases'), None, 'Maintain Databases', self.dia_maintain_dbs), + ('createtabs', None, _('Create or Recreate _Tables'), None, 'Create or Recreate Tables ', self.dia_recreate_tables), + ('rebuildhudcache', None, _('Rebuild HUD Cache'), None, 'Rebuild HUD Cache', self.dia_recreate_hudcache), + ('rebuildindexes', None, _('Rebuild DB Indexes'), None, 'Rebuild DB Indexes', self.dia_rebuild_indexes), + ('databasestats', None, _('_Statistics'), None, 'View Database Statistics', self.dia_database_stats), + ('dumptofile', None, _('Dump Database to Textfile (takes ALOT of time)'), None, 'Dump Database to Textfile (takes ALOT of time)', self.dia_dump_db), + ('help', None, _('_Help')), + ('Logs', None, _('_Log Messages'), None, 'Log and Debug Messages', self.dia_logs), + ('About', None, _('A_bout, License, Copying'), None, 'About the program', self.dia_about), ]) actiongroup.get_action('Quit').set_property('short-label', '_Quit') @@ -869,18 +869,18 @@ class fpdb: """Loads profile from the provided path name.""" self.config = Configuration.Config(file=options.config, dbname=options.dbname) if self.config.file_error: - self.warning_box( "There is an error in your config file\n" + self.config.file - + "\n\nError is: " + str(self.config.file_error) - , diatitle="CONFIG FILE ERROR" ) + self.warning_box(_("There is an error in your config file\n") + self.config.file + + _("\n\nError is: ") + str(self.config.file_error) + , diatitle=_("CONFIG FILE ERROR")) sys.exit() log = Configuration.get_logger("logging.conf", "fpdb", log_dir=self.config.dir_log) - print "Logfile is " + os.path.join(self.config.dir_log, self.config.log_file) + "\n" + print _("Logfile is ") + os.path.join(self.config.dir_log, self.config.log_file) + "\n" if self.config.example_copy: - self.info_box( "Config file" - , "has been created at:\n%s.\n" % self.config.file - + "Edit your screen_name and hand history path in the supported_sites " - + "section of the Preferences window (Main menu) before trying to import hands.") + self.info_box(_("Config file") + , _("has been created at:\n%s.\n") % self.config.file + + _("Edit your screen_name and hand history path in the supported_sites ") + + _("section of the Preferences window (Main menu) before trying to import hands.")) self.settings = {} self.settings['global_lock'] = self.lock if (os.sep=="/"): @@ -903,17 +903,17 @@ class fpdb: self.db = Database.Database(self.config, sql = self.sql) if self.db.get_backend_name() == 'SQLite': # tell sqlite users where the db file is - print "Connected to SQLite: %(database)s" % {'database':self.db.db_path} + print _("Connected to SQLite: %(database)s") % {'database':self.db.db_path} except Exceptions.FpdbMySQLAccessDenied: - err_msg = "MySQL Server reports: Access denied. Are your permissions set correctly?" + err_msg = _("MySQL Server reports: Access denied. Are your permissions set correctly?") except Exceptions.FpdbMySQLNoDatabase: - err_msg = "MySQL client reports: 2002 or 2003 error. Unable to connect - " \ - + "Please check that the MySQL service has been started" + err_msg = _("MySQL client reports: 2002 or 2003 error. Unable to connect - ") \ + + _("Please check that the MySQL service has been started") except Exceptions.FpdbPostgresqlAccessDenied: - err_msg = "Postgres Server reports: Access denied. Are your permissions set correctly?" + err_msg = _("Postgres Server reports: Access denied. Are your permissions set correctly?") except Exceptions.FpdbPostgresqlNoDatabase: - err_msg = "Postgres client reports: Unable to connect - " \ - + "Please check that the Postgres service has been started" + err_msg = _("Postgres client reports: Unable to connect - ") \ + + _("Please check that the Postgres service has been started") if err_msg is not None: self.db = None self.warning_box(err_msg) @@ -937,17 +937,17 @@ class fpdb: # sys.stderr.write("Failed to connect to %s database with username %s." % (self.settings['db-server'], self.settings['db-user'])) if self.db is not None and self.db.wrongDbVersion: - diaDbVersionWarning = gtk.Dialog(title="Strong Warning - Invalid database version", parent=None, flags=0, buttons=(gtk.STOCK_OK,gtk.RESPONSE_OK)) + diaDbVersionWarning = gtk.Dialog(title=_("Strong Warning - Invalid database version"), parent=None, flags=0, buttons=(gtk.STOCK_OK,gtk.RESPONSE_OK)) - label = gtk.Label("An invalid DB version or missing tables have been detected.") + label = gtk.Label(_("An invalid DB version or missing tables have been detected.")) diaDbVersionWarning.vbox.add(label) label.show() - label = gtk.Label("This error is not necessarily fatal but it is strongly recommended that you recreate the tables by using the Database menu.") + label = gtk.Label(_("This error is not necessarily fatal but it is strongly recommended that you recreate the tables by using the Database menu.")) diaDbVersionWarning.vbox.add(label) label.show() - label = gtk.Label("Not doing this will likely lead to misbehaviour including fpdb crashes, corrupt data etc.") + label = gtk.Label(_("Not doing this will likely lead to misbehaviour including fpdb crashes, corrupt data etc.")) diaDbVersionWarning.vbox.add(label) label.show() @@ -960,7 +960,7 @@ class fpdb: self.status_bar.show() if self.db is not None and self.db.is_connected(): - self.status_bar.set_text("Status: Connected to %s database named %s on host %s" + self.status_bar.set_text(_("Status: Connected to %s database named %s on host %s") % (self.db.get_backend_name(),self.db.database, self.db.host)) # rollback to make sure any locks are cleared: self.db.rollback() @@ -973,10 +973,10 @@ class fpdb: def obtain_global_lock(self, source): ret = self.lock.acquire(source=source) # will return false if lock is already held if ret: - print "\nGlobal lock taken by", source + print _("\nGlobal lock taken by"), source self.lockTakenBy=source else: - print "\nFailed to get global lock, it is currently held by", source + print _("\nFailed to get global lock, it is currently held by"), source return ret # need to release it later: # self.lock.release() @@ -986,7 +986,7 @@ class fpdb: #FIXME get two "quitting normally" messages, following the addition of the self.window.destroy() call # ... because self.window.destroy() leads to self.destroy() which calls this! if not self.quitting: - print "Quitting normally" + print _("Quitting normally") self.quitting = True # TODO: check if current settings differ from profile, if so offer to save or abort @@ -1010,62 +1010,62 @@ class fpdb: def release_global_lock(self): self.lock.release() self.lockTakenBy=None - print "Global lock released.\n" + print _("Global lock released.\n") def tab_auto_import(self, widget, data=None): """opens the auto import tab""" new_aimp_thread = GuiAutoImport.GuiAutoImport(self.settings, self.config, self.sql, self.window) self.threads.append(new_aimp_thread) aimp_tab=new_aimp_thread.get_vbox() - self.add_and_display_tab(aimp_tab, "Auto Import") + self.add_and_display_tab(aimp_tab, _("Auto Import")) def tab_bulk_import(self, widget, data=None): """opens a tab for bulk importing""" new_import_thread = GuiBulkImport.GuiBulkImport(self.settings, self.config, self.sql) self.threads.append(new_import_thread) bulk_tab=new_import_thread.get_vbox() - self.add_and_display_tab(bulk_tab, "Bulk Import") + self.add_and_display_tab(bulk_tab, _("Bulk Import")) def tab_imap_import(self, widget, data=None): new_thread = GuiImapFetcher.GuiImapFetcher(self.config, self.db, self.sql, self.window) self.threads.append(new_thread) tab=new_thread.get_vbox() - self.add_and_display_tab(tab, "IMAP Import") + self.add_and_display_tab(tab, _("eMail Import")) #end def tab_import_imap_summaries def tab_ring_player_stats(self, widget, data=None): new_ps_thread = GuiRingPlayerStats.GuiRingPlayerStats(self.config, self.sql, self.window) self.threads.append(new_ps_thread) ps_tab=new_ps_thread.get_vbox() - self.add_and_display_tab(ps_tab, "Ring Player Stats") + self.add_and_display_tab(ps_tab, _("Ring Player Stats")) def tab_tourney_player_stats(self, widget, data=None): new_ps_thread = GuiTourneyPlayerStats.GuiTourneyPlayerStats(self.config, self.db, self.sql, self.window) self.threads.append(new_ps_thread) ps_tab=new_ps_thread.get_vbox() - self.add_and_display_tab(ps_tab, "Tourney Player Stats") + self.add_and_display_tab(ps_tab, _("Tourney Player Stats")) def tab_tourney_viewer_stats(self, widget, data=None): new_thread = GuiTourneyViewer.GuiTourneyViewer(self.config, self.db, self.sql, self.window) self.threads.append(new_thread) tab=new_thread.get_vbox() - self.add_and_display_tab(tab, "Tourney Viewer") + self.add_and_display_tab(tab, _("Tourney Viewer")) def tab_positional_stats(self, widget, data=None): new_ps_thread = GuiPositionalStats.GuiPositionalStats(self.config, self.sql) self.threads.append(new_ps_thread) ps_tab=new_ps_thread.get_vbox() - self.add_and_display_tab(ps_tab, "Positional Stats") + self.add_and_display_tab(ps_tab, _("Positional Stats")) def tab_session_stats(self, widget, data=None): new_ps_thread = GuiSessionViewer.GuiSessionViewer(self.config, self.sql, self.window) self.threads.append(new_ps_thread) ps_tab=new_ps_thread.get_vbox() - self.add_and_display_tab(ps_tab, "Session Stats") + self.add_and_display_tab(ps_tab, _("Session Stats")) def tab_main_help(self, widget, data=None): """Displays a tab with the main fpdb help screen""" - mh_tab=gtk.Label("""Welcome to Fpdb! + mh_tab=gtk.Label(_("""Welcome to Fpdb! To be notified of new snapshots and releases go to https://lists.sourceforge.net/lists/listinfo/fpdb-announce and subscribe. If you want to follow development more closely go to https://lists.sourceforge.net/lists/listinfo/fpdb-main and subscribe. @@ -1078,15 +1078,15 @@ Please note that default.conf is no longer needed nor used, all configuration no This program is free/libre open source software licensed partially under the AGPL3, and partially under GPL2 or later. The Windows installer package includes code licensed under the MIT license. -You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt and mit.txt in the fpdb installation directory.""") - self.add_and_display_tab(mh_tab, "Help") +You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt and mit.txt in the fpdb installation directory.""")) + self.add_and_display_tab(mh_tab, _("Help")) def tabGraphViewer(self, widget, data=None): """opens a graph viewer tab""" new_gv_thread = GuiGraphViewer.GuiGraphViewer(self.sql, self.config, self.window) self.threads.append(new_gv_thread) gv_tab = new_gv_thread.get_vbox() - self.add_and_display_tab(gv_tab, "Graphs") + self.add_and_display_tab(gv_tab, _("Graphs")) def __init__(self): # no more than 1 process can this lock at a time: @@ -1136,8 +1136,8 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt an if not options.errorsToConsole: fileName = os.path.join(self.config.dir_log, 'fpdb-errors.txt') - print "\nNote: error output is being diverted to fpdb-errors.txt and HUD-errors.txt in:\n" \ - + self.config.dir_log + "\nAny major error will be reported there _only_.\n" + print _("\nNote: error output is being diverted to fpdb-errors.txt and HUD-errors.txt in:\n") \ + + self.config.dir_log + _("\nAny major error will be reported there _only_.\n") errorFile = open(fileName, 'w', 0) sys.stderr = errorFile @@ -1165,7 +1165,7 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt an self.statusIcon.set_visible(True) self.window.connect('window-state-event', self.window_state_event_cb) - sys.stderr.write("fpdb starting ...") + sys.stderr.write(_("fpdb starting ...")) def window_state_event_cb(self, window, event): if event.changed_mask & gtk.gdk.WINDOW_STATE_ICONIFIED: @@ -1214,7 +1214,7 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt an diapath.destroy() return response - def warning_box(self, str, diatitle="FPDB WARNING"): + def warning_box(self, str, diatitle=_("FPDB WARNING")): diaWarning = gtk.Dialog(title=diatitle, parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, buttons=(gtk.STOCK_OK,gtk.RESPONSE_OK)) label = gtk.Label(str) @@ -1233,7 +1233,7 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt an hhdir = hhbase if not os.path.isdir(hhdir): diapath = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_WARNING, buttons=(gtk.BUTTONS_YES_NO), message_format="Setup hh dir") - diastring = "WARNING: Unable to find output hh directory %s\n\n Press YES to create this directory, or NO to select a new one." % hhdir + diastring = _("WARNING: Unable to find output hh directory %s\n\n Press YES to create this directory, or NO to select a new one.") % hhdir diapath.format_secondary_text(diastring) response = diapath.run() diapath.destroy() @@ -1241,12 +1241,12 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt an try: os.makedirs(hhdir) except: - self.warning_box("WARNING: Unable to create hand output directory. Importing is not likely to work until this is fixed.") + self.warning_box(_("WARNING: Unable to create hand output directory. Importing is not likely to work until this is fixed.")) elif response == gtk.RESPONSE_NO: self.select_hhArchiveBase() def select_hhArchiveBase(self, widget=None): - fc = gtk.FileChooserDialog(title="Select HH Output Directory", parent=None, action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, buttons=(gtk.STOCK_OPEN,gtk.RESPONSE_OK), backend=None) + fc = gtk.FileChooserDialog(title=_("Select HH Output Directory"), parent=None, action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, buttons=(gtk.STOCK_OPEN,gtk.RESPONSE_OK), backend=None) fc.run() # TODO: We need to put in a Cancel button, and handle if the user presses that or the "Close" box without selecting anything as a cancel, and return to the prior setting #self.warning_box("You selected %s" % fc.get_filename()) From 9c60a7f8b9378a5e2a9cb6f13b141cbcd767d7e6 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 03:39:50 +0200 Subject: [PATCH 03/20] remove now useless method not_implemented --- pyfpdb/fpdb.pyw | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index 5c5230e7..9145d4c7 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -967,9 +967,6 @@ class fpdb: self.validate_config() - def not_implemented(self, widget, data=None): - self.warning_box("Unimplemented menu entry") - def obtain_global_lock(self, source): ret = self.lock.acquire(source=source) # will return false if lock is already held if ret: From d1942218d6aafa7a0af944e792efb9d6930988c5 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 03:47:00 +0200 Subject: [PATCH 04/20] more _() for fpdb.pyw --- pyfpdb/fpdb.pyw | 66 ++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index 9145d4c7..c4db7a84 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -44,8 +44,8 @@ if os.name == 'nt' and sys.version[0:3] not in ('2.5', '2.6') and '-r' not in sy else: os.execvpe('python', ('python', 'fpdb.pyw', '-r'), os.environ) # first arg is ignored (name of program being run) else: - print "\npython 2.5 not found, please install python 2.5 or 2.6 for fpdb\n" - raw_input("Press ENTER to continue.") + print _("\npython 2.5 not found, please install python 2.5 or 2.6 for fpdb\n") + raw_input(_("Press ENTER to continue.")) exit() else: pass @@ -56,8 +56,8 @@ if os.name == 'nt': import win32api import win32con except ImportError: - print "We appear to be running in Windows, but the Windows Python Extensions are not loading. Please install the PYWIN32 package from http://sourceforge.net/projects/pywin32/" - raw_input("Press ENTER to continue.") + print _("We appear to be running in Windows, but the Windows Python Extensions are not loading. Please install the PYWIN32 package from http://sourceforge.net/projects/pywin32/") + raw_input(_("Press ENTER to continue.")) exit() print "Python " + sys.version[0:3] + '...' @@ -78,8 +78,8 @@ try: import gtk import pango except: - print "Unable to load PYGTK modules required for GUI. Please install PyCairo, PyGObject, and PyGTK from www.pygtk.org." - raw_input("Press ENTER to continue.") + print _("Unable to load PYGTK modules required for GUI. Please install PyCairo, PyGObject, and PyGTK from www.pygtk.org.") + raw_input(_("Press ENTER to continue.")) exit() import interlocks @@ -121,7 +121,7 @@ import Configuration import Exceptions import Stats -VERSION = "0.20.903 plus git" +VERSION = "0.20.904 plus git" class fpdb: @@ -236,19 +236,19 @@ class fpdb: dia = gtk.AboutDialog() dia.set_name("Free Poker Database (FPDB)") dia.set_version(VERSION) - dia.set_copyright("Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, sqlcoder, Bostik, and others") - dia.set_comments("You are free to change and distribute original or changed versions of fpdb within the rules set out by the license") - dia.set_license("Please see fpdb's start screen for license information") + dia.set_copyright(_("Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, sqlcoder, Bostik, and others")) + dia.set_comments(_("You are free to change, and distribute original or changed versions of fpdb within the rules set out by the license")) + dia.set_license(_("Please see fpdb's start screen for license information")) dia.set_website("http://fpdb.sourceforge.net/") dia.set_authors(['Steffen', 'Eratosthenes', 'Carl Gherardi', - 'Eric Blade', '_mt', 'sqlcoder', 'Bostik', 'and others']) + 'Eric Blade', '_mt', 'sqlcoder', 'Bostik', _('and others'])) dia.set_program_name("Free Poker Database (FPDB)") db_version = "" #if self.db is not None: # db_version = self.db.get_version() - nums = [ ('Operating System', os.name) + nums = [ (_('Operating System'), os.name) , ('Python', sys.version[0:3]) , ('GTK+', '.'.join([str(x) for x in gtk.gtk_version])) , ('PyGTK', '.'.join([str(x) for x in gtk.pygtk_version])) @@ -268,24 +268,24 @@ class fpdb: view.show() dia.vbox.pack_end(view, True, True, 2) - l = gtk.Label("Your config file is: "+self.config.file) + l = gtk.Label(_("Your config file is: ")+self.config.file) l.set_alignment(0.5, 0.5) l.show() dia.vbox.pack_end(l, True, True, 2) - l = gtk.Label('Version Information:') + l = gtk.Label(_('Version Information:')) l.set_alignment(0.5, 0.5) l.show() dia.vbox.pack_end(l, True, True, 2) dia.run() dia.destroy() - log.debug("Threads: ") + log.debug(_("Threads: ")) for t in self.threads: log.debug("........." + str(t.__class__)) def dia_preferences(self, widget, data=None): - dia = gtk.Dialog("Preferences", + dia = gtk.Dialog(_("Preferences"), self.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, @@ -303,8 +303,7 @@ class fpdb: dia.destroy() else: dia.destroy() # destroy prefs before raising warning, otherwise parent is dia rather than self.window - self.warning_box("Updated preferences have not been loaded because " - + "windows are open. Re-start fpdb to load them.") + self.warning_box(_("Updated preferences have not been loaded because windows are open. Re-start fpdb to load them.")) else: dia.destroy() @@ -314,7 +313,7 @@ class fpdb: if len(self.tab_names) == 1: if self.obtain_global_lock("dia_maintain_dbs"): # returns true if successful # only main tab has been opened, open dialog - dia = gtk.Dialog("Maintain Databases", + dia = gtk.Dialog(_("Maintain Databases"), self.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, @@ -324,27 +323,26 @@ class fpdb: prefs = GuiDatabase.GuiDatabase(self.config, self.window, dia) response = dia.run() if response == gtk.RESPONSE_ACCEPT: - log.info('saving updated db data') + log.info(_('saving updated db data')) # save updated config self.config.save() self.load_profile() for name in self.config.supported_databases: #db_ip/db_user/db_pass/db_server log.info('fpdb: name,desc='+name+','+self.config.supported_databases[name].db_desc) else: - log.info('guidb response was '+str(response)) + log.info(_('guidb response was ')+str(response)) self.release_global_lock() dia.destroy() else: - self.warning_box("Cannot open Database Maintenance window because " - + "other windows have been opened. Re-start fpdb to use this option.") + self.warning_box(_("Cannot open Database Maintenance window because other windows have been opened. Re-start fpdb to use this option.")) def dia_database_stats(self, widget, data=None): - self.warning_box(str="Number of Hands: "+str(self.db.getHandCount())+ - "\nNumber of Tourneys: "+str(self.db.getTourneyCount())+ - "\nNumber of TourneyTypes: "+str(self.db.getTourneyTypeCount()), - diatitle="Database Statistics") + self.warning_box(str=_("Number of Hands: ")+str(self.db.getHandCount())+ + _("\nNumber of Tourneys: ")+str(self.db.getTourneyCount())+ + _("\nNumber of TourneyTypes: ")+str(self.db.getTourneyTypeCount()), + diatitle=_("Database Statistics")) #end def dia_database_stats def diaHudConfigurator(self, widget, data=None): @@ -353,13 +351,13 @@ class fpdb: self.hudConfiguratorColumns=None self.hudConfiguratorGame=None - diaSelections = gtk.Dialog("HUD Configurator - choose category", + diaSelections = gtk.Dialog(_("HUD Configurator - choose category"), self.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) - label=gtk.Label("Please select the game category for which you want to configure HUD stats:") + label=gtk.Label(_("Please select the game category for which you want to configure HUD stats:")) diaSelections.vbox.add(label) label.show() @@ -411,25 +409,25 @@ class fpdb: """shows dialogue with Table of ComboBoxes to allow choosing of HUD stats""" #TODO: add notices to hud configurator: no duplicates, no empties, display options #TODO: show explanation of what each stat means - diaHudTable = gtk.Dialog("HUD Configurator - please choose your stats", + diaHudTable = gtk.Dialog(_("HUD Configurator - please choose your stats"), self.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_SAVE, gtk.RESPONSE_ACCEPT, gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)) - label=gtk.Label("Please choose the stats you wish to use in the below table.") + label=gtk.Label(_("Please choose the stats you wish to use in the below table.")) diaHudTable.vbox.add(label) label.show() - label=gtk.Label("Note that you may not select any stat more than once or it will crash.") + label=gtk.Label(_("Note that you may not select any stat more than once or it will crash.")) diaHudTable.vbox.add(label) label.show() - label=gtk.Label("It is not currently possible to select \"empty\" or anything else to that end.") + label=gtk.Label(_("It is not currently possible to select \"empty\" or anything else to that end.")) diaHudTable.vbox.add(label) label.show() - label=gtk.Label("To configure things like colouring you will still have to manually edit your HUD_config.xml.") + label=gtk.Label(_("To configure things like colouring you will still have to manually edit your HUD_config.xml.")) diaHudTable.vbox.add(label) label.show() From bfac6f9985809085b905c3028c0ce46a7c9115fb Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 03:47:48 +0200 Subject: [PATCH 05/20] remove unimplemented and unneeded dia_licensing --- pyfpdb/fpdb.pyw | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index c4db7a84..dc00489c 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -505,9 +505,6 @@ class fpdb: dumpFile.close() #end def dia_database_stats - def dia_licensing(self, widget, data=None): - self.warning_box("Unimplemented: Licensing") - def dia_load_profile(self, widget, data=None): """Dialogue to select a file to load a profile from""" if self.obtain_global_lock("fpdb.dia_load_profile"): # returns true if successful From 8b0d1d28bc578f87ed7ab7ea90ae4b4d0e127c7c Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 03:51:03 +0200 Subject: [PATCH 06/20] more _() in fpdb.pyw --- pyfpdb/fpdb.pyw | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index dc00489c..d6501569 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -534,9 +534,9 @@ class fpdb: #lock_released = False dia_confirm = gtk.MessageDialog(parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, type=gtk.MESSAGE_WARNING, - buttons=(gtk.BUTTONS_YES_NO), message_format="Confirm deleting and recreating tables") - diastring = "Please confirm that you want to (re-)create the tables. If there already are tables in the database " \ - +self.db.database+" on "+self.db.host+" they will be deleted.\nThis may take a while." + buttons=(gtk.BUTTONS_YES_NO), message_format=_("Confirm deleting and recreating tables")) + diastring = _("Please confirm that you want to (re-)create the tables. If there already are tables in the database ") \ + +self.db.database+" on "+self.db.host+_(" they will be deleted.\nThis may take a while.") dia_confirm.format_secondary_text(diastring)#todo: make above string with bold for db, host and deleted # disable windowclose, do not want the the underlying processing interrupted mid-process dia_confirm.set_deletable(False) @@ -561,14 +561,14 @@ class fpdb: # self.fdb_lock.fdb.recreate_tables() elif response == gtk.RESPONSE_NO: self.release_global_lock() - print 'User cancelled recreating tables' + print _('User cancelled recreating tables') #if not lock_released: #end def dia_recreate_tables def dia_recreate_hudcache(self, widget, data=None): if self.obtain_global_lock("dia_recreate_hudcache"): self.dia_confirm = gtk.MessageDialog(parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, type=gtk.MESSAGE_WARNING, buttons=(gtk.BUTTONS_YES_NO), message_format="Confirm recreating HUD cache") - diastring = "Please confirm that you want to re-create the HUD cache." + diastring = _("Please confirm that you want to re-create the HUD cache.") self.dia_confirm.format_secondary_text(diastring) # disable windowclose, do not want the the underlying processing interrupted mid-process self.dia_confirm.set_deletable(False) @@ -576,7 +576,7 @@ class fpdb: hb1 = gtk.HBox(True, 1) self.h_start_date = gtk.Entry(max=12) self.h_start_date.set_text( self.db.get_hero_hudcache_start() ) - lbl = gtk.Label(" Hero's cache starts: ") + lbl = gtk.Label(_(" Hero's cache starts: ")) btn = gtk.Button() btn.set_image(gtk.image_new_from_stock(gtk.STOCK_INDEX, gtk.ICON_SIZE_BUTTON)) btn.connect('clicked', self.__calendar_dialog, self.h_start_date) @@ -590,7 +590,7 @@ class fpdb: hb2 = gtk.HBox(True, 1) self.start_date = gtk.Entry(max=12) self.start_date.set_text( self.db.get_hero_hudcache_start() ) - lbl = gtk.Label(" Villains' cache starts: ") + lbl = gtk.Label(_(" Villains' cache starts: ")) btn = gtk.Button() btn.set_image(gtk.image_new_from_stock(gtk.STOCK_INDEX, gtk.ICON_SIZE_BUTTON)) btn.connect('clicked', self.__calendar_dialog, self.start_date) @@ -603,7 +603,7 @@ class fpdb: response = self.dia_confirm.run() if response == gtk.RESPONSE_YES: - lbl = gtk.Label(" Rebuilding HUD Cache ... ") + lbl = gtk.Label(_(" Rebuilding HUD Cache ... ")) self.dia_confirm.vbox.add(lbl) lbl.show() while gtk.events_pending(): @@ -611,7 +611,7 @@ class fpdb: self.db.rebuild_hudcache( self.h_start_date.get_text(), self.start_date.get_text() ) elif response == gtk.RESPONSE_NO: - print 'User cancelled rebuilding hud cache' + print _('User cancelled rebuilding hud cache') self.dia_confirm.destroy() @@ -623,8 +623,8 @@ class fpdb: ,flags=gtk.DIALOG_DESTROY_WITH_PARENT ,type=gtk.MESSAGE_WARNING ,buttons=(gtk.BUTTONS_YES_NO) - ,message_format="Confirm rebuilding database indexes") - diastring = "Please confirm that you want to rebuild the database indexes." + ,message_format=_("Confirm rebuilding database indexes")) + diastring = _("Please confirm that you want to rebuild the database indexes.") self.dia_confirm.format_secondary_text(diastring) # disable windowclose, do not want the the underlying processing interrupted mid-process self.dia_confirm.set_deletable(False) @@ -632,24 +632,24 @@ class fpdb: response = self.dia_confirm.run() if response == gtk.RESPONSE_YES: #FIXME these progress messages do not seem to work in *nix - lbl = gtk.Label(" Rebuilding Indexes ... ") + lbl = gtk.Label(_(" Rebuilding Indexes ... ")) self.dia_confirm.vbox.add(lbl) lbl.show() while gtk.events_pending(): gtk.main_iteration_do(False) self.db.rebuild_indexes() - lbl.set_text(" Cleaning Database ... ") + lbl.set_text(_(" Cleaning Database ... ")) while gtk.events_pending(): gtk.main_iteration_do(False) self.db.vacuumDB() - lbl.set_text(" Analyzing Database ... ") + lbl.set_text(_(" Analyzing Database ... ")) while gtk.events_pending(): gtk.main_iteration_do(False) self.db.analyzeDB() elif response == gtk.RESPONSE_NO: - print 'User cancelled rebuilding db indexes' + print _('User cancelled rebuilding db indexes') self.dia_confirm.destroy() @@ -710,13 +710,13 @@ class fpdb: d.set_destroy_with_parent(True) d.set_modal(True) - d.set_title('Pick a date') + d.set_title(_('Pick a date')) vb = gtk.VBox() cal = gtk.Calendar() vb.pack_start(cal, expand=False, padding=0) - btn = gtk.Button('Done') + btn = gtk.Button(_('Done')) btn.connect('clicked', self.__get_date, cal, entry, d) vb.pack_start(btn, expand=False, padding=4) From fe1c9aed70f8c8a2d8fb6c43ea872e335bb98768 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 03:51:51 +0200 Subject: [PATCH 07/20] remove another useless method from fpdb.pyw --- pyfpdb/fpdb.pyw | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index d6501569..bf597473 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -743,11 +743,6 @@ class fpdb: win.destroy() self.dia_confirm.set_modal(True) - def dia_regression_test(self, widget, data=None): - self.warning_box("Unimplemented: Regression Test") - #self.obtain_global_lock("dia_regression_test") - #self.release_global_lock() - def dia_save_profile(self, widget, data=None): self.warning_box("Unimplemented: Save Profile (try saving a HUD layout, that should do it)") From 69dba72040bbdc13c067be0a0e7065ae77349b74 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 04:09:28 +0200 Subject: [PATCH 08/20] final _() for fpdb.pyw --- pyfpdb/fpdb.pyw | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index bf597473..e66c6b70 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -242,7 +242,7 @@ class fpdb: dia.set_website("http://fpdb.sourceforge.net/") dia.set_authors(['Steffen', 'Eratosthenes', 'Carl Gherardi', - 'Eric Blade', '_mt', 'sqlcoder', 'Bostik', _('and others'])) + 'Eric Blade', '_mt', 'sqlcoder', 'Bostik', _('and others')]) dia.set_program_name("Free Poker Database (FPDB)") db_version = "" @@ -744,12 +744,12 @@ class fpdb: self.dia_confirm.set_modal(True) def dia_save_profile(self, widget, data=None): - self.warning_box("Unimplemented: Save Profile (try saving a HUD layout, that should do it)") + self.warning_box(_("Unimplemented: Save Profile (try saving a HUD layout, that should do it)")) def diaSetupWizard(self, path): - diaSetupWizard = gtk.Dialog(title="Fatal Error - Config File Missing", parent=None, flags=0, buttons=(gtk.STOCK_QUIT,gtk.RESPONSE_OK)) + diaSetupWizard = gtk.Dialog(title=_("Fatal Error - Config File Missing"), parent=None, flags=0, buttons=(gtk.STOCK_QUIT,gtk.RESPONSE_OK)) - label = gtk.Label("Please copy the config file from the docs folder to:") + label = gtk.Label(_("Please copy the config file from the docs folder to:")) diaSetupWizard.vbox.add(label) label.show() @@ -757,7 +757,7 @@ class fpdb: diaSetupWizard.vbox.add(label) label.show() - label = gtk.Label("and edit it according to the install documentation at http://fpdb.sourceforge.net") + label = gtk.Label(_("and edit it according to the install documentation at http://fpdb.sourceforge.net")) diaSetupWizard.vbox.add(label) label.show() @@ -816,21 +816,21 @@ class fpdb: # 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), + ('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), - ('imapimport', None, _('_Import through eMail/IMAP'), 'I', 'Import through eMail/IMAP', self.tab_imap_import), + ('bulkimp', None, _('_Bulk Import'), _('B'), 'Bulk Import', self.tab_bulk_import), + ('imapimport', None, _('_Import through eMail/IMAP'), _('I'), 'Import through eMail/IMAP', self.tab_imap_import), ('viewers', None, _('_Viewers')), - ('autoimp', None, _('_Auto Import and HUD'), 'A', 'Auto Import and HUD', self.tab_auto_import), - ('hudConfigurator', None, _('_HUD Configurator'), 'H', 'HUD Configurator', self.diaHudConfigurator), - ('graphs', None, _('_Graphs'), 'G', 'Graphs', self.tabGraphViewer), - ('ringplayerstats', None, _('Ring _Player Stats (tabulated view)'), 'P', 'Ring Player Stats (tabulated view)', self.tab_ring_player_stats), - ('tourneyplayerstats', None, _('_Tourney Player Stats (tabulated view)'), 'T', 'Tourney Player Stats (tabulated view, mysql only)', self.tab_tourney_player_stats), + ('autoimp', None, _('_Auto Import and HUD'), _('A'), 'Auto Import and HUD', self.tab_auto_import), + ('hudConfigurator', None, _('_HUD Configurator'), _('H'), 'HUD Configurator', self.diaHudConfigurator), + ('graphs', None, _('_Graphs'), _('G'), 'Graphs', self.tabGraphViewer), + ('ringplayerstats', None, _('Ring _Player Stats (tabulated view)'), _('P'), 'Ring Player Stats (tabulated view)', self.tab_ring_player_stats), + ('tourneyplayerstats', None, _('_Tourney Player Stats (tabulated view)'), _('T'), 'Tourney Player Stats (tabulated view, mysql only)', self.tab_tourney_player_stats), ('tourneyviewer', None, _('Tourney _Viewer'), None, 'Tourney Viewer)', self.tab_tourney_viewer_stats), - ('posnstats', None, _('P_ositional Stats (tabulated view, not on sqlite)'), 'O', 'Positional Stats (tabulated view)', self.tab_positional_stats), + ('posnstats', None, _('P_ositional Stats (tabulated view, not on sqlite)'), _('O'), 'Positional Stats (tabulated view)', self.tab_positional_stats), ('sessionstats', None, _('Session Stats'), None, 'Session Stats', self.tab_session_stats), ('database', None, _('_Database')), ('maintaindbs', None, _('_Maintain Databases'), None, 'Maintain Databases', self.dia_maintain_dbs), @@ -843,7 +843,7 @@ class fpdb: ('Logs', None, _('_Log Messages'), None, 'Log and Debug Messages', self.dia_logs), ('About', None, _('A_bout, License, Copying'), None, 'About the program', self.dia_about), ]) - actiongroup.get_action('Quit').set_property('short-label', '_Quit') + actiongroup.get_action('Quit').set_property('short-label', _('_Quit')) uimanager.insert_action_group(actiongroup, 0) merge_id = uimanager.add_ui_from_string(fpdbmenu) From 4aba116b9ad6b439a41b042ef9c4c3e85a412752 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 04:10:13 +0200 Subject: [PATCH 09/20] allow py27 on windows --- pyfpdb/fpdb.pyw | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index e66c6b70..1be08516 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -26,13 +26,13 @@ trans.install() # if path is set to use an old version of python look for a new one: # (does this work in linux?) -if os.name == 'nt' and sys.version[0:3] not in ('2.5', '2.6') and '-r' not in sys.argv: +if os.name == 'nt' and sys.version[0:3] not in ('2.5', '2.6', '2.7') and '-r' not in sys.argv: #print "old path =", os.environ['PATH'] dirs = re.split(os.pathsep, os.environ['PATH']) # remove any trailing / or \ chars from dirs: dirs = [re.sub('[\\/]$','',p) for p in dirs] # remove any dirs containing 'python' apart from those ending in 'python25', 'python26' or 'python': - dirs = [p for p in dirs if not re.search('python', p, re.I) or re.search('python25$', p, re.I) or re.search('python26$', p, re.I)] + dirs = [p for p in dirs if not re.search('python', p, re.I) or re.search('python25$', p, re.I) or re.search('python26$', p, re.I) or re.search('python27$', p, re.I)] tmppath = ";".join(dirs) #print "new path =", tmppath if re.search('python', tmppath, re.I): @@ -44,7 +44,7 @@ if os.name == 'nt' and sys.version[0:3] not in ('2.5', '2.6') and '-r' not in sy else: os.execvpe('python', ('python', 'fpdb.pyw', '-r'), os.environ) # first arg is ignored (name of program being run) else: - print _("\npython 2.5 not found, please install python 2.5 or 2.6 for fpdb\n") + print _("\npython 2.5 not found, please install python 2.5, 2.6 or 2.7 for fpdb\n") raw_input(_("Press ENTER to continue.")) exit() else: From 1b802d0d8ab44e32eefd487892c3eec69d7ab977 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 04:12:38 +0200 Subject: [PATCH 10/20] update .po and .mo files --- pyfpdb/locale/de_DE/LC_MESSAGES/fpdb.mo | Bin 528 -> 423 bytes pyfpdb/locale/fpdb-de_DE.po | 567 +++++++++++++++++++++++- pyfpdb/locale/fpdb-en_GB.po | 561 ++++++++++++++++++++++- 3 files changed, 1109 insertions(+), 19 deletions(-) diff --git a/pyfpdb/locale/de_DE/LC_MESSAGES/fpdb.mo b/pyfpdb/locale/de_DE/LC_MESSAGES/fpdb.mo index e609cdaeb81dc817430104423c4eb97baba792a9..646ce3997b7c3460bbe747c345026a010c787326 100644 GIT binary patch delta 117 zcmbQhvYa{mo)F7a1|VPtVi_Pd0dbIk50K3Q#J)hx3dBJ`?8wN#5CP@S0;*uY i!6P-NfFT}4PMqVyVq#@zF!9N6UXRS2v{axlm;wL+ixQ{+ delta 223 zcmZ3^Jb|VDo)F7a1|VPsVi_QI0dbH(4v@_Q#JNB$2E2yUj*JWpbAdD; z5Z?!~1%dQCAk7A(8JHLtIDiy8kY)%dN{vrTElSNxPAz7L_sLI8kyQvN%1_J8NmbBD zD$37J&C_Iv_f5>qV~7td%`BN1?!sbZWnwyU{%^y0*UY@)lGL1>(!BIkpgcsMLU2K9 ZW^zVq5m3Y>u_QHJu9H7^CI0sy(tFU|k} diff --git a/pyfpdb/locale/fpdb-de_DE.po b/pyfpdb/locale/fpdb-de_DE.po index 0ea895a7..de746712 100644 --- a/pyfpdb/locale/fpdb-de_DE.po +++ b/pyfpdb/locale/fpdb-de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2010-08-13 02:45+CEST\n" +"POT-Creation-Date: 2010-08-13 04:10+CEST\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -63,23 +63,568 @@ msgstr "" msgid "*** RIVER ***" msgstr "" -#: fpdb.pyw:827 +#: fpdb.pyw:40 +msgid "" +" - press return to continue\n" +msgstr "" + +#: fpdb.pyw:47 +msgid "" +"\n" +"python 2.5 not found, please install python 2.5, 2.6 or 2.7 for fpdb\n" +msgstr "" + +#: fpdb.pyw:48 fpdb.pyw:60 fpdb.pyw:82 +msgid "Press ENTER to continue." +msgstr "" + +#: fpdb.pyw:59 +msgid "We appear to be running in Windows, but the Windows Python Extensions are not loading. Please install the PYWIN32 package from http://sourceforge.net/projects/pywin32/" +msgstr "" + +#: fpdb.pyw:81 +msgid "Unable to load PYGTK modules required for GUI. Please install PyCairo, PyGObject, and PyGTK from www.pygtk.org." +msgstr "" + +#: fpdb.pyw:239 +msgid "Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, sqlcoder, Bostik, and others" +msgstr "" + +#: fpdb.pyw:240 +msgid "You are free to change, and distribute original or changed versions of fpdb within the rules set out by the license" +msgstr "" + +#: fpdb.pyw:241 +msgid "Please see fpdb's start screen for license information" +msgstr "" + +#: fpdb.pyw:245 +msgid "and others" +msgstr "" + +#: fpdb.pyw:251 +msgid "Operating System" +msgstr "" + +#: fpdb.pyw:271 +msgid "Your config file is: " +msgstr "" + +#: fpdb.pyw:276 +msgid "Version Information:" +msgstr "" + +#: fpdb.pyw:283 +msgid "Threads: " +msgstr "" + +#: fpdb.pyw:288 +msgid "Preferences" +msgstr "" + +#: fpdb.pyw:306 +msgid "Updated preferences have not been loaded because windows are open. Re-start fpdb to load them." +msgstr "" + +#: fpdb.pyw:316 +msgid "Maintain Databases" +msgstr "" + +#: fpdb.pyw:326 +msgid "saving updated db data" +msgstr "" + +#: fpdb.pyw:333 +msgid "guidb response was " +msgstr "" + +#: fpdb.pyw:339 +msgid "Cannot open Database Maintenance window because other windows have been opened. Re-start fpdb to use this option." +msgstr "" + +#: fpdb.pyw:342 +msgid "Number of Hands: " +msgstr "" + +#: fpdb.pyw:343 +msgid "" +"\n" +"Number of Tourneys: " +msgstr "" + +#: fpdb.pyw:344 +msgid "" +"\n" +"Number of TourneyTypes: " +msgstr "" + +#: fpdb.pyw:345 +msgid "Database Statistics" +msgstr "" + +#: fpdb.pyw:354 +msgid "HUD Configurator - choose category" +msgstr "" + +#: fpdb.pyw:360 +msgid "Please select the game category for which you want to configure HUD stats:" +msgstr "" + +#: fpdb.pyw:412 +msgid "HUD Configurator - please choose your stats" +msgstr "" + +#: fpdb.pyw:418 +msgid "Please choose the stats you wish to use in the below table." +msgstr "" + +#: fpdb.pyw:422 +msgid "Note that you may not select any stat more than once or it will crash." +msgstr "" + +#: fpdb.pyw:426 +msgid "It is not currently possible to select \"empty\" or anything else to that end." +msgstr "" + +#: fpdb.pyw:430 +msgid "To configure things like colouring you will still have to manually edit your HUD_config.xml." +msgstr "" + +#: fpdb.pyw:537 +msgid "Confirm deleting and recreating tables" +msgstr "" + +#: fpdb.pyw:538 +msgid "Please confirm that you want to (re-)create the tables. If there already are tables in the database " +msgstr "" + +#: fpdb.pyw:539 +msgid "" +" they will be deleted.\n" +"This may take a while." +msgstr "" + +#: fpdb.pyw:564 +msgid "User cancelled recreating tables" +msgstr "" + +#: fpdb.pyw:571 +msgid "Please confirm that you want to re-create the HUD cache." +msgstr "" + +#: fpdb.pyw:579 +msgid " Hero's cache starts: " +msgstr "" + +#: fpdb.pyw:593 +msgid " Villains' cache starts: " +msgstr "" + +#: fpdb.pyw:606 +msgid " Rebuilding HUD Cache ... " +msgstr "" + +#: fpdb.pyw:614 +msgid "User cancelled rebuilding hud cache" +msgstr "" + +#: fpdb.pyw:626 +msgid "Confirm rebuilding database indexes" +msgstr "" + +#: fpdb.pyw:627 +msgid "Please confirm that you want to rebuild the database indexes." +msgstr "" + +#: fpdb.pyw:635 +msgid " Rebuilding Indexes ... " +msgstr "" + +#: fpdb.pyw:642 +msgid " Cleaning Database ... " +msgstr "" + +#: fpdb.pyw:647 +msgid " Analyzing Database ... " +msgstr "" + +#: fpdb.pyw:652 +msgid "User cancelled rebuilding db indexes" +msgstr "" + +#: fpdb.pyw:713 +msgid "Pick a date" +msgstr "" + +#: fpdb.pyw:719 +msgid "Done" +msgstr "" + +#: fpdb.pyw:747 +msgid "Unimplemented: Save Profile (try saving a HUD layout, that should do it)" +msgstr "" + +#: fpdb.pyw:750 +msgid "Fatal Error - Config File Missing" +msgstr "" + +#: fpdb.pyw:752 +msgid "Please copy the config file from the docs folder to:" +msgstr "" + +#: fpdb.pyw:760 +msgid "and edit it according to the install documentation at http://fpdb.sourceforge.net" +msgstr "" + +#: fpdb.pyw:817 msgid "_Main" -msgstr "_Datei" +msgstr "" -#: fpdb.pyw:828 +#: fpdb.pyw:818 fpdb.pyw:846 msgid "_Quit" -msgstr "_Beenden" +msgstr "" -#: fpdb.pyw:829 +#: fpdb.pyw:819 +msgid "L" +msgstr "" + +#: fpdb.pyw:819 msgid "_Load Profile (broken)" -msgstr "_Profil Laden (kaputt)" +msgstr "" -#: fpdb.pyw:830 +#: fpdb.pyw:820 +msgid "S" +msgstr "" + +#: fpdb.pyw:820 msgid "_Save Profile (todo)" msgstr "" -#: fpdb.pyw:831 -msgid "Pre_ferences" -msgstr "_Einstellungen" +#: fpdb.pyw:821 +msgid "F" +msgstr "" + +#: fpdb.pyw:821 +msgid "Pre_ferences" +msgstr "" + +#: fpdb.pyw:822 +msgid "_Import" +msgstr "" + +#: fpdb.pyw:823 +msgid "_Set HandHistory Archive Directory" +msgstr "" + +#: fpdb.pyw:824 +msgid "B" +msgstr "" + +#: fpdb.pyw:824 +msgid "_Bulk Import" +msgstr "" + +#: fpdb.pyw:825 +msgid "I" +msgstr "" + +#: fpdb.pyw:825 +msgid "_Import through eMail/IMAP" +msgstr "" + +#: fpdb.pyw:826 +msgid "_Viewers" +msgstr "" + +#: fpdb.pyw:827 +msgid "A" +msgstr "" + +#: fpdb.pyw:827 +msgid "_Auto Import and HUD" +msgstr "" + +#: fpdb.pyw:828 +msgid "H" +msgstr "" + +#: fpdb.pyw:828 +msgid "_HUD Configurator" +msgstr "" + +#: fpdb.pyw:829 +msgid "G" +msgstr "" + +#: fpdb.pyw:829 +msgid "_Graphs" +msgstr "" + +#: fpdb.pyw:830 +msgid "P" +msgstr "" + +#: fpdb.pyw:830 +msgid "Ring _Player Stats (tabulated view)" +msgstr "" + +#: fpdb.pyw:831 +msgid "T" +msgstr "" + +#: fpdb.pyw:831 +msgid "_Tourney Player Stats (tabulated view)" +msgstr "" + +#: fpdb.pyw:832 +msgid "Tourney _Viewer" +msgstr "" + +#: fpdb.pyw:833 +msgid "O" +msgstr "" + +#: fpdb.pyw:833 +msgid "P_ositional Stats (tabulated view, not on sqlite)" +msgstr "" + +#: fpdb.pyw:834 fpdb.pyw:1051 +msgid "Session Stats" +msgstr "" + +#: fpdb.pyw:835 +msgid "_Database" +msgstr "" + +#: fpdb.pyw:836 +msgid "_Maintain Databases" +msgstr "" + +#: fpdb.pyw:837 +msgid "Create or Recreate _Tables" +msgstr "" + +#: fpdb.pyw:838 +msgid "Rebuild HUD Cache" +msgstr "" + +#: fpdb.pyw:839 +msgid "Rebuild DB Indexes" +msgstr "" + +#: fpdb.pyw:840 +msgid "_Statistics" +msgstr "" + +#: fpdb.pyw:841 +msgid "Dump Database to Textfile (takes ALOT of time)" +msgstr "" + +#: fpdb.pyw:842 +msgid "_Help" +msgstr "_Hilfe" + +#: fpdb.pyw:843 +msgid "_Log Messages" +msgstr "" + +#: fpdb.pyw:844 +msgid "A_bout, License, Copying" +msgstr "" + +#: fpdb.pyw:862 +msgid "" +"There is an error in your config file\n" +msgstr "" + +#: fpdb.pyw:863 +msgid "" +"\n" +"\n" +"Error is: " +msgstr "" + +#: fpdb.pyw:864 +msgid "CONFIG FILE ERROR" +msgstr "" + +#: fpdb.pyw:868 +msgid "Logfile is " +msgstr "" + +#: fpdb.pyw:870 +msgid "Config file" +msgstr "" + +#: fpdb.pyw:871 +msgid "" +"has been created at:\n" +"%s.\n" +msgstr "" + +#: fpdb.pyw:872 +msgid "Edit your screen_name and hand history path in the supported_sites " +msgstr "" + +#: fpdb.pyw:873 +msgid "section of the Preferences window (Main menu) before trying to import hands." +msgstr "" + +#: fpdb.pyw:896 +msgid "Connected to SQLite: %(database)s" +msgstr "" + +#: fpdb.pyw:898 +msgid "MySQL Server reports: Access denied. Are your permissions set correctly?" +msgstr "" + +#: fpdb.pyw:900 +msgid "MySQL client reports: 2002 or 2003 error. Unable to connect - " +msgstr "" + +#: fpdb.pyw:901 +msgid "Please check that the MySQL service has been started" +msgstr "" + +#: fpdb.pyw:903 +msgid "Postgres Server reports: Access denied. Are your permissions set correctly?" +msgstr "" + +#: fpdb.pyw:905 +msgid "Postgres client reports: Unable to connect - " +msgstr "" + +#: fpdb.pyw:906 +msgid "Please check that the Postgres service has been started" +msgstr "" + +#: fpdb.pyw:930 +msgid "Strong Warning - Invalid database version" +msgstr "" + +#: fpdb.pyw:932 +msgid "An invalid DB version or missing tables have been detected." +msgstr "" + +#: fpdb.pyw:936 +msgid "This error is not necessarily fatal but it is strongly recommended that you recreate the tables by using the Database menu." +msgstr "" + +#: fpdb.pyw:940 +msgid "Not doing this will likely lead to misbehaviour including fpdb crashes, corrupt data etc." +msgstr "" + +#: fpdb.pyw:953 +msgid "Status: Connected to %s database named %s on host %s" +msgstr "" + +#: fpdb.pyw:963 +msgid "" +"\n" +"Global lock taken by" +msgstr "" + +#: fpdb.pyw:966 +msgid "" +"\n" +"Failed to get global lock, it is currently held by" +msgstr "" + +#: fpdb.pyw:976 +msgid "Quitting normally" +msgstr "" + +#: fpdb.pyw:1000 +msgid "" +"Global lock released.\n" +msgstr "" + +#: fpdb.pyw:1007 +msgid "Auto Import" +msgstr "" + +#: fpdb.pyw:1014 +msgid "Bulk Import" +msgstr "" + +#: fpdb.pyw:1020 +msgid "eMail Import" +msgstr "" + +#: fpdb.pyw:1027 +msgid "Ring Player Stats" +msgstr "" + +#: fpdb.pyw:1033 +msgid "Tourney Player Stats" +msgstr "" + +#: fpdb.pyw:1039 +msgid "Tourney Viewer" +msgstr "" + +#: fpdb.pyw:1045 +msgid "Positional Stats" +msgstr "" + +#: fpdb.pyw:1055 +msgid "" +"Welcome to Fpdb!\n" +"To be notified of new snapshots and releases go to https://lists.sourceforge.net/lists/listinfo/fpdb-announce and subscribe.\n" +"If you want to follow development more closely go to https://lists.sourceforge.net/lists/listinfo/fpdb-main and subscribe.\n" +"\n" +"This program is currently in an alpha-state, so our database format is still sometimes changed.\n" +"You should therefore always keep your hand history files so that you can re-import after an update, if necessary.\n" +"\n" +"For documentation please visit our website at http://fpdb.sourceforge.net/.\n" +"If you need help click on Contact - Get Help on our website.\n" +"Please note that default.conf is no longer needed nor used, all configuration now happens in HUD_config.xml.\n" +"\n" +"This program is free/libre open source software licensed partially under the AGPL3, and partially under GPL2 or later.\n" +"The Windows installer package includes code licensed under the MIT license.\n" +"You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt and mit.txt in the fpdb installation directory." +msgstr "" + +#: fpdb.pyw:1069 +msgid "Help" +msgstr "Hilfe" + +#: fpdb.pyw:1076 +msgid "Graphs" +msgstr "" + +#: fpdb.pyw:1126 +msgid "" +"\n" +"Note: error output is being diverted to fpdb-errors.txt and HUD-errors.txt in:\n" +msgstr "" + +#: fpdb.pyw:1127 +msgid "" +"\n" +"Any major error will be reported there _only_.\n" +msgstr "" + +#: fpdb.pyw:1155 +msgid "fpdb starting ..." +msgstr "" + +#: fpdb.pyw:1204 +msgid "FPDB WARNING" +msgstr "" + +#: fpdb.pyw:1223 +msgid "" +"WARNING: Unable to find output hh directory %s\n" +"\n" +" Press YES to create this directory, or NO to select a new one." +msgstr "" + +#: fpdb.pyw:1231 +msgid "WARNING: Unable to create hand output directory. Importing is not likely to work until this is fixed." +msgstr "" + +#: fpdb.pyw:1236 +msgid "Select HH Output Directory" +msgstr "" diff --git a/pyfpdb/locale/fpdb-en_GB.po b/pyfpdb/locale/fpdb-en_GB.po index 479adcc0..d4c47fa4 100644 --- a/pyfpdb/locale/fpdb-en_GB.po +++ b/pyfpdb/locale/fpdb-en_GB.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2010-08-13 02:45+CEST\n" +"POT-Creation-Date: 2010-08-13 04:10+CEST\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -63,23 +63,568 @@ msgstr "" msgid "*** RIVER ***" msgstr "" -#: fpdb.pyw:827 +#: fpdb.pyw:40 +msgid "" +" - press return to continue\n" +msgstr "" + +#: fpdb.pyw:47 +msgid "" +"\n" +"python 2.5 not found, please install python 2.5, 2.6 or 2.7 for fpdb\n" +msgstr "" + +#: fpdb.pyw:48 fpdb.pyw:60 fpdb.pyw:82 +msgid "Press ENTER to continue." +msgstr "" + +#: fpdb.pyw:59 +msgid "We appear to be running in Windows, but the Windows Python Extensions are not loading. Please install the PYWIN32 package from http://sourceforge.net/projects/pywin32/" +msgstr "" + +#: fpdb.pyw:81 +msgid "Unable to load PYGTK modules required for GUI. Please install PyCairo, PyGObject, and PyGTK from www.pygtk.org." +msgstr "" + +#: fpdb.pyw:239 +msgid "Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, sqlcoder, Bostik, and others" +msgstr "" + +#: fpdb.pyw:240 +msgid "You are free to change, and distribute original or changed versions of fpdb within the rules set out by the license" +msgstr "" + +#: fpdb.pyw:241 +msgid "Please see fpdb's start screen for license information" +msgstr "" + +#: fpdb.pyw:245 +msgid "and others" +msgstr "" + +#: fpdb.pyw:251 +msgid "Operating System" +msgstr "" + +#: fpdb.pyw:271 +msgid "Your config file is: " +msgstr "" + +#: fpdb.pyw:276 +msgid "Version Information:" +msgstr "" + +#: fpdb.pyw:283 +msgid "Threads: " +msgstr "" + +#: fpdb.pyw:288 +msgid "Preferences" +msgstr "" + +#: fpdb.pyw:306 +msgid "Updated preferences have not been loaded because windows are open. Re-start fpdb to load them." +msgstr "" + +#: fpdb.pyw:316 +msgid "Maintain Databases" +msgstr "" + +#: fpdb.pyw:326 +msgid "saving updated db data" +msgstr "" + +#: fpdb.pyw:333 +msgid "guidb response was " +msgstr "" + +#: fpdb.pyw:339 +msgid "Cannot open Database Maintenance window because other windows have been opened. Re-start fpdb to use this option." +msgstr "" + +#: fpdb.pyw:342 +msgid "Number of Hands: " +msgstr "" + +#: fpdb.pyw:343 +msgid "" +"\n" +"Number of Tourneys: " +msgstr "" + +#: fpdb.pyw:344 +msgid "" +"\n" +"Number of TourneyTypes: " +msgstr "" + +#: fpdb.pyw:345 +msgid "Database Statistics" +msgstr "" + +#: fpdb.pyw:354 +msgid "HUD Configurator - choose category" +msgstr "" + +#: fpdb.pyw:360 +msgid "Please select the game category for which you want to configure HUD stats:" +msgstr "" + +#: fpdb.pyw:412 +msgid "HUD Configurator - please choose your stats" +msgstr "" + +#: fpdb.pyw:418 +msgid "Please choose the stats you wish to use in the below table." +msgstr "" + +#: fpdb.pyw:422 +msgid "Note that you may not select any stat more than once or it will crash." +msgstr "" + +#: fpdb.pyw:426 +msgid "It is not currently possible to select \"empty\" or anything else to that end." +msgstr "" + +#: fpdb.pyw:430 +msgid "To configure things like colouring you will still have to manually edit your HUD_config.xml." +msgstr "" + +#: fpdb.pyw:537 +msgid "Confirm deleting and recreating tables" +msgstr "" + +#: fpdb.pyw:538 +msgid "Please confirm that you want to (re-)create the tables. If there already are tables in the database " +msgstr "" + +#: fpdb.pyw:539 +msgid "" +" they will be deleted.\n" +"This may take a while." +msgstr "" + +#: fpdb.pyw:564 +msgid "User cancelled recreating tables" +msgstr "" + +#: fpdb.pyw:571 +msgid "Please confirm that you want to re-create the HUD cache." +msgstr "" + +#: fpdb.pyw:579 +msgid " Hero's cache starts: " +msgstr "" + +#: fpdb.pyw:593 +msgid " Villains' cache starts: " +msgstr "" + +#: fpdb.pyw:606 +msgid " Rebuilding HUD Cache ... " +msgstr "" + +#: fpdb.pyw:614 +msgid "User cancelled rebuilding hud cache" +msgstr "" + +#: fpdb.pyw:626 +msgid "Confirm rebuilding database indexes" +msgstr "" + +#: fpdb.pyw:627 +msgid "Please confirm that you want to rebuild the database indexes." +msgstr "" + +#: fpdb.pyw:635 +msgid " Rebuilding Indexes ... " +msgstr "" + +#: fpdb.pyw:642 +msgid " Cleaning Database ... " +msgstr "" + +#: fpdb.pyw:647 +msgid " Analyzing Database ... " +msgstr "" + +#: fpdb.pyw:652 +msgid "User cancelled rebuilding db indexes" +msgstr "" + +#: fpdb.pyw:713 +msgid "Pick a date" +msgstr "" + +#: fpdb.pyw:719 +msgid "Done" +msgstr "" + +#: fpdb.pyw:747 +msgid "Unimplemented: Save Profile (try saving a HUD layout, that should do it)" +msgstr "" + +#: fpdb.pyw:750 +msgid "Fatal Error - Config File Missing" +msgstr "" + +#: fpdb.pyw:752 +msgid "Please copy the config file from the docs folder to:" +msgstr "" + +#: fpdb.pyw:760 +msgid "and edit it according to the install documentation at http://fpdb.sourceforge.net" +msgstr "" + +#: fpdb.pyw:817 msgid "_Main" msgstr "" -#: fpdb.pyw:828 +#: fpdb.pyw:818 fpdb.pyw:846 msgid "_Quit" msgstr "" -#: fpdb.pyw:829 +#: fpdb.pyw:819 +msgid "L" +msgstr "" + +#: fpdb.pyw:819 msgid "_Load Profile (broken)" msgstr "" -#: fpdb.pyw:830 +#: fpdb.pyw:820 +msgid "S" +msgstr "" + +#: fpdb.pyw:820 msgid "_Save Profile (todo)" msgstr "" -#: fpdb.pyw:831 -msgid "Pre_ferences" -msgstr "_Einstellungen" +#: fpdb.pyw:821 +msgid "F" +msgstr "" + +#: fpdb.pyw:821 +msgid "Pre_ferences" +msgstr "" + +#: fpdb.pyw:822 +msgid "_Import" +msgstr "" + +#: fpdb.pyw:823 +msgid "_Set HandHistory Archive Directory" +msgstr "" + +#: fpdb.pyw:824 +msgid "B" +msgstr "" + +#: fpdb.pyw:824 +msgid "_Bulk Import" +msgstr "" + +#: fpdb.pyw:825 +msgid "I" +msgstr "" + +#: fpdb.pyw:825 +msgid "_Import through eMail/IMAP" +msgstr "" + +#: fpdb.pyw:826 +msgid "_Viewers" +msgstr "" + +#: fpdb.pyw:827 +msgid "A" +msgstr "" + +#: fpdb.pyw:827 +msgid "_Auto Import and HUD" +msgstr "" + +#: fpdb.pyw:828 +msgid "H" +msgstr "" + +#: fpdb.pyw:828 +msgid "_HUD Configurator" +msgstr "" + +#: fpdb.pyw:829 +msgid "G" +msgstr "" + +#: fpdb.pyw:829 +msgid "_Graphs" +msgstr "" + +#: fpdb.pyw:830 +msgid "P" +msgstr "" + +#: fpdb.pyw:830 +msgid "Ring _Player Stats (tabulated view)" +msgstr "" + +#: fpdb.pyw:831 +msgid "T" +msgstr "" + +#: fpdb.pyw:831 +msgid "_Tourney Player Stats (tabulated view)" +msgstr "" + +#: fpdb.pyw:832 +msgid "Tourney _Viewer" +msgstr "" + +#: fpdb.pyw:833 +msgid "O" +msgstr "" + +#: fpdb.pyw:833 +msgid "P_ositional Stats (tabulated view, not on sqlite)" +msgstr "" + +#: fpdb.pyw:834 fpdb.pyw:1051 +msgid "Session Stats" +msgstr "" + +#: fpdb.pyw:835 +msgid "_Database" +msgstr "" + +#: fpdb.pyw:836 +msgid "_Maintain Databases" +msgstr "" + +#: fpdb.pyw:837 +msgid "Create or Recreate _Tables" +msgstr "" + +#: fpdb.pyw:838 +msgid "Rebuild HUD Cache" +msgstr "" + +#: fpdb.pyw:839 +msgid "Rebuild DB Indexes" +msgstr "" + +#: fpdb.pyw:840 +msgid "_Statistics" +msgstr "" + +#: fpdb.pyw:841 +msgid "Dump Database to Textfile (takes ALOT of time)" +msgstr "" + +#: fpdb.pyw:842 +msgid "_Help" +msgstr "" + +#: fpdb.pyw:843 +msgid "_Log Messages" +msgstr "" + +#: fpdb.pyw:844 +msgid "A_bout, License, Copying" +msgstr "" + +#: fpdb.pyw:862 +msgid "" +"There is an error in your config file\n" +msgstr "" + +#: fpdb.pyw:863 +msgid "" +"\n" +"\n" +"Error is: " +msgstr "" + +#: fpdb.pyw:864 +msgid "CONFIG FILE ERROR" +msgstr "" + +#: fpdb.pyw:868 +msgid "Logfile is " +msgstr "" + +#: fpdb.pyw:870 +msgid "Config file" +msgstr "" + +#: fpdb.pyw:871 +msgid "" +"has been created at:\n" +"%s.\n" +msgstr "" + +#: fpdb.pyw:872 +msgid "Edit your screen_name and hand history path in the supported_sites " +msgstr "" + +#: fpdb.pyw:873 +msgid "section of the Preferences window (Main menu) before trying to import hands." +msgstr "" + +#: fpdb.pyw:896 +msgid "Connected to SQLite: %(database)s" +msgstr "" + +#: fpdb.pyw:898 +msgid "MySQL Server reports: Access denied. Are your permissions set correctly?" +msgstr "" + +#: fpdb.pyw:900 +msgid "MySQL client reports: 2002 or 2003 error. Unable to connect - " +msgstr "" + +#: fpdb.pyw:901 +msgid "Please check that the MySQL service has been started" +msgstr "" + +#: fpdb.pyw:903 +msgid "Postgres Server reports: Access denied. Are your permissions set correctly?" +msgstr "" + +#: fpdb.pyw:905 +msgid "Postgres client reports: Unable to connect - " +msgstr "" + +#: fpdb.pyw:906 +msgid "Please check that the Postgres service has been started" +msgstr "" + +#: fpdb.pyw:930 +msgid "Strong Warning - Invalid database version" +msgstr "" + +#: fpdb.pyw:932 +msgid "An invalid DB version or missing tables have been detected." +msgstr "" + +#: fpdb.pyw:936 +msgid "This error is not necessarily fatal but it is strongly recommended that you recreate the tables by using the Database menu." +msgstr "" + +#: fpdb.pyw:940 +msgid "Not doing this will likely lead to misbehaviour including fpdb crashes, corrupt data etc." +msgstr "" + +#: fpdb.pyw:953 +msgid "Status: Connected to %s database named %s on host %s" +msgstr "" + +#: fpdb.pyw:963 +msgid "" +"\n" +"Global lock taken by" +msgstr "" + +#: fpdb.pyw:966 +msgid "" +"\n" +"Failed to get global lock, it is currently held by" +msgstr "" + +#: fpdb.pyw:976 +msgid "Quitting normally" +msgstr "" + +#: fpdb.pyw:1000 +msgid "" +"Global lock released.\n" +msgstr "" + +#: fpdb.pyw:1007 +msgid "Auto Import" +msgstr "" + +#: fpdb.pyw:1014 +msgid "Bulk Import" +msgstr "" + +#: fpdb.pyw:1020 +msgid "eMail Import" +msgstr "" + +#: fpdb.pyw:1027 +msgid "Ring Player Stats" +msgstr "" + +#: fpdb.pyw:1033 +msgid "Tourney Player Stats" +msgstr "" + +#: fpdb.pyw:1039 +msgid "Tourney Viewer" +msgstr "" + +#: fpdb.pyw:1045 +msgid "Positional Stats" +msgstr "" + +#: fpdb.pyw:1055 +msgid "" +"Welcome to Fpdb!\n" +"To be notified of new snapshots and releases go to https://lists.sourceforge.net/lists/listinfo/fpdb-announce and subscribe.\n" +"If you want to follow development more closely go to https://lists.sourceforge.net/lists/listinfo/fpdb-main and subscribe.\n" +"\n" +"This program is currently in an alpha-state, so our database format is still sometimes changed.\n" +"You should therefore always keep your hand history files so that you can re-import after an update, if necessary.\n" +"\n" +"For documentation please visit our website at http://fpdb.sourceforge.net/.\n" +"If you need help click on Contact - Get Help on our website.\n" +"Please note that default.conf is no longer needed nor used, all configuration now happens in HUD_config.xml.\n" +"\n" +"This program is free/libre open source software licensed partially under the AGPL3, and partially under GPL2 or later.\n" +"The Windows installer package includes code licensed under the MIT license.\n" +"You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt and mit.txt in the fpdb installation directory." +msgstr "" + +#: fpdb.pyw:1069 +msgid "Help" +msgstr "" + +#: fpdb.pyw:1076 +msgid "Graphs" +msgstr "" + +#: fpdb.pyw:1126 +msgid "" +"\n" +"Note: error output is being diverted to fpdb-errors.txt and HUD-errors.txt in:\n" +msgstr "" + +#: fpdb.pyw:1127 +msgid "" +"\n" +"Any major error will be reported there _only_.\n" +msgstr "" + +#: fpdb.pyw:1155 +msgid "fpdb starting ..." +msgstr "" + +#: fpdb.pyw:1204 +msgid "FPDB WARNING" +msgstr "" + +#: fpdb.pyw:1223 +msgid "" +"WARNING: Unable to find output hh directory %s\n" +"\n" +" Press YES to create this directory, or NO to select a new one." +msgstr "" + +#: fpdb.pyw:1231 +msgid "WARNING: Unable to create hand output directory. Importing is not likely to work until this is fixed." +msgstr "" + +#: fpdb.pyw:1236 +msgid "Select HH Output Directory" +msgstr "" From d876c250a45f31ac283e3d51324b937da920b57c Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 04:23:11 +0200 Subject: [PATCH 11/20] gettext-ify GuiAutoImport.py --- pyfpdb/GuiAutoImport.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/pyfpdb/GuiAutoImport.py b/pyfpdb/GuiAutoImport.py index ddc47f57..6282063f 100755 --- a/pyfpdb/GuiAutoImport.py +++ b/pyfpdb/GuiAutoImport.py @@ -70,7 +70,7 @@ class GuiAutoImport (threading.Thread): vbox2 = gtk.VBox(True, 0) hbox.pack_start(vbox2, True, True, 0) - self.intervalLabel = gtk.Label("Time between imports in seconds:") + self.intervalLabel = gtk.Label(_("Time between imports in seconds:")) self.intervalLabel.set_alignment(xalign=1.0, yalign=0.5) vbox1.pack_start(self.intervalLabel, False, True, 0) @@ -101,7 +101,7 @@ class GuiAutoImport (threading.Thread): hbox.pack_start(lbl1, expand=True, fill=False) self.doAutoImportBool = False - self.startButton = gtk.ToggleButton(" Start _Autoimport ") + self.startButton = gtk.ToggleButton(_(" Start _Autoimport ")) self.startButton.connect("clicked", self.startClicked, "start clicked") hbox.pack_start(self.startButton, expand=False, fill=False) @@ -120,7 +120,7 @@ class GuiAutoImport (threading.Thread): scrolledwindow.add(self.textview) self.mainVBox.show_all() - self.addText("AutoImport Ready.") + self.addText(_("AutoImport Ready.")) def addText(self, text): end_iter = self.textbuffer.get_end_iter() @@ -133,7 +133,7 @@ class GuiAutoImport (threading.Thread): """runs when user clicks one of the browse buttons in the auto import tab""" current_path=data[1].get_text() - dia_chooser = gtk.FileChooserDialog(title="Please choose the path that you want to auto import", + dia_chooser = gtk.FileChooserDialog(title=_("Please choose the path that you want to auto import"), action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK)) #dia_chooser.set_current_folder(pathname) @@ -156,7 +156,7 @@ class GuiAutoImport (threading.Thread): def do_import(self): """Callback for timer to do an import iteration.""" if self.doAutoImportBool: - self.startButton.set_label(u' _Auto Import Running ') + self.startButton.set_label(_(u' _Auto Import Running ')) self.importer.runUpdated() self.addText(".") #sys.stdout.write(".") @@ -167,9 +167,9 @@ class GuiAutoImport (threading.Thread): def reset_startbutton(self): if self.pipe_to_hud is not None: - self.startButton.set_label(u' Stop _Autoimport ') + self.startButton.set_label(_(u' Stop _Autoimport ')) else: - self.startButton.set_label(u' Start _Autoimport ') + self.startButton.set_label(_(u' Start _Autoimport ')) return False @@ -192,9 +192,9 @@ class GuiAutoImport (threading.Thread): # - Ideally we want to release the lock if the auto-import is killed by some # kind of exception - is this possible? if self.settings['global_lock'].acquire(False): # returns false immediately if lock not acquired - self.addText("\nGlobal lock taken ... Auto Import Started.\n") + self.addText(_("\nGlobal lock taken ... Auto Import Started.\n")) self.doAutoImportBool = True - widget.set_label(u' _Stop Autoimport ') + widget.set_label(_(u' _Stop Autoimport ')) if self.pipe_to_hud is None: if Configuration.FROZEN: path = Configuration.EXEC_PATH @@ -210,7 +210,7 @@ class GuiAutoImport (threading.Thread): bs = 1 try: - print "opening pipe to HUD" + print _("opening pipe to HUD") self.pipe_to_hud = subprocess.Popen(command, bufsize=bs, stdin=subprocess.PIPE, stdout=subprocess.PIPE, # only needed for py2exe @@ -222,7 +222,7 @@ class GuiAutoImport (threading.Thread): except: err = traceback.extract_tb(sys.exc_info()[2])[-1] #self.addText( "\n*** GuiAutoImport Error opening pipe: " + err[2] + "(" + str(err[1]) + "): " + str(sys.exc_info()[1])) - self.addText( "\n*** GuiAutoImport Error opening pipe: " + traceback.format_exc() ) + self.addText(_("\n*** GuiAutoImport Error opening pipe: ") + traceback.format_exc() ) else: for site in self.input_settings: self.importer.addImportDirectory(self.input_settings[site][0], True, site, self.input_settings[site][1]) @@ -234,19 +234,19 @@ class GuiAutoImport (threading.Thread): self.importtimer = gobject.timeout_add(interval * 1000, self.do_import) else: - self.addText("\nauto-import aborted - global lock not available") + self.addText(_("\nauto-import aborted - global lock not available")) else: # toggled off gobject.source_remove(self.importtimer) self.settings['global_lock'].release() self.doAutoImportBool = False # do_import will return this and stop the gobject callback timer - self.addText("\nStopping autoimport - global lock released.") + self.addText(_("\nStopping autoimport - global lock released.")) if self.pipe_to_hud.poll() is not None: - self.addText("\n * Stop Autoimport: HUD already terminated") + self.addText(_("\n * Stop Autoimport: HUD already terminated")) else: #print >>self.pipe_to_hud.stdin, "\n" self.pipe_to_hud.communicate('\n') # waits for process to terminate self.pipe_to_hud = None - self.startButton.set_label(u' Start _Autoimport ') + self.startButton.set_label(_(u' Start _Autoimport ')) #end def GuiAutoImport.startClicked @@ -268,7 +268,7 @@ class GuiAutoImport (threading.Thread): hbox1.pack_start(dirPath, True, True, 3) dirPath.show() - browseButton=gtk.Button("Browse...") + browseButton=gtk.Button(_("Browse...")) browseButton.connect("clicked", self.browseClicked, [site] + [dirPath]) hbox2.pack_start(browseButton, False, False, 3) browseButton.show() @@ -311,7 +311,7 @@ if __name__== "__main__": parser = OptionParser() parser.add_option("-q", "--quiet", action="store_false", dest="gui", default=True, help="don't start gui") parser.add_option("-m", "--minPrint", "--status", dest="minPrint", default="0", type="int", - help="How often to print a one-line status report (0 (default) means never)") + help=_("How often to print a one-line status report (0 (default) means never)")) (options, argv) = parser.parse_args() config = Configuration.Config() From d1bb8defc8e0299cd97026b134345b6a235de140 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 04:30:42 +0200 Subject: [PATCH 12/20] gettext-ify GuiTourneyPlayerStats and remove untranslated fpdb-de_DE.po --- pyfpdb/GuiTourneyPlayerStats.py | 10 +- pyfpdb/locale/fpdb-de_DE.po | 630 -------------------------------- 2 files changed, 5 insertions(+), 635 deletions(-) delete mode 100644 pyfpdb/locale/fpdb-de_DE.po diff --git a/pyfpdb/GuiTourneyPlayerStats.py b/pyfpdb/GuiTourneyPlayerStats.py index 948474d4..7f65888f 100644 --- a/pyfpdb/GuiTourneyPlayerStats.py +++ b/pyfpdb/GuiTourneyPlayerStats.py @@ -69,7 +69,7 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats): self.filters = TourneyFilters.TourneyFilters(self.db, self.conf, self.sql, display = filters_display) #self.filters.registerButton1Name("_Filters") #self.filters.registerButton1Callback(self.showDetailFilter) - self.filters.registerButton2Name("_Refresh Stats") + self.filters.registerButton2Name(_("_Refresh Stats")) self.filters.registerButton2Callback(self.refreshStats) # ToDo: store in config @@ -237,7 +237,7 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats): self.addGrid(swin, 'playerDetailedStats', flags, playerids, sitenos, seats, dates) self.db.rollback() - print "Stats page displayed in %4.2f seconds" % (time() - startTime) + print _("Stats page displayed in %4.2f seconds") % (time() - startTime) #end def createStatsTable def fillStatsFrame(self, vbox): @@ -262,10 +262,10 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats): if not sitenos: #Should probably pop up here. - print "No sites selected - defaulting to PokerStars" + print _("No sites selected - defaulting to PokerStars") sitenos = [2] if not playerids: - print "No player ids found" + print _("No player ids found") return self.createStatsTable(vbox, tourneyTypes, playerids, sitenos, seats, dates) @@ -451,7 +451,7 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats): # to turn indicator off for other cols except: err = traceback.extract_tb(sys.exc_info()[2]) - print "***sortCols error: " + str(sys.exc_info()[1]) + print _("***sortCols error: ") + str(sys.exc_info()[1]) print "\n".join( [e[0]+':'+str(e[1])+" "+e[2] for e in err] ) #end def sortCols #end class GuiTourneyPlayerStats diff --git a/pyfpdb/locale/fpdb-de_DE.po b/pyfpdb/locale/fpdb-de_DE.po deleted file mode 100644 index de746712..00000000 --- a/pyfpdb/locale/fpdb-de_DE.po +++ /dev/null @@ -1,630 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR ORGANIZATION -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2010-08-13 04:10+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:40 -msgid "" -" - press return to continue\n" -msgstr "" - -#: fpdb.pyw:47 -msgid "" -"\n" -"python 2.5 not found, please install python 2.5, 2.6 or 2.7 for fpdb\n" -msgstr "" - -#: fpdb.pyw:48 fpdb.pyw:60 fpdb.pyw:82 -msgid "Press ENTER to continue." -msgstr "" - -#: fpdb.pyw:59 -msgid "We appear to be running in Windows, but the Windows Python Extensions are not loading. Please install the PYWIN32 package from http://sourceforge.net/projects/pywin32/" -msgstr "" - -#: fpdb.pyw:81 -msgid "Unable to load PYGTK modules required for GUI. Please install PyCairo, PyGObject, and PyGTK from www.pygtk.org." -msgstr "" - -#: fpdb.pyw:239 -msgid "Copyright 2008-2010, Steffen, Eratosthenes, Carl Gherardi, Eric Blade, _mt, sqlcoder, Bostik, and others" -msgstr "" - -#: fpdb.pyw:240 -msgid "You are free to change, and distribute original or changed versions of fpdb within the rules set out by the license" -msgstr "" - -#: fpdb.pyw:241 -msgid "Please see fpdb's start screen for license information" -msgstr "" - -#: fpdb.pyw:245 -msgid "and others" -msgstr "" - -#: fpdb.pyw:251 -msgid "Operating System" -msgstr "" - -#: fpdb.pyw:271 -msgid "Your config file is: " -msgstr "" - -#: fpdb.pyw:276 -msgid "Version Information:" -msgstr "" - -#: fpdb.pyw:283 -msgid "Threads: " -msgstr "" - -#: fpdb.pyw:288 -msgid "Preferences" -msgstr "" - -#: fpdb.pyw:306 -msgid "Updated preferences have not been loaded because windows are open. Re-start fpdb to load them." -msgstr "" - -#: fpdb.pyw:316 -msgid "Maintain Databases" -msgstr "" - -#: fpdb.pyw:326 -msgid "saving updated db data" -msgstr "" - -#: fpdb.pyw:333 -msgid "guidb response was " -msgstr "" - -#: fpdb.pyw:339 -msgid "Cannot open Database Maintenance window because other windows have been opened. Re-start fpdb to use this option." -msgstr "" - -#: fpdb.pyw:342 -msgid "Number of Hands: " -msgstr "" - -#: fpdb.pyw:343 -msgid "" -"\n" -"Number of Tourneys: " -msgstr "" - -#: fpdb.pyw:344 -msgid "" -"\n" -"Number of TourneyTypes: " -msgstr "" - -#: fpdb.pyw:345 -msgid "Database Statistics" -msgstr "" - -#: fpdb.pyw:354 -msgid "HUD Configurator - choose category" -msgstr "" - -#: fpdb.pyw:360 -msgid "Please select the game category for which you want to configure HUD stats:" -msgstr "" - -#: fpdb.pyw:412 -msgid "HUD Configurator - please choose your stats" -msgstr "" - -#: fpdb.pyw:418 -msgid "Please choose the stats you wish to use in the below table." -msgstr "" - -#: fpdb.pyw:422 -msgid "Note that you may not select any stat more than once or it will crash." -msgstr "" - -#: fpdb.pyw:426 -msgid "It is not currently possible to select \"empty\" or anything else to that end." -msgstr "" - -#: fpdb.pyw:430 -msgid "To configure things like colouring you will still have to manually edit your HUD_config.xml." -msgstr "" - -#: fpdb.pyw:537 -msgid "Confirm deleting and recreating tables" -msgstr "" - -#: fpdb.pyw:538 -msgid "Please confirm that you want to (re-)create the tables. If there already are tables in the database " -msgstr "" - -#: fpdb.pyw:539 -msgid "" -" they will be deleted.\n" -"This may take a while." -msgstr "" - -#: fpdb.pyw:564 -msgid "User cancelled recreating tables" -msgstr "" - -#: fpdb.pyw:571 -msgid "Please confirm that you want to re-create the HUD cache." -msgstr "" - -#: fpdb.pyw:579 -msgid " Hero's cache starts: " -msgstr "" - -#: fpdb.pyw:593 -msgid " Villains' cache starts: " -msgstr "" - -#: fpdb.pyw:606 -msgid " Rebuilding HUD Cache ... " -msgstr "" - -#: fpdb.pyw:614 -msgid "User cancelled rebuilding hud cache" -msgstr "" - -#: fpdb.pyw:626 -msgid "Confirm rebuilding database indexes" -msgstr "" - -#: fpdb.pyw:627 -msgid "Please confirm that you want to rebuild the database indexes." -msgstr "" - -#: fpdb.pyw:635 -msgid " Rebuilding Indexes ... " -msgstr "" - -#: fpdb.pyw:642 -msgid " Cleaning Database ... " -msgstr "" - -#: fpdb.pyw:647 -msgid " Analyzing Database ... " -msgstr "" - -#: fpdb.pyw:652 -msgid "User cancelled rebuilding db indexes" -msgstr "" - -#: fpdb.pyw:713 -msgid "Pick a date" -msgstr "" - -#: fpdb.pyw:719 -msgid "Done" -msgstr "" - -#: fpdb.pyw:747 -msgid "Unimplemented: Save Profile (try saving a HUD layout, that should do it)" -msgstr "" - -#: fpdb.pyw:750 -msgid "Fatal Error - Config File Missing" -msgstr "" - -#: fpdb.pyw:752 -msgid "Please copy the config file from the docs folder to:" -msgstr "" - -#: fpdb.pyw:760 -msgid "and edit it according to the install documentation at http://fpdb.sourceforge.net" -msgstr "" - -#: fpdb.pyw:817 -msgid "_Main" -msgstr "" - -#: fpdb.pyw:818 fpdb.pyw:846 -msgid "_Quit" -msgstr "" - -#: fpdb.pyw:819 -msgid "L" -msgstr "" - -#: fpdb.pyw:819 -msgid "_Load Profile (broken)" -msgstr "" - -#: fpdb.pyw:820 -msgid "S" -msgstr "" - -#: fpdb.pyw:820 -msgid "_Save Profile (todo)" -msgstr "" - -#: fpdb.pyw:821 -msgid "F" -msgstr "" - -#: fpdb.pyw:821 -msgid "Pre_ferences" -msgstr "" - -#: fpdb.pyw:822 -msgid "_Import" -msgstr "" - -#: fpdb.pyw:823 -msgid "_Set HandHistory Archive Directory" -msgstr "" - -#: fpdb.pyw:824 -msgid "B" -msgstr "" - -#: fpdb.pyw:824 -msgid "_Bulk Import" -msgstr "" - -#: fpdb.pyw:825 -msgid "I" -msgstr "" - -#: fpdb.pyw:825 -msgid "_Import through eMail/IMAP" -msgstr "" - -#: fpdb.pyw:826 -msgid "_Viewers" -msgstr "" - -#: fpdb.pyw:827 -msgid "A" -msgstr "" - -#: fpdb.pyw:827 -msgid "_Auto Import and HUD" -msgstr "" - -#: fpdb.pyw:828 -msgid "H" -msgstr "" - -#: fpdb.pyw:828 -msgid "_HUD Configurator" -msgstr "" - -#: fpdb.pyw:829 -msgid "G" -msgstr "" - -#: fpdb.pyw:829 -msgid "_Graphs" -msgstr "" - -#: fpdb.pyw:830 -msgid "P" -msgstr "" - -#: fpdb.pyw:830 -msgid "Ring _Player Stats (tabulated view)" -msgstr "" - -#: fpdb.pyw:831 -msgid "T" -msgstr "" - -#: fpdb.pyw:831 -msgid "_Tourney Player Stats (tabulated view)" -msgstr "" - -#: fpdb.pyw:832 -msgid "Tourney _Viewer" -msgstr "" - -#: fpdb.pyw:833 -msgid "O" -msgstr "" - -#: fpdb.pyw:833 -msgid "P_ositional Stats (tabulated view, not on sqlite)" -msgstr "" - -#: fpdb.pyw:834 fpdb.pyw:1051 -msgid "Session Stats" -msgstr "" - -#: fpdb.pyw:835 -msgid "_Database" -msgstr "" - -#: fpdb.pyw:836 -msgid "_Maintain Databases" -msgstr "" - -#: fpdb.pyw:837 -msgid "Create or Recreate _Tables" -msgstr "" - -#: fpdb.pyw:838 -msgid "Rebuild HUD Cache" -msgstr "" - -#: fpdb.pyw:839 -msgid "Rebuild DB Indexes" -msgstr "" - -#: fpdb.pyw:840 -msgid "_Statistics" -msgstr "" - -#: fpdb.pyw:841 -msgid "Dump Database to Textfile (takes ALOT of time)" -msgstr "" - -#: fpdb.pyw:842 -msgid "_Help" -msgstr "_Hilfe" - -#: fpdb.pyw:843 -msgid "_Log Messages" -msgstr "" - -#: fpdb.pyw:844 -msgid "A_bout, License, Copying" -msgstr "" - -#: fpdb.pyw:862 -msgid "" -"There is an error in your config file\n" -msgstr "" - -#: fpdb.pyw:863 -msgid "" -"\n" -"\n" -"Error is: " -msgstr "" - -#: fpdb.pyw:864 -msgid "CONFIG FILE ERROR" -msgstr "" - -#: fpdb.pyw:868 -msgid "Logfile is " -msgstr "" - -#: fpdb.pyw:870 -msgid "Config file" -msgstr "" - -#: fpdb.pyw:871 -msgid "" -"has been created at:\n" -"%s.\n" -msgstr "" - -#: fpdb.pyw:872 -msgid "Edit your screen_name and hand history path in the supported_sites " -msgstr "" - -#: fpdb.pyw:873 -msgid "section of the Preferences window (Main menu) before trying to import hands." -msgstr "" - -#: fpdb.pyw:896 -msgid "Connected to SQLite: %(database)s" -msgstr "" - -#: fpdb.pyw:898 -msgid "MySQL Server reports: Access denied. Are your permissions set correctly?" -msgstr "" - -#: fpdb.pyw:900 -msgid "MySQL client reports: 2002 or 2003 error. Unable to connect - " -msgstr "" - -#: fpdb.pyw:901 -msgid "Please check that the MySQL service has been started" -msgstr "" - -#: fpdb.pyw:903 -msgid "Postgres Server reports: Access denied. Are your permissions set correctly?" -msgstr "" - -#: fpdb.pyw:905 -msgid "Postgres client reports: Unable to connect - " -msgstr "" - -#: fpdb.pyw:906 -msgid "Please check that the Postgres service has been started" -msgstr "" - -#: fpdb.pyw:930 -msgid "Strong Warning - Invalid database version" -msgstr "" - -#: fpdb.pyw:932 -msgid "An invalid DB version or missing tables have been detected." -msgstr "" - -#: fpdb.pyw:936 -msgid "This error is not necessarily fatal but it is strongly recommended that you recreate the tables by using the Database menu." -msgstr "" - -#: fpdb.pyw:940 -msgid "Not doing this will likely lead to misbehaviour including fpdb crashes, corrupt data etc." -msgstr "" - -#: fpdb.pyw:953 -msgid "Status: Connected to %s database named %s on host %s" -msgstr "" - -#: fpdb.pyw:963 -msgid "" -"\n" -"Global lock taken by" -msgstr "" - -#: fpdb.pyw:966 -msgid "" -"\n" -"Failed to get global lock, it is currently held by" -msgstr "" - -#: fpdb.pyw:976 -msgid "Quitting normally" -msgstr "" - -#: fpdb.pyw:1000 -msgid "" -"Global lock released.\n" -msgstr "" - -#: fpdb.pyw:1007 -msgid "Auto Import" -msgstr "" - -#: fpdb.pyw:1014 -msgid "Bulk Import" -msgstr "" - -#: fpdb.pyw:1020 -msgid "eMail Import" -msgstr "" - -#: fpdb.pyw:1027 -msgid "Ring Player Stats" -msgstr "" - -#: fpdb.pyw:1033 -msgid "Tourney Player Stats" -msgstr "" - -#: fpdb.pyw:1039 -msgid "Tourney Viewer" -msgstr "" - -#: fpdb.pyw:1045 -msgid "Positional Stats" -msgstr "" - -#: fpdb.pyw:1055 -msgid "" -"Welcome to Fpdb!\n" -"To be notified of new snapshots and releases go to https://lists.sourceforge.net/lists/listinfo/fpdb-announce and subscribe.\n" -"If you want to follow development more closely go to https://lists.sourceforge.net/lists/listinfo/fpdb-main and subscribe.\n" -"\n" -"This program is currently in an alpha-state, so our database format is still sometimes changed.\n" -"You should therefore always keep your hand history files so that you can re-import after an update, if necessary.\n" -"\n" -"For documentation please visit our website at http://fpdb.sourceforge.net/.\n" -"If you need help click on Contact - Get Help on our website.\n" -"Please note that default.conf is no longer needed nor used, all configuration now happens in HUD_config.xml.\n" -"\n" -"This program is free/libre open source software licensed partially under the AGPL3, and partially under GPL2 or later.\n" -"The Windows installer package includes code licensed under the MIT license.\n" -"You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt and mit.txt in the fpdb installation directory." -msgstr "" - -#: fpdb.pyw:1069 -msgid "Help" -msgstr "Hilfe" - -#: fpdb.pyw:1076 -msgid "Graphs" -msgstr "" - -#: fpdb.pyw:1126 -msgid "" -"\n" -"Note: error output is being diverted to fpdb-errors.txt and HUD-errors.txt in:\n" -msgstr "" - -#: fpdb.pyw:1127 -msgid "" -"\n" -"Any major error will be reported there _only_.\n" -msgstr "" - -#: fpdb.pyw:1155 -msgid "fpdb starting ..." -msgstr "" - -#: fpdb.pyw:1204 -msgid "FPDB WARNING" -msgstr "" - -#: fpdb.pyw:1223 -msgid "" -"WARNING: Unable to find output hh directory %s\n" -"\n" -" Press YES to create this directory, or NO to select a new one." -msgstr "" - -#: fpdb.pyw:1231 -msgid "WARNING: Unable to create hand output directory. Importing is not likely to work until this is fixed." -msgstr "" - -#: fpdb.pyw:1236 -msgid "Select HH Output Directory" -msgstr "" - From 3dac606b4f7cb796f3ad7c198726832ff7a291ea Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 04:48:06 +0200 Subject: [PATCH 13/20] gettext-ify ImapFetcher and GuiImapFetcher --- pyfpdb/GuiImapFetcher.py | 22 +++++++++++----------- pyfpdb/ImapFetcher.py | 8 ++++++-- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/pyfpdb/GuiImapFetcher.py b/pyfpdb/GuiImapFetcher.py index 84af7d65..a4e9ff4e 100644 --- a/pyfpdb/GuiImapFetcher.py +++ b/pyfpdb/GuiImapFetcher.py @@ -34,18 +34,18 @@ class GuiImapFetcher (threading.Thread): self.buttonsHBox = gtk.HBox() self.mainVBox.pack_end(self.buttonsHBox, expand=False) - label=gtk.Label("To cancel just close this tab.") + label=gtk.Label(_("To cancel just close this tab.")) self.buttonsHBox.add(label) - self.saveButton = gtk.Button("_Save") + self.saveButton = gtk.Button(_("_Save")) self.saveButton.connect('clicked', self.saveClicked) self.buttonsHBox.add(self.saveButton) - self.importAllButton = gtk.Button("_Import All") + self.importAllButton = gtk.Button(_("_Import All")) self.importAllButton.connect('clicked', self.importAllClicked) self.buttonsHBox.add(self.importAllButton) - self.statusLabel=gtk.Label("If you change the config you must save before importing") + self.statusLabel=gtk.Label(_("If you change the config you must save before importing")) self.mainVBox.pack_end(self.statusLabel, expand=False, padding=4) self.passwords={} @@ -88,17 +88,17 @@ class GuiImapFetcher (threading.Thread): #def saveClicked def importAllClicked(self, widget, data=None): - self.statusLabel.set_label("Starting import. Please wait.") #FIXME: why doesnt this one show? + self.statusLabel.set_label(_("Starting import. Please wait.")) #FIXME: why doesnt this one show? for email in self.config.emails: try: result=ImapFetcher.run(self.config.emails[email], self.db) - self.statusLabel.set_label("Finished import without error.") + self.statusLabel.set_label(_("Finished import without error.")) except IMAP4.error as error: if str(error)=="[AUTHENTICATIONFAILED] Authentication failed.": - self.statusLabel.set_label("Login to mailserver failed: please check mailserver, username and password") + self.statusLabel.set_label(_("Login to mailserver failed: please check mailserver, username and password")) except gaierror as error: if str(error)=="[Errno -2] Name or service not known": - self.statusLabel.set_label("Could not connect to mailserver: check mailserver and use SSL settings and internet connectivity") + self.statusLabel.set_label(_("Could not connect to mailserver: check mailserver and use SSL settings and internet connectivity")) #def importAllClicked def get_vbox(self): @@ -108,7 +108,7 @@ class GuiImapFetcher (threading.Thread): def displayConfig(self): box=gtk.HBox(homogeneous=True) - for text in ("Site", "Fetch Type", "Mailserver", "Username", "Password", "Mail Folder", "Use SSL"): + for text in (_("Site"), _("Fetch Type"), _("Mailserver"), _("Username"), _("Password"), _("Mail Folder"), _("Use SSL")): label=gtk.Label(text) box.add(label) self.mainVBox.pack_start(box, expand=False) @@ -139,8 +139,8 @@ class GuiImapFetcher (threading.Thread): box.add(entry) sslBox = gtk.combo_box_new_text() - sslBox.append_text("Yes") - sslBox.append_text("No") + sslBox.append_text(_("Yes")) + sslBox.append_text(_("No")) sslBox.set_active(0) box.add(sslBox) diff --git a/pyfpdb/ImapFetcher.py b/pyfpdb/ImapFetcher.py index 97dbf3de..ee267cf9 100755 --- a/pyfpdb/ImapFetcher.py +++ b/pyfpdb/ImapFetcher.py @@ -22,6 +22,10 @@ from imaplib import IMAP4, IMAP4_SSL import PokerStarsSummary +import gettext +trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"]) +trans.install() + def splitPokerStarsSummaries(emailText): splitSummaries=emailText.split("\nPokerStars Tournament #")[1:] for i in range(len(splitSummaries)): @@ -39,7 +43,7 @@ def run(config, db): else: server = IMAP4(config.host) response = server.login(config.username, config.password) #TODO catch authentication error - print "response to logging in:",response + print _("response to logging in:"),response #print "server.list():",server.list() #prints list of folders response = server.select(config.folder) @@ -71,7 +75,7 @@ def run(config, db): #print "finished importing a PS summary with result:",result #TODO: count results and output to shell like hand importer does - print "completed running Imap import, closing server connection" + print _("completed running Imap import, closing server connection") #finally: # try: server.close() From f03b295b0be1cde9e8575a68f1e1e3db12f6ac79 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 04:59:17 +0200 Subject: [PATCH 14/20] gettext-ify GuiBulkImport --- pyfpdb/GuiBulkImport.py | 78 ++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/pyfpdb/GuiBulkImport.py b/pyfpdb/GuiBulkImport.py index abb0c744..6d0f151a 100755 --- a/pyfpdb/GuiBulkImport.py +++ b/pyfpdb/GuiBulkImport.py @@ -52,8 +52,8 @@ class GuiBulkImport(): # (see comment above about what to do if pipe already open) if self.settings['global_lock'].acquire(wait=False, source="GuiBulkImport"): # returns false immediately if lock not acquired #try: - print "\nGlobal lock taken ..." - self.progressbar.set_text("Importing...") + print _("\nGlobal lock taken ...") + self.progressbar.set_text(_("Importing...")) self.progressbar.pulse() while gtk.events_pending(): # see http://faq.pygtk.org/index.py?req=index for more hints (3.7) gtk.main_iteration(False) @@ -102,7 +102,7 @@ class GuiBulkImport(): ttime = time() - starttime if ttime == 0: ttime = 1 - print 'GuiBulkImport.load done: Stored: %d \tDuplicates: %d \tPartial: %d \tErrors: %d in %s seconds - %.0f/sec'\ + print _('GuiBulkImport.load done: Stored: %d \tDuplicates: %d \tPartial: %d \tErrors: %d in %s seconds - %.0f/sec')\ % (stored, dups, partial, errs, ttime, (stored+0.0) / ttime) self.importer.clearFileList() # This file should really be 'logging' @@ -116,7 +116,7 @@ class GuiBulkImport(): self.cb_drophudcache.set_active(0) self.lab_hdrop.set_sensitive(True) - self.progressbar.set_text("Import Complete") + self.progressbar.set_text(_("Import Complete")) self.progressbar.set_fraction(0) #except: #err = traceback.extract_tb(sys.exc_info()[2])[-1] @@ -124,7 +124,7 @@ class GuiBulkImport(): #self.settings['global_lock'].release() self.settings['global_lock'].release() else: - print "bulk-import aborted - global lock not available" + print _("bulk-import aborted - global lock not available") def get_vbox(self): """returns the vbox of this thread""" @@ -150,14 +150,14 @@ class GuiBulkImport(): self.table.show() # checkbox - print start/stop? - self.chk_st_st = gtk.CheckButton('Print Start/Stop Info') + self.chk_st_st = gtk.CheckButton(_('Print Start/Stop Info')) self.table.attach(self.chk_st_st, 0, 1, 0, 1, xpadding=10, ypadding=0, yoptions=gtk.SHRINK) self.chk_st_st.show() self.chk_st_st.set_active(True) # label - status - self.lab_status = gtk.Label("Hands/status print:") + self.lab_status = gtk.Label(_("Hands/status print:")) self.table.attach(self.lab_status, 1, 2, 0, 1, xpadding=0, ypadding=0, yoptions=gtk.SHRINK) self.lab_status.show() @@ -174,7 +174,7 @@ class GuiBulkImport(): self.spin_status.show() # label - threads - self.lab_threads = gtk.Label("Number of threads:") + self.lab_threads = gtk.Label(_("Number of threads:")) self.table.attach(self.lab_threads, 3, 4, 0, 1, xpadding=0, ypadding=0, yoptions=gtk.SHRINK) self.lab_threads.show() @@ -194,12 +194,12 @@ class GuiBulkImport(): self.spin_threads.set_sensitive(False) # checkbox - fail on error? - self.chk_fail = gtk.CheckButton('Fail on error') + self.chk_fail = gtk.CheckButton(_('Fail on error')) self.table.attach(self.chk_fail, 0, 1, 1, 2, xpadding=10, ypadding=0, yoptions=gtk.SHRINK) self.chk_fail.show() # label - hands - self.lab_hands = gtk.Label("Hands/file:") + self.lab_hands = gtk.Label(_("Hands/file:")) self.table.attach(self.lab_hands, 1, 2, 1, 2, xpadding=0, ypadding=0, yoptions=gtk.SHRINK) self.lab_hands.show() self.lab_hands.set_justify(gtk.JUSTIFY_RIGHT) @@ -214,7 +214,7 @@ class GuiBulkImport(): self.spin_hands.show() # label - drop indexes - self.lab_drop = gtk.Label("Drop indexes:") + self.lab_drop = gtk.Label(_("Drop indexes:")) self.table.attach(self.lab_drop, 3, 4, 1, 2, xpadding=0, ypadding=0, yoptions=gtk.SHRINK) self.lab_drop.show() @@ -223,20 +223,20 @@ class GuiBulkImport(): # ComboBox - drop indexes self.cb_dropindexes = gtk.combo_box_new_text() - self.cb_dropindexes.append_text('auto') - self.cb_dropindexes.append_text("don't drop") - self.cb_dropindexes.append_text('drop') + self.cb_dropindexes.append_text(_('auto')) + self.cb_dropindexes.append_text(_("don't drop")) + self.cb_dropindexes.append_text(_('drop')) self.cb_dropindexes.set_active(0) self.table.attach(self.cb_dropindexes, 4, 5, 1, 2, xpadding=10, ypadding=0, yoptions=gtk.SHRINK) self.cb_dropindexes.show() - self.cb_testmode = gtk.CheckButton('HUD Test mode') + self.cb_testmode = gtk.CheckButton(_('HUD Test mode')) self.table.attach(self.cb_testmode, 0, 1, 2, 3, xpadding=10, ypadding=0, yoptions=gtk.SHRINK) self.cb_testmode.show() # label - filter - self.lab_filter = gtk.Label("Site filter:") + self.lab_filter = gtk.Label(_("Site filter:")) self.table.attach(self.lab_filter, 1, 2, 2, 3, xpadding=0, ypadding=0, yoptions=gtk.SHRINK) self.lab_filter.show() @@ -264,7 +264,7 @@ class GuiBulkImport(): self.cbfilter.show() # label - drop hudcache - self.lab_hdrop = gtk.Label("Drop HudCache:") + self.lab_hdrop = gtk.Label(_("Drop HudCache:")) self.table.attach(self.lab_hdrop, 3, 4, 2, 3, xpadding=0, ypadding=0, yoptions=gtk.SHRINK) self.lab_hdrop.show() @@ -273,18 +273,18 @@ class GuiBulkImport(): # ComboBox - drop hudcache self.cb_drophudcache = gtk.combo_box_new_text() - self.cb_drophudcache.append_text('auto') - self.cb_drophudcache.append_text("don't drop") - self.cb_drophudcache.append_text('drop') + self.cb_drophudcache.append_text(_('auto')) + self.cb_drophudcache.append_text(_("don't drop")) + self.cb_drophudcache.append_text(_('drop')) self.cb_drophudcache.set_active(0) self.table.attach(self.cb_drophudcache, 4, 5, 2, 3, xpadding=10, ypadding=0, yoptions=gtk.SHRINK) self.cb_drophudcache.show() # button - Import - self.load_button = gtk.Button('Import') # todo: rename variables to import too + self.load_button = gtk.Button(_('Import')) # todo: rename variables to import too self.load_button.connect('clicked', self.load_clicked, - 'Import clicked') + _('Import clicked')) self.table.attach(self.load_button, 2, 3, 4, 5, xpadding=0, ypadding=0, yoptions=gtk.SHRINK) self.load_button.show() @@ -302,7 +302,7 @@ class GuiBulkImport(): self.progressbar = gtk.ProgressBar() self.table.attach(self.progressbar, 3, 5, 4, 5, xpadding=0, ypadding=0, yoptions=gtk.SHRINK) - self.progressbar.set_text("Waiting...") + self.progressbar.set_text(_("Waiting...")) self.progressbar.set_fraction(0) self.progressbar.show() @@ -331,29 +331,29 @@ def main(argv=None): parser = OptionParser() parser.add_option("-f", "--file", dest="filename", metavar="FILE", default=None, - help="Input file in quiet mode") + help=_("Input file in quiet mode")) parser.add_option("-q", "--quiet", action="store_false", dest="gui", default=True, - help="don't start gui; deprecated (just give a filename with -f).") + help=_("don't start gui; deprecated (just give a filename with -f).")) parser.add_option("-c", "--convert", dest="filtername", default="PokerStars", metavar="FILTER", - help="Conversion filter (*Full Tilt Poker, PokerStars, Everleaf, Absolute)") + help=_("Conversion filter (*Full Tilt Poker, PokerStars, Everleaf, Absolute)")) parser.add_option("-x", "--failOnError", action="store_true", default=False, - help="If this option is passed it quits when it encounters any error") + help=_("If this option is passed it quits when it encounters any error")) parser.add_option("-m", "--minPrint", "--status", dest="minPrint", default="0", type="int", - help="How often to print a one-line status report (0 (default) means never)") + help=_("How often to print a one-line status report (0 (default) means never)")) parser.add_option("-u", "--usage", action="store_true", dest="usage", default=False, - help="Print some useful one liners") + help=_("Print some useful one liners")) parser.add_option("-s", "--starsarchive", action="store_true", dest="starsArchive", default=False, - help="Do the required conversion for Stars Archive format (ie. as provided by support") + help=_("Do the required conversion for Stars Archive format (ie. as provided by support")) (options, argv) = parser.parse_args(args = argv) if options.usage == True: #Print usage examples and exit - print "USAGE:" - print 'PokerStars converter: ./GuiBulkImport.py -c PokerStars -f filename' - print 'Full Tilt converter: ./GuiBulkImport.py -c "Full Tilt Poker" -f filename' - print "Everleaf converter: ./GuiBulkImport.py -c Everleaf -f filename" - print "Absolute converter: ./GuiBulkImport.py -c Absolute -f filename" - print "PartyPoker converter: ./GuiBulkImport.py -c PartyPoker -f filename" + print _("USAGE:") + print _('PokerStars converter: ./GuiBulkImport.py -c PokerStars -f filename') + print _('Full Tilt converter: ./GuiBulkImport.py -c "Full Tilt Poker" -f filename') + print _("Everleaf converter: ./GuiBulkImport.py -c Everleaf -f filename") + print _("Absolute converter: ./GuiBulkImport.py -c Absolute -f filename") + print _("PartyPoker converter: ./GuiBulkImport.py -c PartyPoker -f filename") sys.exit(0) config = Configuration.Config() @@ -369,7 +369,7 @@ def main(argv=None): settings.update(config.get_default_paths()) if not options.gui: - print '-q is deprecated. Just use "-f filename" instead' + print _('-q is deprecated. Just use "-f filename" instead') # This is because -q on its own causes an error, so -f is necessary and sufficient for cmd line use if not options.filename: i = GuiBulkImport(settings, config) @@ -382,7 +382,7 @@ def main(argv=None): #Do something useful importer = fpdb_import.Importer(False,settings, config) # importer.setDropIndexes("auto") - importer.setDropIndexes("don't drop") + importer.setDropIndexes(_("don't drop")) importer.setFailOnError(options.failOnError) importer.setThreads(-1) importer.addBulkImportImportFileOrDir(os.path.expanduser(options.filename), site=options.filtername) @@ -391,7 +391,7 @@ def main(argv=None): importer.setStarsArchive(True) (stored, dups, partial, errs, ttime) = importer.runImport() importer.clearFileList() - print 'GuiBulkImport done: Stored: %d \tDuplicates: %d \tPartial: %d \tErrors: %d in %s seconds - %.0f/sec'\ + print _('GuiBulkImport done: Stored: %d \tDuplicates: %d \tPartial: %d \tErrors: %d in %s seconds - %.0f/sec')\ % (stored, dups, partial, errs, ttime, (stored+0.0) / ttime) From 5bde812b857d86ed20252714ace21d73a9d4bdd3 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 05:32:09 +0200 Subject: [PATCH 15/20] gettext-ify HUD_main.pyw --- pyfpdb/HUD_main.pyw | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/pyfpdb/HUD_main.pyw b/pyfpdb/HUD_main.pyw index e42f0eb2..cc90a641 100755 --- a/pyfpdb/HUD_main.pyw +++ b/pyfpdb/HUD_main.pyw @@ -60,6 +60,9 @@ elif os.name == 'nt': #import Tables import Hud +import gettext +trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"]) +trans.install() # get config and set up logger c = Configuration.Config(file=options.config, dbname=options.dbname) @@ -71,22 +74,22 @@ class HUD_main(object): # This class mainly provides state for controlling the multiple HUDs. def __init__(self, db_name = 'fpdb'): - print "\nHUD_main: starting ..." + print _("\nHUD_main: starting ...") self.db_name = db_name self.config = c - print "Logfile is " + os.path.join(self.config.dir_log, 'HUD-log.txt') - log.info("HUD_main starting: using db name = %s" % (db_name)) + print _("Logfile is ") + os.path.join(self.config.dir_log, 'HUD-log.txt') + log.info(_("HUD_main starting: using db name = %s") % (db_name)) try: if not options.errorsToConsole: fileName = os.path.join(self.config.dir_log, 'HUD-errors.txt') - print "Note: error output is being diverted to:\n"+fileName \ - + "\nAny major error will be reported there _only_.\n" - log.info("Note: error output is being diverted to:"+fileName) - log.info("Any major error will be reported there _only_.") + print _("Note: error output is being diverted to:\n")+fileName \ + + _("\nAny major error will be reported there _only_.\n") + log.info(_("Note: error output is being diverted to:")+fileName) + log.info(_("Any major error will be reported there _only_.")) errorFile = open(fileName, 'w', 0) sys.stderr = errorFile - sys.stderr.write("HUD_main: starting ...\n") + sys.stderr.write(_("HUD_main: starting ...\n")) self.hud_dict = {} self.hud_params = self.config.get_hud_ui_parameters() @@ -99,10 +102,10 @@ class HUD_main(object): self.main_window = gtk.Window() self.main_window.connect("destroy", self.destroy) self.vb = gtk.VBox() - self.label = gtk.Label('Closing this window will exit from the HUD.') + self.label = gtk.Label(_('Closing this window will exit from the HUD.')) self.vb.add(self.label) self.main_window.add(self.vb) - self.main_window.set_title("HUD Main Window") + self.main_window.set_title(_("HUD Main Window")) self.main_window.show_all() except: log.error( "*** Exception in HUD_main.init() *** " ) @@ -111,7 +114,7 @@ class HUD_main(object): def destroy(self, *args): # call back for terminating the main eventloop - log.info("Terminating normally.") + log.info(_("Terminating normally.")) gtk.main_quit() def kill_hud(self, event, table): @@ -215,7 +218,7 @@ class HUD_main(object): t0 = time.time() t1 = t2 = t3 = t4 = t5 = t6 = t0 new_hand_id = string.rstrip(new_hand_id) - log.debug("Received hand no %s" % new_hand_id) + log.debug(_("Received hand no %s") % new_hand_id) if new_hand_id == "": # blank line means quit self.destroy() break # this thread is not always killed immediately with gtk.main_quit() @@ -234,12 +237,12 @@ class HUD_main(object): # get basic info about the new hand from the db # if there is a db error, complain, skip hand, and proceed - log.info("HUD_main.read_stdin: hand processing starting ...") + log.info(_("HUD_main.read_stdin: hand processing starting ...")) try: (table_name, max, poker_game, type, site_id, site_name, num_seats, tour_number, tab_number) = \ self.db_connection.get_table_info(new_hand_id) except Exception: - log.error("db error: skipping %s" % new_hand_id) + log.error(_("db error: skipping %s" % new_hand_id)) continue t1 = time.time() @@ -260,8 +263,8 @@ class HUD_main(object): try: self.hud_dict[temp_key].stat_dict = stat_dict except KeyError: # HUD instance has been killed off, key is stale - log.error('hud_dict[%s] was not found\n' % temp_key) - log.error('will not send hand\n') + log.error(_('hud_dict[%s] was not found\n') % temp_key) + log.error(_('will not send hand\n')) # Unlocks table, copied from end of function self.db_connection.connection.rollback() return @@ -295,8 +298,7 @@ class HUD_main(object): # If no client window is found on the screen, complain and continue if type == "tour": table_name = "%s %s" % (tour_number, tab_number) -# log.error("HUD create: table name "+table_name+" not found, skipping.\n") - log.error("HUD create: table name %s not found, skipping." % table_name) + log.error(_("HUD create: table name %s not found, skipping.") % table_name) else: tablewindow.max = max tablewindow.site = site_name @@ -304,10 +306,10 @@ class HUD_main(object): if hasattr(tablewindow, 'number'): self.create_HUD(new_hand_id, tablewindow, temp_key, max, poker_game, type, stat_dict, cards) else: - log.error('Table "%s" no longer exists\n' % table_name) + log.error(_('Table "%s" no longer exists\n') % table_name) t6 = time.time() - log.info("HUD_main.read_stdin: hand read in %4.3f seconds (%4.3f,%4.3f,%4.3f,%4.3f,%4.3f,%4.3f)" + log.info(_("HUD_main.read_stdin: hand read in %4.3f seconds (%4.3f,%4.3f,%4.3f,%4.3f,%4.3f,%4.3f)") % (t6-t0,t1-t0,t2-t0,t3-t0,t4-t0,t5-t0,t6-t0)) self.db_connection.connection.rollback() From 12104b3c52c906c2a079ee0c744f616f97d00b01 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 05:40:02 +0200 Subject: [PATCH 16/20] update .po file --- pyfpdb/locale/fpdb-en_GB.po | 420 ++++++++++++++++++++++++++++++++++-- 1 file changed, 399 insertions(+), 21 deletions(-) diff --git a/pyfpdb/locale/fpdb-en_GB.po b/pyfpdb/locale/fpdb-en_GB.po index d4c47fa4..0733cd6d 100644 --- a/pyfpdb/locale/fpdb-en_GB.po +++ b/pyfpdb/locale/fpdb-en_GB.po @@ -5,16 +5,393 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2010-08-13 04:10+CEST\n" +"POT-Creation-Date: 2010-08-13 05:34+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-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" "Generated-By: pygettext.py 1.5\n" +#: GuiAutoImport.py:73 +msgid "Time between imports in seconds:" +msgstr "" + +#: GuiAutoImport.py:104 GuiAutoImport.py:172 GuiAutoImport.py:249 +msgid " Start _Autoimport " +msgstr "" + +#: GuiAutoImport.py:123 +msgid "AutoImport Ready." +msgstr "" + +#: GuiAutoImport.py:136 +msgid "Please choose the path that you want to auto import" +msgstr "" + +#: GuiAutoImport.py:159 +msgid " _Auto Import Running " +msgstr "" + +#: GuiAutoImport.py:170 +msgid " Stop _Autoimport " +msgstr "" + +#: GuiAutoImport.py:195 +msgid "" +"\n" +"Global lock taken ... Auto Import Started.\n" +msgstr "" + +#: GuiAutoImport.py:197 +msgid " _Stop Autoimport " +msgstr "" + +#: GuiAutoImport.py:213 +msgid "opening pipe to HUD" +msgstr "" + +#: GuiAutoImport.py:225 +msgid "" +"\n" +"*** GuiAutoImport Error opening pipe: " +msgstr "" + +#: GuiAutoImport.py:237 +msgid "" +"\n" +"auto-import aborted - global lock not available" +msgstr "" + +#: GuiAutoImport.py:242 +msgid "" +"\n" +"Stopping autoimport - global lock released." +msgstr "" + +#: GuiAutoImport.py:244 +msgid "" +"\n" +" * Stop Autoimport: HUD already terminated" +msgstr "" + +#: GuiAutoImport.py:271 +msgid "Browse..." +msgstr "" + +#: GuiAutoImport.py:314 GuiBulkImport.py:342 +msgid "How often to print a one-line status report (0 (default) means never)" +msgstr "" + +#: GuiBulkImport.py:55 +msgid "" +"\n" +"Global lock taken ..." +msgstr "" + +#: GuiBulkImport.py:56 +msgid "Importing..." +msgstr "" + +#: GuiBulkImport.py:105 +msgid "GuiBulkImport.load done: Stored: %d \tDuplicates: %d \tPartial: %d \tErrors: %d in %s seconds - %.0f/sec" +msgstr "" + +#: GuiBulkImport.py:119 +msgid "Import Complete" +msgstr "" + +#: GuiBulkImport.py:127 +msgid "bulk-import aborted - global lock not available" +msgstr "" + +#: GuiBulkImport.py:153 +msgid "Print Start/Stop Info" +msgstr "" + +#: GuiBulkImport.py:160 +msgid "Hands/status print:" +msgstr "" + +#: GuiBulkImport.py:177 +msgid "Number of threads:" +msgstr "" + +#: GuiBulkImport.py:197 +msgid "Fail on error" +msgstr "" + +#: GuiBulkImport.py:202 +msgid "Hands/file:" +msgstr "" + +#: GuiBulkImport.py:217 +msgid "Drop indexes:" +msgstr "" + +#: GuiBulkImport.py:226 GuiBulkImport.py:276 +msgid "auto" +msgstr "" + +#: GuiBulkImport.py:227 GuiBulkImport.py:277 GuiBulkImport.py:385 +msgid "don't drop" +msgstr "" + +#: GuiBulkImport.py:228 GuiBulkImport.py:278 +msgid "drop" +msgstr "" + +#: GuiBulkImport.py:234 +msgid "HUD Test mode" +msgstr "" + +#: GuiBulkImport.py:239 +msgid "Site filter:" +msgstr "" + +#: GuiBulkImport.py:267 +msgid "Drop HudCache:" +msgstr "" + +#: GuiBulkImport.py:285 +msgid "Import" +msgstr "" + +#: GuiBulkImport.py:287 +msgid "Import clicked" +msgstr "" + +#: GuiBulkImport.py:305 +msgid "Waiting..." +msgstr "" + +#: GuiBulkImport.py:334 +msgid "Input file in quiet mode" +msgstr "" + +#: GuiBulkImport.py:336 +msgid "don't start gui; deprecated (just give a filename with -f)." +msgstr "" + +#: GuiBulkImport.py:338 +msgid "Conversion filter (*Full Tilt Poker, PokerStars, Everleaf, Absolute)" +msgstr "" + +#: GuiBulkImport.py:340 +msgid "If this option is passed it quits when it encounters any error" +msgstr "" + +#: GuiBulkImport.py:344 +msgid "Print some useful one liners" +msgstr "" + +#: GuiBulkImport.py:346 +msgid "Do the required conversion for Stars Archive format (ie. as provided by support" +msgstr "" + +#: GuiBulkImport.py:351 +msgid "USAGE:" +msgstr "" + +#: GuiBulkImport.py:352 +msgid "PokerStars converter: ./GuiBulkImport.py -c PokerStars -f filename" +msgstr "" + +#: GuiBulkImport.py:353 +msgid "Full Tilt converter: ./GuiBulkImport.py -c \"Full Tilt Poker\" -f filename" +msgstr "" + +#: GuiBulkImport.py:354 +msgid "Everleaf converter: ./GuiBulkImport.py -c Everleaf -f filename" +msgstr "" + +#: GuiBulkImport.py:355 +msgid "Absolute converter: ./GuiBulkImport.py -c Absolute -f filename" +msgstr "" + +#: GuiBulkImport.py:356 +msgid "PartyPoker converter: ./GuiBulkImport.py -c PartyPoker -f filename" +msgstr "" + +#: GuiBulkImport.py:372 +msgid "-q is deprecated. Just use \"-f filename\" instead" +msgstr "" + +#: GuiBulkImport.py:394 +msgid "GuiBulkImport done: Stored: %d \tDuplicates: %d \tPartial: %d \tErrors: %d in %s seconds - %.0f/sec" +msgstr "" + +#: GuiImapFetcher.py:37 +msgid "To cancel just close this tab." +msgstr "" + +#: GuiImapFetcher.py:40 +msgid "_Save" +msgstr "" + +#: GuiImapFetcher.py:44 +msgid "_Import All" +msgstr "" + +#: GuiImapFetcher.py:48 +msgid "If you change the config you must save before importing" +msgstr "" + +#: GuiImapFetcher.py:91 +msgid "Starting import. Please wait." +msgstr "" + +#: GuiImapFetcher.py:95 +msgid "Finished import without error." +msgstr "" + +#: GuiImapFetcher.py:98 +msgid "Login to mailserver failed: please check mailserver, username and password" +msgstr "" + +#: GuiImapFetcher.py:101 +msgid "Could not connect to mailserver: check mailserver and use SSL settings and internet connectivity" +msgstr "" + +#: GuiImapFetcher.py:111 +msgid "Fetch Type" +msgstr "" + +#: GuiImapFetcher.py:111 +msgid "Mail Folder" +msgstr "" + +#: GuiImapFetcher.py:111 +msgid "Mailserver" +msgstr "" + +#: GuiImapFetcher.py:111 +msgid "Password" +msgstr "" + +#: GuiImapFetcher.py:111 +msgid "Site" +msgstr "" + +#: GuiImapFetcher.py:111 +msgid "Use SSL" +msgstr "" + +#: GuiImapFetcher.py:111 +msgid "Username" +msgstr "" + +#: GuiImapFetcher.py:142 +msgid "Yes" +msgstr "" + +#: GuiImapFetcher.py:143 +msgid "No" +msgstr "" + +#: GuiTourneyPlayerStats.py:72 +msgid "_Refresh Stats" +msgstr "" + +#: GuiTourneyPlayerStats.py:240 +msgid "Stats page displayed in %4.2f seconds" +msgstr "" + +#: GuiTourneyPlayerStats.py:265 +msgid "No sites selected - defaulting to PokerStars" +msgstr "" + +#: GuiTourneyPlayerStats.py:268 +msgid "No player ids found" +msgstr "" + +#: GuiTourneyPlayerStats.py:454 +msgid "***sortCols error: " +msgstr "" + +#: HUD_main.pyw:77 +msgid "" +"\n" +"HUD_main: starting ..." +msgstr "" + +#: HUD_main.pyw:80 fpdb.pyw:868 +msgid "Logfile is " +msgstr "" + +#: HUD_main.pyw:81 +msgid "HUD_main starting: using db name = %s" +msgstr "" + +#: HUD_main.pyw:86 +msgid "" +"Note: error output is being diverted to:\n" +msgstr "" + +#: HUD_main.pyw:87 fpdb.pyw:1130 +msgid "" +"\n" +"Any major error will be reported there _only_.\n" +msgstr "" + +#: HUD_main.pyw:88 +msgid "Note: error output is being diverted to:" +msgstr "" + +#: HUD_main.pyw:89 +msgid "Any major error will be reported there _only_." +msgstr "" + +#: HUD_main.pyw:92 +msgid "" +"HUD_main: starting ...\n" +msgstr "" + +#: HUD_main.pyw:105 +msgid "Closing this window will exit from the HUD." +msgstr "" + +#: HUD_main.pyw:108 +msgid "HUD Main Window" +msgstr "" + +#: HUD_main.pyw:117 +msgid "Terminating normally." +msgstr "" + +#: HUD_main.pyw:221 +msgid "Received hand no %s" +msgstr "" + +#: HUD_main.pyw:240 +msgid "HUD_main.read_stdin: hand processing starting ..." +msgstr "" + +#: HUD_main.pyw:266 +msgid "" +"hud_dict[%s] was not found\n" +msgstr "" + +#: HUD_main.pyw:267 +msgid "" +"will not send hand\n" +msgstr "" + +#: HUD_main.pyw:301 +msgid "HUD create: table name %s not found, skipping." +msgstr "" + +#: HUD_main.pyw:309 +msgid "" +"Table \"%s\" no longer exists\n" +msgstr "" + +#: HUD_main.pyw:312 +msgid "HUD_main.read_stdin: hand read in %4.3f seconds (%4.3f,%4.3f,%4.3f,%4.3f,%4.3f,%4.3f)" +msgstr "" + #: Hand.py:1102 msgid "*** DEALING HANDS ***" msgstr "" @@ -63,6 +440,14 @@ msgstr "" msgid "*** RIVER ***" msgstr "" +#: ImapFetcher.py:46 +msgid "response to logging in:" +msgstr "" + +#: ImapFetcher.py:78 +msgid "completed running Imap import, closing server connection" +msgstr "" + #: fpdb.pyw:40 msgid "" " - press return to continue\n" @@ -448,10 +833,6 @@ msgstr "" msgid "CONFIG FILE ERROR" msgstr "" -#: fpdb.pyw:868 -msgid "Logfile is " -msgstr "" - #: fpdb.pyw:870 msgid "Config file" msgstr "" @@ -569,6 +950,9 @@ msgstr "" #: fpdb.pyw:1055 msgid "" +"Fpdb needs translators!\n" +"If you speak another language and have a few minutes or more to spare get in touch by emailing steffen@schaumburger.info\n" +"\n" "Welcome to Fpdb!\n" "To be notified of new snapshots and releases go to https://lists.sourceforge.net/lists/listinfo/fpdb-announce and subscribe.\n" "If you want to follow development more closely go to https://lists.sourceforge.net/lists/listinfo/fpdb-main and subscribe.\n" @@ -576,7 +960,7 @@ msgid "" "This program is currently in an alpha-state, so our database format is still sometimes changed.\n" "You should therefore always keep your hand history files so that you can re-import after an update, if necessary.\n" "\n" -"For documentation please visit our website at http://fpdb.sourceforge.net/.\n" +"For documentation please visit our website/wiki at http://fpdb.sourceforge.net/.\n" "If you need help click on Contact - Get Help on our website.\n" "Please note that default.conf is no longer needed nor used, all configuration now happens in HUD_config.xml.\n" "\n" @@ -585,46 +969,40 @@ msgid "" "You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt and mit.txt in the fpdb installation directory." msgstr "" -#: fpdb.pyw:1069 +#: fpdb.pyw:1072 msgid "Help" msgstr "" -#: fpdb.pyw:1076 +#: fpdb.pyw:1079 msgid "Graphs" msgstr "" -#: fpdb.pyw:1126 +#: fpdb.pyw:1129 msgid "" "\n" "Note: error output is being diverted to fpdb-errors.txt and HUD-errors.txt in:\n" msgstr "" -#: fpdb.pyw:1127 -msgid "" -"\n" -"Any major error will be reported there _only_.\n" -msgstr "" - -#: fpdb.pyw:1155 +#: fpdb.pyw:1158 msgid "fpdb starting ..." msgstr "" -#: fpdb.pyw:1204 +#: fpdb.pyw:1207 msgid "FPDB WARNING" msgstr "" -#: fpdb.pyw:1223 +#: fpdb.pyw:1226 msgid "" "WARNING: Unable to find output hh directory %s\n" "\n" " Press YES to create this directory, or NO to select a new one." msgstr "" -#: fpdb.pyw:1231 +#: fpdb.pyw:1234 msgid "WARNING: Unable to create hand output directory. Importing is not likely to work until this is fixed." msgstr "" -#: fpdb.pyw:1236 +#: fpdb.pyw:1239 msgid "Select HH Output Directory" msgstr "" From 0f9e35d1fce9c790035d3ae12eb12edb791b2a23 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 05:43:51 +0200 Subject: [PATCH 17/20] set charset in po file --- pyfpdb/locale/fpdb-en_GB.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/locale/fpdb-en_GB.po b/pyfpdb/locale/fpdb-en_GB.po index 0733cd6d..5ace954e 100644 --- a/pyfpdb/locale/fpdb-en_GB.po +++ b/pyfpdb/locale/fpdb-en_GB.po @@ -10,7 +10,7 @@ msgstr "" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" +"Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: ENCODING\n" "Generated-By: pygettext.py 1.5\n" From b1724437acd1afb4f0799d04f37741957c7d47bf Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 13 Aug 2010 06:03:15 +0200 Subject: [PATCH 18/20] gettext-ify Anonymise --- pyfpdb/Anonymise.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Anonymise.py b/pyfpdb/Anonymise.py index 6b7e7352..a4d72339 100755 --- a/pyfpdb/Anonymise.py +++ b/pyfpdb/Anonymise.py @@ -23,6 +23,10 @@ import HandHistoryConverter import Configuration import sys +import gettext +trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"]) +trans.install() + (options, argv) = Options.fpdb_options() config = Configuration.Config() @@ -40,13 +44,13 @@ if os.path.exists(options.infile): filecontents = in_fh.read() in_fh.close() else: - print "Could not find file %s" % options.infile + print _("Could not find file %s") % options.infile exit(1) m = hhc.re_PlayerInfo.finditer(filecontents) outfile = options.infile+".anon" -print "Output being written to", outfile +print _("Output being written to"), outfile savestdout = sys.stdout fsock = open(outfile,"w") From 75b28281263b279a3966d580f4c496234bab343e Mon Sep 17 00:00:00 2001 From: gimick Date: Fri, 13 Aug 2010 20:02:27 +0100 Subject: [PATCH 19/20] Regression test: add file with FTP short lived date-format change --- ...05 - No Limit Hold'em - dateformat change.txt | Bin 0 -> 2378 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pyfpdb/regression-test-files/cash/FTP/Flop/FT20100721 Flash - $0.02-$0.05 - No Limit Hold'em - dateformat change.txt diff --git a/pyfpdb/regression-test-files/cash/FTP/Flop/FT20100721 Flash - $0.02-$0.05 - No Limit Hold'em - dateformat change.txt b/pyfpdb/regression-test-files/cash/FTP/Flop/FT20100721 Flash - $0.02-$0.05 - No Limit Hold'em - dateformat change.txt new file mode 100644 index 0000000000000000000000000000000000000000..4386557b340ccd6fff8289cd09f9086596179615 GIT binary patch literal 2378 zcmbVNT~8B16ur+T{)b600gPgIyQQsfDxfidN=u9}K5VdP*+ku5|Q zBGNAOwkw*UYG$w!1C|nsu~vgBY7joatc)ToR1zN>L918{H}VKI;_XYqR6=_*;UD3kj$`&Rw20qr0TKv zRGt+l117MXYV9ndRqK6~zCxxc>XrbJw{ipBSjw1~L-*d3pW_wuScwc#5i4>ogFjZ3 zJSGp%5p#lbDrfjxGLU@m5ooeDg8p=+rH=Ar=)8}RM~-EYB5Fn>U|a?FHoy{kf3Ax> z{{-IeL-HLec!KH;aJILU+fz;3kF;zmaetRD>L)^;Kh&~cuQTY7;hEmmYvbQ9uZAzT ztap5=YM=PGL-bD36aGyT`^gL9*~2E9V?~*H8RR!XeK|EOLS#^``L42*qc)sqmLIGf z@ov)aqw`tl-<^VQW5+;ic?1uP%x7R5Ulw|Ejo(WbMZLatp3cEB_J^&f&*2+o8xbk` zfvl!?cA%ZUk(&nv{|1;DM_A%k5$w*Qi|gE30Pp!&$HmeAcnwJlUIP9DO{*j`NRQkt)wh zM(|ZmQBS{C&2K_|{?Q9Nj}w+Xm^!7pjwOPm3|K6g<+x!Pv CU}abU literal 0 HcmV?d00001 From 4a6075fb04cf4c7ad24baf2764bb88a93990ac73 Mon Sep 17 00:00:00 2001 From: gimick Date: Fri, 13 Aug 2010 20:03:41 +0100 Subject: [PATCH 20/20] Regression test: FTP post BB out of turn, fold and leave table --- ...2 - singlehand session postBB out of turn.txt | Bin 0 -> 2654 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pyfpdb/regression-test-files/cash/FTP/Flop/FT20100804 Venice (6 max) - $0.01-$0.02 - singlehand session postBB out of turn.txt diff --git a/pyfpdb/regression-test-files/cash/FTP/Flop/FT20100804 Venice (6 max) - $0.01-$0.02 - singlehand session postBB out of turn.txt b/pyfpdb/regression-test-files/cash/FTP/Flop/FT20100804 Venice (6 max) - $0.01-$0.02 - singlehand session postBB out of turn.txt new file mode 100644 index 0000000000000000000000000000000000000000..90c07bb881b431d0d637eed209ba55e12118ba6c GIT binary patch literal 2654 zcmbtW+iuf95S?cv{$VAMnj$W-leA6W3Qf2OT1ZnQRPo?AO{qwlDo(jbd^>Q?thZTv z?SzXgCu{G{?3p=dXZ-7DUv6ZI%g9hJ@xR3At<2@KoXY~^=aR?_V)zw{3cgZ(YRC@W&EVymY-98Y_kC%~W89HExgE#(+!6LR@*4It+(h#N zZ>BPqE%=+|t0L)O-!>5JW7Ngl9`IZ5v3hR8cN1v&+m^d>M^0d$sK-b#U*vnFh}B3V zN3x6c+oko~#mF^KB=Q|z7T9;aMJup~Jc}-HmG@`|7OmW(gIq<3p=`kn6j8Nvi#S-j z6Rhocc=m2%_G2XCYvevd&N7Ub@<|!ZlufG{a()T6$C#hX1ive8nRDMC-`S%_(wP~OI-ABfSvxC z1G}qL7|#m5KhTRBK8B`ySo2H{WFUu7qseEv?hyDAprqa{!eX>%@=kO73b;Q8xXJqj zcz8;(V3tv(ik(Wg^F{CFS)VnkAXRKrjnw5j3icttWlt{tKB7NHU2!oRIg^$~bf8{i z;0xojdsB5Qz0ku3=jg<9e@sj6a zE{j?j$|)3bv>{i_V7oGF|C1Fzdw+&@ATLqzdqBL7Ta#lY>RqrIa{Vu;BlMQ492fa2 z$FzyDQ*h`Mf36y}8Y)&e?rqQssID9QUtz>5Xiu-dXD7f&UCv-tt!mDGRV8KW&sJU5 zB~}O5r`Q2)M{sBC1iE>Hi}mFLR@(Q>&roftJ6qrA$DRfo#Sc6WaK_p5-3+@kZJ)w6 zL40HFAmORC%o>l?^?lZHW3y#zsOv0!Ae^HDbKjMhy6)@OVSZU`;&tV*t~*zEHv0a1 z)OGzl>~@>{4-nZGFtaG-rMmx*v3d+OZmC+FavOyR%3l)IUkB`;tW>PN%Us<>^*uyp LoQ}ySdGqhzcU_2R literal 0 HcmV?d00001