diff options
author | László Németh <nemeth@numbertext.org> | 2012-12-26 10:55:45 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2012-12-26 10:55:45 +0100 |
commit | 8d7f13d24c4853c460c53dbcf1ad2f8d8dc2fd05 (patch) | |
tree | 3e5e12be53bd019c7c80d41bafe9a688ee57bbc1 /librelogo | |
parent | ed338bc212725f422f0def21aafc82f05e350646 (diff) |
librelogo fixes, ca/cs/et/pt_BR/ro lang. guessing for translation
Change-Id: Ia3f753a192a262fb8b86c8c0c654db3bcaf3863e
Diffstat (limited to 'librelogo')
-rw-r--r-- | librelogo/source/ChangeLog | 6 | ||||
-rw-r--r-- | librelogo/source/LibreLogo/LibreLogo.py | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/librelogo/source/ChangeLog b/librelogo/source/ChangeLog index 36c834563dcc..f5112b354735 100644 --- a/librelogo/source/ChangeLog +++ b/librelogo/source/ChangeLog @@ -1,3 +1,9 @@ +2012-12-26 László Németh: + * fix turtle position and rotation at repeated hideturtle/showturtle + * add new languages, fix Czech and Brazilian Portuguese for + language guessing at translation + * fix line break to paragraph break conversion at translation + 2012-12-17 László Németh: * handle possible translation problems (strip terminating bars) * keep double compilation of the commands diff --git a/librelogo/source/LibreLogo/LibreLogo.py b/librelogo/source/LibreLogo/LibreLogo.py index c89f92ea2c33..df5bdc054a83 100644 --- a/librelogo/source/LibreLogo/LibreLogo.py +++ b/librelogo/source/LibreLogo/LibreLogo.py @@ -25,7 +25,7 @@ else: __lngpath__ = unohelper.fileUrlToSystemPath(re.sub("program/(fundamental.ini|fundamentalrc)$", "", urebootstrap)) __lngpath__ = __lngpath__ + "share/Scripts/python/LibreLogo/".replace("/", os.sep) -__translang__ = "cz|de|dk|el|en|es|fr|hu|it|nl|no|pl|pt|ru|se|sl" # FIXME supported languages for language guessing, expand this list, according to the localizations +__translang__ = "ca|cs|de|dk|el|en|es|et|fr|hu|it|nl|no|pl|pt|ro|ru|se|sl" # FIXME supported languages for language guessing, expand this list, according to the localizations __lng__ = {} __docs__ = {} __prevcode__ = None @@ -303,7 +303,7 @@ def __translate__(arg = None): guess.enableLanguages(tuple([Locale(i, "", "") for i in __translang__.split("|")])) guess = guess.guessPrimaryLanguage(text, 0, len(text)) try: - l = {'cs': 'cs_CZ', 'el': 'el_GR', 'en': 'en_US'}[guess.Language] + l = {'cs': 'cs_CZ', 'el': 'el_GR', 'en': 'en_US', 'pt': 'pt_BR'}[guess.Language] except: l = guess.Language + '_' + guess.Language.upper() lang = __l12n__(l) @@ -344,7 +344,8 @@ def __translate__(arg = None): _.doc.getText().setString(text) # convert to paragraphs __dispatcher__(".uno:ExecuteSearch", (__getprop__("SearchItem.SearchString", r"\n"), __getprop__("SearchItem.ReplaceString", r"\n"), \ - __getprop__("Quiet", True), __getprop__("SearchItem.Command", 3), __getprop__("SearchItem.StyleFamily", 2))) + __getprop__("Quiet", True), __getprop__("SearchItem.Command", 3), __getprop__("SearchItem.StyleFamily", 2), \ + __getprop__("SearchItem.AlgorithmType", 1), __getprop__("SearchItem.RowDirection", 1), __getprop__("SearchItem.SearchFlags", 65536))) class LogoProgram(threading.Thread): def __init__(self, code): @@ -482,6 +483,7 @@ def hideturtle(): turtle = __getshape__(__TURTLE__) if turtle: z = turtle.getPosition() + z = __Point__(z.X + turtle.BoundRect.Width / 2.0, z.Y + turtle.BoundRect.Height / 2.0) turtle.PolyPolygon = __TURTLESHAPE__[1] __visible__(turtle, False) turtle.LineTransparence, turtle.FillTransparence = 100, 100 # for saved files @@ -494,7 +496,9 @@ def showturtle(): if not turtle.Parent: _.drawpage.add(turtle) z = turtle.getPosition() - turtle.PolyPolygon = __TURTLESHAPE__[0] + r, turtle.RotateAngle = turtle.RotateAngle, 0 + turtle.PolyPolygon, turtle.RotateAngle = __TURTLESHAPE__[0], r + z = __Point__(z.X - turtle.BoundRect.Width / 2.0, z.Y - turtle.BoundRect.Height / 2.0) turtle.setPosition(z) pencolor(_.pencolor) fillcolor(_.areacolor) |