Some renaming/cleanup in i18n tools.

This commit is contained in:
2013-03-19 08:33:24 +00:00
parent dc3ce6db6a
commit fbbbb90af3
7 changed files with 11 additions and 9 deletions

View File

@@ -30,7 +30,7 @@ import re
import sys import sys
# XXX Relative import does not work here when used from Blender... # XXX Relative import does not work here when used from Blender...
from bl_i18n_utils import settings as i18n_settings, utils from bl_i18n_utils import settings as settings_i18n, utils
import bpy import bpy
@@ -43,10 +43,10 @@ filter_message = ignore_reg.match
def init_spell_check(settings, lang="en_US"): def init_spell_check(settings, lang="en_US"):
try: try:
from bl_i18n_utils import spell_check_utils from bl_i18n_utils import utils_spell_check
return spell_check_utils.SpellChecker(settings, lang) return utils_spell_check.SpellChecker(settings, lang)
except Exception as e: except Exception as e:
print("Failed to import spell_check_utils ({})".format(str(e))) print("Failed to import utils_spell_check ({})".format(str(e)))
return None return None
@@ -901,7 +901,7 @@ def main():
help="Override (some) default settings. Either a JSon file name, or a JSon string.") help="Override (some) default settings. Either a JSon file name, or a JSon string.")
args = parser.parse_args() args = parser.parse_args()
settings = i18n_settings.I18nSettings() settings = settings_i18n.I18nSettings()
settings.from_json(args.settings) settings.from_json(args.settings)
if args.output: if args.output:

View File

@@ -441,13 +441,13 @@ INTERN_PY_SYS_PATHS = ""
# Custom override settings must be one dir above i18n tools itself! # Custom override settings must be one dir above i18n tools itself!
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
try: try:
from bl_i18n_override_settings import * from bl_i18n_settings_override import *
except ImportError: # If no i18n_override_settings available, its no error! except ImportError: # If no i18n_override_settings available, its no error!
pass pass
# Override with custom user settings, if available. # Override with custom user settings, if available.
try: try:
from user_settings import * from settings_user import *
except ImportError: # If no user_settings available, its no error! except ImportError: # If no user_settings available, its no error!
pass pass

View File

@@ -31,7 +31,9 @@ import sys
import tempfile import tempfile
#import time #import time
from bl_i18n_utils import settings, rtl_utils from bl_i18n_utils import (settings,
utils_rtl,
)
import bpy import bpy
@@ -402,7 +404,7 @@ class I18nMessages:
for k, m in self.msgs.items(): for k, m in self.msgs.items():
keys.append(k) keys.append(k)
trans.append(m.msgstr) trans.append(m.msgstr)
trans = rtl_utils.log2vis(trans, self.settings) trans = utils_rtl.log2vis(trans, self.settings)
for k, t in zip(keys, trans): for k, t in zip(keys, trans):
self.msgs[k].msgstr = t self.msgs[k].msgstr = t