From 680f735007ab307c53860e6e5904068afa00ac44 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sun, 15 Aug 2010 07:38:44 +0200 Subject: [PATCH] gettextify some small files --- pyfpdb/Tables_Demo.py | 10 +++++++--- pyfpdb/WinTables.py | 4 ++-- pyfpdb/test_Database.py | 4 ++-- pyfpdb/windows_make_bats.py | 8 ++++++-- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/pyfpdb/Tables_Demo.py b/pyfpdb/Tables_Demo.py index 6659c630..33a586aa 100755 --- a/pyfpdb/Tables_Demo.py +++ b/pyfpdb/Tables_Demo.py @@ -36,6 +36,10 @@ import gobject import Configuration from HandHistoryConverter import getTableTitleRe +import gettext +trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"]) +trans.install() + # get the correct module for the current os if os.name == 'posix': import XTables as Tables @@ -57,7 +61,7 @@ if __name__=="__main__": self.main_window.connect("destroy", self.client_destroyed) self.label = gtk.Label('Fake Fake Fake Fake\nFake\nFake\nFake') self.main_window.add(self.label) - self.main_window.set_title("Fake HUD Main Window") + self.main_window.set_title(_("Fake HUD Main Window")) self.main_window.move(table.x + dx, table.y + dy) self.main_window.show_all() table.topify(self) @@ -80,7 +84,7 @@ if __name__=="__main__": hud.main_window.emit(result, hud) return True - print "enter table name to find: ", + print _("enter table name to find: "), table_name = sys.stdin.readline() if "," in table_name: # tournament print "tournament" @@ -105,6 +109,6 @@ if __name__=="__main__": fake = fake_hud(table) print "fake =", fake # gobject.timeout_add(100, check_on_table, table, fake) - print "calling main" + print _("calling main") gtk.main() diff --git a/pyfpdb/WinTables.py b/pyfpdb/WinTables.py index 8d90eb5b..6c68cd98 100644 --- a/pyfpdb/WinTables.py +++ b/pyfpdb/WinTables.py @@ -67,10 +67,10 @@ class Table(Table_Window): try: if self.window == None: - log.error( "Window %s not found. Skipping." % search_string ) + log.error(_("Window %s not found. Skipping.") % search_string ) return None except AttributeError: - log.error( "self.window doesn't exist? why?" ) + log.error(_("self.window doesn't exist? why?")) return None (x, y, width, height) = win32gui.GetWindowRect(hwnd) diff --git a/pyfpdb/test_Database.py b/pyfpdb/test_Database.py index 54b44e36..b415b7dc 100644 --- a/pyfpdb/test_Database.py +++ b/pyfpdb/test_Database.py @@ -47,8 +47,8 @@ def testSQLiteVarianceFunction(): cur.execute("SELECT variance(i) from test") result = cur.fetchone()[0] - print "DEBUG: Testing variance function" - print "DEBUG: result: %s expecting: 0.666666 (result-expecting ~= 0.0): %s" % (result, (result - 0.66666)) + print _("DEBUG: Testing variance function") + print _("DEBUG: result: %s expecting: 0.666666 (result-expecting ~= 0.0): %s") % (result, (result - 0.66666)) cur.execute("DROP TABLE test") assert (result - 0.66666) <= 0.0001 diff --git a/pyfpdb/windows_make_bats.py b/pyfpdb/windows_make_bats.py index 2ea3e06c..976040c1 100755 --- a/pyfpdb/windows_make_bats.py +++ b/pyfpdb/windows_make_bats.py @@ -17,6 +17,10 @@ # create .bat scripts in windows to try out different gtk dirs +import gettext +trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"]) +trans.install() + try: import os @@ -24,7 +28,7 @@ try: import re if os.name != 'nt': - print "\nThis script is only for windows\n" + print _("\nThis script is only for windows\n") exit() dirs = re.split(os.pathsep, os.environ['PATH']) @@ -51,7 +55,7 @@ try: bat.close() i = i + 1 else: - print "\nno gtk directories found in your path - install gtk or edit the path manually\n" + print _("\nno gtk directories found in your path - install gtk or edit the path manually\n") except SystemExit: pass