USe the system locale if the parameter default_language is not set while instanciating Ki18n
This commit is contained in:
@@ -20,6 +20,15 @@ ki18n_module = importlib.import_module("ki18n.ki18n")
|
||||
|
||||
ENV_VARS = ("LC_ALL", "LC_MESSAGES", "LANG", "LANGUAGE")
|
||||
|
||||
# conftest.py replaces ``Ki18n.get_locale`` for all tests; this module tests the
|
||||
# real implementation, so it is captured at import time and restored per test.
|
||||
_REAL_GET_LOCALE = Ki18n.__dict__["get_locale"]
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _real_system_locale(monkeypatch):
|
||||
monkeypatch.setattr(Ki18n, "get_locale", _REAL_GET_LOCALE)
|
||||
|
||||
|
||||
def set_env(monkeypatch, **variables):
|
||||
for name, value in variables.items():
|
||||
|
||||
Reference in New Issue
Block a user