Added handling of system locale
This commit is contained in:
+7
-11
@@ -26,7 +26,7 @@ Configuration lives in `pyproject.toml` (`[tool.pytest.ini_options]`):
|
||||
| `conftest.py` | Fixtures: `env`, `installed`, `manager`, `log_warnings`, singleton reset |
|
||||
| `support.py` | Example data (`EN`, `DE`, dialog keys) and the `Env` helper class |
|
||||
| `test_normalize.py` | Language ID normalization, fallback chains |
|
||||
| `test_paths.py` | `ki18n.paths` (PyInstaller / source checkout, per-user data directories) |
|
||||
| `test_paths.py` | `ki18n.paths`: frozen detection, `bundle_root()` independent of where ki18n lives |
|
||||
| `test_construction.py` | Constructor, singleton, `project_root`/`local_root`, data directories |
|
||||
| `test_discovery.py` | `get_available_languages()`, user and installed resources |
|
||||
| `test_loading.py` | Validation and merging of `strings.json`, regional layers |
|
||||
@@ -34,8 +34,9 @@ Configuration lives in `pyproject.toml` (`[tool.pytest.ini_options]`):
|
||||
| `test_translate.py` | `t()`: fallback order, formatting |
|
||||
| `test_plural.py` | `p()`: categories, `#count`/`{count}`, fallbacks |
|
||||
| `test_help.py` | `get_help()`: regions, user files, English fallback |
|
||||
| `test_locale.py` | `Ki18n.get_locale()`: POSIX environment, macOS `defaults`, Windows API (all simulated on any host) |
|
||||
| `test_lazy_handle.py` | Module handle `i18n`, alias names |
|
||||
| `test_public_api.py` | Public API as documented in the README |
|
||||
| `test_public_api.py` | Public API as documented in the README (package-level exports) |
|
||||
| `test_shipped_resources.py` | Consistency of the shipped `i18n/` files |
|
||||
| `test_screens.py` | `HelpScreen` / `LanguageSelectScreen` driven with `Pilot`, plus a small integration app |
|
||||
|
||||
@@ -49,12 +50,7 @@ Configuration lives in `pyproject.toml` (`[tool.pytest.ini_options]`):
|
||||
|
||||
## Known deviations between documentation and code
|
||||
|
||||
Cases that describe documented behavior the code does not currently fulfil are
|
||||
marked `xfail(strict=True)`. They are reported as `xfailed` now and turn into
|
||||
failures (`XPASS(strict)`) once the code is fixed - remove the marker then.
|
||||
|
||||
- `test_public_api.py::test_package_exports_documented_names` -
|
||||
`from ki18n import Ki18n, i18n, I18n`: `__init__.py` is empty.
|
||||
- `test_translate.py::test_other_formatting_errors_return_unformatted_text` -
|
||||
`_format()` only catches `KeyError`, `IndexError` and `ValueError`, so
|
||||
`{name.attr}` / `{name[x]}` raise `AttributeError` / `TypeError`.
|
||||
None at the moment. If a test is added for documented behavior that the code
|
||||
does not fulfil yet, mark it `xfail(strict=True)`: it is reported as `xfailed`
|
||||
until the code is fixed and then turns into a failure (`XPASS(strict)`), which
|
||||
is the signal to remove the marker.
|
||||
|
||||
Reference in New Issue
Block a user