4588: FAQ-gramplet looks very strange when translated to Swedish.
svn: r16662
This commit is contained in:
parent
74ba4baca2
commit
a5e292e489
@ -400,24 +400,6 @@ class GuiGramplet(object):
|
|||||||
self.buffer.insert_at_cursor(text)
|
self.buffer.insert_at_cursor(text)
|
||||||
self.text_length += len(text)
|
self.text_length += len(text)
|
||||||
|
|
||||||
def len_text(self, text):
|
|
||||||
i = 0
|
|
||||||
r = 0
|
|
||||||
while i < len(text):
|
|
||||||
if ord(text[i]) > 126:
|
|
||||||
t = 0
|
|
||||||
while i < len(text) and ord(text[i]) > 126:
|
|
||||||
i += 1
|
|
||||||
t += 1
|
|
||||||
r += t/2
|
|
||||||
elif text[i] == "\\":
|
|
||||||
r += 1
|
|
||||||
i += 2
|
|
||||||
else:
|
|
||||||
r += 1
|
|
||||||
i += 1
|
|
||||||
return r
|
|
||||||
|
|
||||||
def render_text(self, text):
|
def render_text(self, text):
|
||||||
markup_pos = {"B": [], "I": [], "U": [], "A": [], "TT": []}
|
markup_pos = {"B": [], "I": [], "U": [], "A": [], "TT": []}
|
||||||
retval = ""
|
retval = ""
|
||||||
@ -451,11 +433,6 @@ class GuiGramplet(object):
|
|||||||
retval += text[i+1]
|
retval += text[i+1]
|
||||||
r += 1
|
r += 1
|
||||||
i += 2
|
i += 2
|
||||||
elif ord(text[i]) > 126:
|
|
||||||
while ord(text[i]) > 126:
|
|
||||||
retval += text[i]
|
|
||||||
i += 1
|
|
||||||
r += 1
|
|
||||||
else:
|
else:
|
||||||
retval += text[i]
|
retval += text[i]
|
||||||
r += 1
|
r += 1
|
||||||
|
Loading…
Reference in New Issue
Block a user