fixed some typos, thanks Jonathan
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.00.0 (2012-08-27 12:02:48) dev
|
Version 2.00.0 (2012-08-27 12:15:26) dev
|
||||||
|
|||||||
+16
-13
@@ -20,7 +20,7 @@ import marshal
|
|||||||
import copy_reg
|
import copy_reg
|
||||||
from fileutils import abspath, listdir
|
from fileutils import abspath, listdir
|
||||||
import settings
|
import settings
|
||||||
from cfs import getcfs, cfs
|
from cfs import getcfs
|
||||||
from thread import allocate_lock
|
from thread import allocate_lock
|
||||||
from html import XML, xmlescape
|
from html import XML, xmlescape
|
||||||
from contrib.markmin.markmin2html import render, markmin_escape
|
from contrib.markmin.markmin2html import render, markmin_escape
|
||||||
@@ -542,7 +542,7 @@ class translator(object):
|
|||||||
langfile_mtime ) }
|
langfile_mtime ) }
|
||||||
"""
|
"""
|
||||||
info = read_possible_languages(self.folder)
|
info = read_possible_languages(self.folder)
|
||||||
if lang: info = ingo.get(lang)
|
if lang: info = info.get(lang)
|
||||||
return info
|
return info
|
||||||
|
|
||||||
def force(self, *languages):
|
def force(self, *languages):
|
||||||
@@ -677,17 +677,20 @@ class translator(object):
|
|||||||
"""
|
"""
|
||||||
key = prefix+message
|
key = prefix+message
|
||||||
mt = self.t.get(key, None)
|
mt = self.t.get(key, None)
|
||||||
if mt is not None:
|
if mt is None:
|
||||||
return mt
|
# we did not find a translation
|
||||||
if not message.startswith('##') and not '\n' in message:
|
if message.find('##')>0 and not '\n' in message:
|
||||||
tokens = message.rsplit('##', 1)
|
# remove comments
|
||||||
else:
|
message = message.rsplit('##', 1)[0]
|
||||||
# this allows markmin syntax in translations
|
# guess translation same as original
|
||||||
tokens = [message]
|
self.t[key] = mt = message
|
||||||
self.t[key] = mt = key
|
# update language file for later translation
|
||||||
if self.language_file and not is_gae:
|
if self.language_file and not is_gae:
|
||||||
write_dict(self.language_file, self.t)
|
write_dict(self.language_file, self.t)
|
||||||
return regex_backslash.sub(lambda m: m.group(1).translate(ttab_in), mt)
|
# fix backslash escaping
|
||||||
|
mt = regex_backslash.sub(
|
||||||
|
lambda m: m.group(1).translate(ttab_in), mt)
|
||||||
|
return mt
|
||||||
|
|
||||||
def params_substitution(self, message, symbols):
|
def params_substitution(self, message, symbols):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user