Skip to content

Latest commit

 

History

History
78 lines (42 loc) · 3.64 KB

File metadata and controls

78 lines (42 loc) · 3.64 KB
graph LR
    activate["activate"]
    get_translation["get_translation"]
    _gettext["_gettext"]
    _pgettext["_pgettext"]
    _ngettext["_ngettext"]
    _get_default_locale_path["_get_default_locale_path"]
    get_translation -- "depends on" --> activate
    get_translation -- "depends on" --> _get_default_locale_path
    _gettext -- "calls" --> get_translation
    _pgettext -- "calls" --> get_translation
    _ngettext -- "calls" --> get_translation
Loading

CodeBoardingDemoContact

Details

The Internationalization (I18n) Module subsystem is encapsulated within the src/humanize/i18n.py file. This module is responsible for all core localization and translation services, including managing active locales and retrieving translated strings based on the current language settings.

activate

Manages the active locale for the application, determining and loading the appropriate translation environment. This function is crucial for setting up the correct language context for all subsequent translation operations.

Related Classes/Methods:

get_translation

Provides the active translation object, acting as a central point for accessing loaded translations. This component serves as the primary interface for other translation functions to retrieve the necessary translation context.

Related Classes/Methods:

_gettext

Retrieves the singular form of a translated string based on the current locale. This is a fundamental translation utility for simple string localization.

Related Classes/Methods:

_pgettext

Retrieves a contextualized singular form of a translated string. This component handles cases where the same string might have different translations depending on its context, providing more precise localization.

Related Classes/Methods:

_ngettext

Retrieves the plural form of a translated string based on a given count and the locale's pluralization rules. This is essential for correctly handling grammatical number variations in different languages.

Related Classes/Methods:

_get_default_locale_path

Determines the default locale path for translation sources. This utility function ensures that the translation system can locate the necessary .mo or .po files.

Related Classes/Methods: