summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util/txc
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2013-12-13 00:45:46 +0100
committerRaphael Langella <raphael.langella@gmail.com>2013-12-13 00:57:13 +0100
commit44b79fed5a995d59e2d140dd63a65d9630124261 (patch)
tree1b05db4c17d7094a5c05ffe7dd2d7b6f3cc2b627 /crawl-ref/source/util/txc
parentc22c6b513ee142c9d43c0880bc6d53cb34df078e (diff)
downloadcrawl-ref-44b79fed5a995d59e2d140dd63a65d9630124261.tar.gz
crawl-ref-44b79fed5a995d59e2d140dd63a65d9630124261.zip
[txc] Don't break danish quotes when autofixing french ones.
Diffstat (limited to 'crawl-ref/source/util/txc')
-rwxr-xr-xcrawl-ref/source/util/txc14
1 files changed, 8 insertions, 6 deletions
diff --git a/crawl-ref/source/util/txc b/crawl-ref/source/util/txc
index d50815760d..907fed3a13 100755
--- a/crawl-ref/source/util/txc
+++ b/crawl-ref/source/util/txc
@@ -187,13 +187,14 @@ def wrap(text, eac, no_space):
if eac or no_space:
fixed_lines = []
for line in lines:
- if line and line[0] in east_asian_punctuation and fixed_lines:
+ while line and line[0] in east_asian_punctuation and fixed_lines:
fixed_lines[-1] += line[0]
- if len(line) > 1:
- fixed_lines.append(line[1:])
- else:
- fixed_lines.append(line)
+ line = line[1:]
+ if not line: break
+
+ fixed_lines.append(line)
lines = fixed_lines
+
return "\n".join(lines)
def diff(val, new_val):
@@ -232,7 +233,8 @@ def auto_fix(s, lang):
"""Use with care, it can break things"""
s = auto_fix.re_hyphen.sub(u"\\1—\\2", s)
s = auto_fix.re_ns.sub(u" \\1", s)
- s = auto_fix.re_ns2.sub(u"« ", s)
+ if lang == 'fr': # This one can break languages which use »« for quotes
+ s = auto_fix.re_ns2.sub(u"« ", s)
if s.find('{{') == -1: # Don't mess with lua strings
s = auto_fix.re_ascii_single_quotes.sub(u"‘\\1’", s)