Some renaming/cleanup in i18n tools.
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
@@ -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, it’s no error!
|
except ImportError: # If no i18n_override_settings available, it’s 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, it’s no error!
|
except ImportError: # If no user_settings available, it’s no error!
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user