Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/modules/bl_i18n_utils/settings.py')
-rw-r--r--release/scripts/modules/bl_i18n_utils/settings.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/settings.py b/release/scripts/modules/bl_i18n_utils/settings.py
index e304ef5ea17..cfa4fcac17f 100644
--- a/release/scripts/modules/bl_i18n_utils/settings.py
+++ b/release/scripts/modules/bl_i18n_utils/settings.py
@@ -30,7 +30,11 @@ import os
import sys
import types
-import bpy
+try:
+ import bpy
+except ModuleNotFoundError:
+ print("Could not import bpy, some features are not available when not run from Blender.")
+ bpy = None
###############################################################################
# MISC
@@ -98,8 +102,10 @@ LANGUAGES = (
(47, "Slovak (SlovenĨina)", "sk_SK"),
)
-# Default context, in py!
-DEFAULT_CONTEXT = bpy.app.translations.contexts.default
+# Default context, in py (keep in sync with `BLT_translation.h`)!
+if bpy is not None:
+ assert(bpy.app.translations.contexts.default == "*")
+DEFAULT_CONTEXT = "*"
# Name of language file used by Blender to generate translations' menu.
LANGUAGES_FILE = "languages"