L10n: Remaining files

This commit is contained in:
Worros 2010-09-23 14:31:16 +08:00
parent dee17e8001
commit 235a8baa5f
15 changed files with 44 additions and 156 deletions

View File

@ -18,6 +18,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
######################################################################## ########################################################################
import L10n
_ = L10n.get_translation()
import sys import sys
import exceptions import exceptions
@ -30,18 +33,6 @@ import Configuration
from HandHistoryConverter import * from HandHistoryConverter import *
from decimal import Decimal from decimal import Decimal
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# OnGame HH Format # OnGame HH Format
class OnGame(HandHistoryConverter): class OnGame(HandHistoryConverter):

View File

@ -15,22 +15,13 @@
#along with this program. If not, see <http://www.gnu.org/licenses/>. #along with this program. If not, see <http://www.gnu.org/licenses/>.
#In the "official" distribution you can find the license in agpl-3.0.txt. #In the "official" distribution you can find the license in agpl-3.0.txt.
import L10n
_ = L10n.get_translation()
import sys import sys
from optparse import OptionParser from optparse import OptionParser
# http://docs.python.org/library/optparse.html # http://docs.python.org/library/optparse.html
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
def fpdb_options(): def fpdb_options():
"""Process command line options for fpdb and HUD_main.""" """Process command line options for fpdb and HUD_main."""

View File

@ -18,21 +18,12 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
######################################################################## ########################################################################
import L10n
_ = L10n.get_translation()
import sys import sys
from collections import defaultdict from collections import defaultdict
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
from Exceptions import FpdbParseError from Exceptions import FpdbParseError
from HandHistoryConverter import * from HandHistoryConverter import *

View File

@ -18,22 +18,12 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
######################################################################## ########################################################################
import L10n
_ = L10n.get_translation()
import sys import sys
from HandHistoryConverter import * from HandHistoryConverter import *
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
class Pkr(HandHistoryConverter): class Pkr(HandHistoryConverter):

View File

