mkv2cast.i18n
Internationalization (i18n) support for mkv2cast.
Uses Python’s gettext module for translations. Supports: English (en), French (fr), Spanish (es), Italian (it), German (de)
Functions
Detect the system language from environment. |
|
Get the currently configured language code. |
|
Get the locales directory path. |
|
|
Translate a message with singular/plural forms. |
|
Configure internationalization and return the translation function. |
- mkv2cast.i18n.detect_system_language() str[source]
Detect the system language from environment. Returns language code (e.g., ‘fr’, ‘en’, ‘es’).
- mkv2cast.i18n.setup_i18n(lang: str | None = None) Callable[[str], str][source]
Configure internationalization and return the translation function.
- Parameters:
lang – Language code (e.g., ‘fr’, ‘en’). If None, auto-detect from system.
- Returns:
Translation function that takes a string and returns translated string.
- mkv2cast.i18n.ngettext(singular: str, plural: str, n: int) str[source]
Translate a message with singular/plural forms.
- Parameters:
singular – Singular form of the message.
plural – Plural form of the message.
n – Count to determine which form to use.
- Returns:
Appropriate translated form based on count.