diff --git a/pyfpdb/AbsoluteToFpdb.py b/pyfpdb/AbsoluteToFpdb.py index 7cef8c68..145a0971 100755 --- a/pyfpdb/AbsoluteToFpdb.py +++ b/pyfpdb/AbsoluteToFpdb.py @@ -23,6 +23,18 @@ import sys import logging 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 for converting Absolute HH format. class Absolute(HandHistoryConverter): @@ -42,7 +54,13 @@ class Absolute(HandHistoryConverter): #Seat 6 - FETS63 ($0.75 in chips) #Board [10s 5d Kh Qh 8c] - re_GameInfo = re.compile(ur"^Stage #(C?[0-9]+): (?PHoldem|HORSE)(?: \(1 on 1\)|)? ?(?PNo Limit|Pot Limit|Normal|)? ?(?P\$| €|)(?P[.0-9]+)/?(?:\$| €|)(?P[.0-9]+)?", re.MULTILINE) + re_GameInfo = re.compile(ur"""^Stage #(C?[0-9]+):\s+ + (?PHoldem|Seven\sCard\sHi\/L|HORSE) + (?:\s\(1\son\s1\)|)?\s+? + (?PNo Limit|Pot\sLimit|Normal|)?\s? + (?P\$|\s€|) + (?P[.0-9]+)/?(?:\$|\s€|)(?P[.0-9]+)? + """, re.MULTILINE|re.VERBOSE) re_HorseGameInfo = re.compile(ur"^Game Type: (?PLimit) (?PHoldem)", re.MULTILINE) # TODO: can set max seats via (1 on 1) to a known 2 .. re_HandInfo = re.compile(ur"^Stage #C?(?P[0-9]+): .*(?P\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d).*\n(Table: (?P.*) \(Real Money\))?", re.MULTILINE) @@ -50,12 +68,6 @@ class Absolute(HandHistoryConverter): re_Button = re.compile(ur"Seat #(?P
.+$)", re.MULTILINE) -# re_Button = re.compile(ur"^Seat (?P