@ -17,6 +17,9 @@
"""pokerstars-specific summary parsing code""" """pokerstars-specific summary parsing code"""
import L10n
_ = L10n.get_translation()
from decimal import Decimal from decimal import Decimal
import datetime import datetime
@ -25,18 +28,6 @@ from HandHistoryConverter import *
import PokerStarsToFpdb import PokerStarsToFpdb
from TourneySummary import * from TourneySummary import *
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
class PokerStarsSummary(TourneySummary): class PokerStarsSummary(TourneySummary):
limits = { 'No Limit':'nl', 'Pot Limit':'pl', 'Limit':'fl', 'LIMIT':'fl' } limits = { 'No Limit':'nl', 'Pot Limit':'pl', 'Limit':'fl', 'LIMIT':'fl' }
games = { # base, category games = { # base, category

View File

@ -18,24 +18,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
######################################################################## ########################################################################
import L10n
_ = L10n.get_translation()
# TODO: straighten out discards for draw games # TODO: straighten out discards for draw games
import sys import sys
from HandHistoryConverter import * from HandHistoryConverter import *
from decimal import Decimal from decimal import Decimal
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# PokerStars HH Format # PokerStars HH Format
class PokerStars(HandHistoryConverter): class PokerStars(HandHistoryConverter):

View File

@ -47,6 +47,9 @@
# other stuff. # other stuff.
# 6 For each stat you make add a line to the __main__ function to test it. # 6 For each stat you make add a line to the __main__ function to test it.
import L10n
_ = L10n.get_translation()
# Standard Library modules # Standard Library modules
import sys import sys
@ -55,18 +58,6 @@ import pygtk
import gtk import gtk
import re import re
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# FreePokerTools modules # FreePokerTools modules
import Configuration import Configuration
import Database import Database

View File

@ -22,6 +22,9 @@ Main program module to test/demo the Tables subclasses.
######################################################################## ########################################################################
import L10n
_ = L10n.get_translation()
# Standard Library modules # Standard Library modules
import sys import sys
import os import os
@ -33,18 +36,6 @@ import gobject
# fpdb/free poker tools modules # fpdb/free poker tools modules
import Configuration import Configuration
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# get the correct module for the current os # get the correct module for the current os
if os.name == 'posix': if os.name == 'posix':
import XTables as Tables import XTables as Tables

View File

@ -21,6 +21,9 @@
######################################################################## ########################################################################
import L10n
_ = L10n.get_translation()
# to do allow window resizing # to do allow window resizing
# to do hud to echo, but ignore non numbers # to do hud to echo, but ignore non numbers
# to do no stat window for hero # to do no stat window for hero
@ -34,18 +37,6 @@ import traceback
(options, argv) = Options.fpdb_options() (options, argv) = Options.fpdb_options()
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
if not options.errorsToConsole: if not options.errorsToConsole:
print _("Note: error output is being diverted to fpdb-error-log.txt and HUD-error.txt. Any major error will be reported there _only_.") print _("Note: error output is being diverted to fpdb-error-log.txt and HUD-error.txt. Any major error will be reported there _only_.")
errorFile = open('tourneyerror.txt', 'w', 0) errorFile = open('tourneyerror.txt', 'w', 0)

View File

@ -15,6 +15,9 @@
#along with this program. If not, see <http://www.gnu.org/licenses/>. #along with this program. If not, see <http://www.gnu.org/licenses/>.
#In the "official" distribution you can find the license in agpl-3.0.txt. #In the "official" distribution you can find the license in agpl-3.0.txt.
import L10n
_ = L10n.get_translation()
import threading import threading
import pygtk import pygtk
pygtk.require('2.0') pygtk.require('2.0')
@ -29,18 +32,6 @@ from time import gmtime, mktime, strftime, strptime
import logging #logging has been set up in fpdb.py or HUD_main.py, use their settings: import logging #logging has been set up in fpdb.py or HUD_main.py, use their settings:
log = logging.getLogger("filter") log = logging.getLogger("filter")
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
#import Configuration #import Configuration
#import Database #import Database
#import SQL #import SQL

View File

@ -17,6 +17,9 @@
"""parses and stores summary sections from e.g. eMail or summary files""" """parses and stores summary sections from e.g. eMail or summary files"""
import L10n
_ = L10n.get_translation()
# TODO: check to keep only the needed modules # TODO: check to keep only the needed modules
import re import re
@ -31,18 +34,6 @@ import time,datetime
from copy import deepcopy from copy import deepcopy
from Exceptions import * from Exceptions import *
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
import pprint import pprint
import DerivedStats import DerivedStats
import Card import Card

View File

@ -18,6 +18,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
######################################################################## ########################################################################
import L10n
_ = L10n.get_translation()
import sys import sys
from HandHistoryConverter import * from HandHistoryConverter import *

View File

@ -18,22 +18,13 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
######################################################################## ########################################################################
import L10n
_ = L10n.get_translation()
import sys import sys
import datetime import datetime
from HandHistoryConverter import * from HandHistoryConverter import *
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# Win2day HH Format # Win2day HH Format
class Win2day(HandHistoryConverter): class Win2day(HandHistoryConverter):

View File

@ -20,6 +20,9 @@
######################################################################## ########################################################################
import L10n
_ = L10n.get_translation()
# Standard Library modules # Standard Library modules
import re import re
@ -38,18 +41,6 @@ import win32api
import win32con import win32con
import win32security import win32security
import locale
lang=locale.getdefaultlocale()[0][0:2]
if lang=="en":
def _(string): return string
else:
import gettext
try:
trans = gettext.translation("fpdb", localedir="locale", languages=[lang])
trans.install()
except IOError:
def _(string): return string
# FreePokerTools modules # FreePokerTools modules
from TableWindow import Table_Window from TableWindow import Table_Window

View File

@ -20,6 +20,9 @@
######################################################################## ########################################################################
import L10n
_ = L10n.get_translation()
# Standard Library modules # Standard Library modules
import re import re
import os import os