Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
677b6c4
feat: add i18n support for 5 languages (en, es, fr, de, zh)
RIVALHIDE Jan 14, 2026
fe4f64a
Merge branch 'main' into issue-93a
RIVALHIDE Jan 14, 2026
d43dc81
solve the issues of cortex automation test failures 3.11
RIVALHIDE Jan 14, 2026
f880f50
Fix all the code rabbit issues including nitpick comments too
RIVALHIDE Jan 14, 2026
49b0357
Merge branch 'main' into issue-93a
RIVALHIDE Jan 15, 2026
6efa9d9
Merge branch 'main' into issue-93a
RIVALHIDE Jan 15, 2026
17718aa
Merge branch 'main' into issue-93a
RIVALHIDE Jan 15, 2026
3eb7d8d
feat(i18n): add fcntl.flock for multi-process safety, single source o…
RIVALHIDE Jan 15, 2026
d9486a3
Solve the lint with ruff error
RIVALHIDE Jan 15, 2026
1272852
Merge branch 'main' into issue-93a
RIVALHIDE Jan 15, 2026
0c8bbb2
Merge branch 'main' into issue-93a
Anshgrover23 Jan 16, 2026
9df25a7
Address code rabbit comments
RIVALHIDE Jan 16, 2026
e758a88
Solve the latest issues
RIVALHIDE Jan 16, 2026
4f944ac
Fix remaining address code rabbit comments
RIVALHIDE Jan 16, 2026
ef8d947
Merge branch 'main' into issue-93a
Suyashd999 Jan 17, 2026
c56215b
i18n: add missing ui/docker/role sections and 42 keys to fr.yaml for …
RIVALHIDE Jan 17, 2026
61238dd
Address the code rabbit comment on Localizing sandbox command descrip…
RIVALHIDE Jan 17, 2026
2b49f02
Merge branch 'main' into issue-93a
RIVALHIDE Jan 17, 2026
09d72ce
Fix the issues for cortex automation test failure reason
RIVALHIDE Jan 17, 2026
d2e3a68
Address code rabbit comment
RIVALHIDE Jan 17, 2026
80606fb
Address rabbit comment
RIVALHIDE Jan 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,143 changes: 361 additions & 782 deletions cortex/cli.py

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions cortex/i18n/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
"""
Internationalization (i18n) module for Cortex Linux CLI.

Provides multi-language support with:
- Message translation with interpolation
- OS language auto-detection
- Language preference persistence
- Locale-aware date/time and number formatting

Usage:
from cortex.i18n import t, get_translator, set_language, get_language

# Simple translation
print(t("install.success"))

# Translation with variables
print(t("install.package_installed", package="docker", version="24.0.5"))

# Change language
set_language("es")

Supported languages:
- en: English (default)
- es: Spanish
- fr: French
- de: German
- zh: Chinese (Simplified)
"""

from cortex.i18n.config import LanguageConfig
from cortex.i18n.detector import detect_os_language
from cortex.i18n.formatter import LocaleFormatter
from cortex.i18n.translator import (
SUPPORTED_LANGUAGES,
get_language,
get_language_info,
get_supported_languages,
get_translator,
set_language,
t,
)

__all__ = [
# Core translation
"t",
"get_translator",
"set_language",
"get_language",
"get_language_info",
"get_supported_languages",
"SUPPORTED_LANGUAGES",
# Configuration
"LanguageConfig",
# Detection
"detect_os_language",
# Formatting
"LocaleFormatter",
]
Loading
Loading