Skip to content

Commit 09a2feb

Browse files
committed
fix(cli): hoist i18n imports to global scope to prevent UnboundLocalError
1 parent 097928f commit 09a2feb

2 files changed

Lines changed: 3723 additions & 40 deletions

File tree

src/omnipkg/cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from omnipkg.common_utils import safe_print
44

5+
from omnipkg.i18n import _, SUPPORTED_LANGUAGES
56
"""omnipkg CLI - Enhanced with runtime interpreter switching and language support"""
67
try:
78
from .common_utils import safe_print
@@ -33,7 +34,6 @@
3334
from .common_utils import print_header
3435
from .core import ConfigManager
3536
from .core import omnipkg as OmnipkgCore
36-
from omnipkg.i18n import _, SUPPORTED_LANGUAGES
3737

3838
project_root = Path(__file__).resolve().parent.parent
3939
TESTS_DIR = Path(__file__).parent.parent / "tests"
@@ -935,7 +935,6 @@ def main():
935935
import importlib
936936
from omnipkg import i18n
937937
importlib.reload(i18n)
938-
from omnipkg.i18n import _
939938

940939
_.set_language(user_lang)
941940
os.environ["OMNIPKG_LANG"] = user_lang

0 commit comments

Comments
 (0)