TedZddlZddlZddlmZgdZdejiZ eZ ddiZ dZ dZ dd Zd Zd Zd Zd ZdZdZdefdZdS)z*Activate, get and deactivate translations.N)local)activate deactivategettextngettextthousands_separatorfr_FR c tdStjtjtdS#t $rYdSwxYw)Nlocale)__file__ospathjoindirname NameErrorm/builddir/build/BUILD/imunify360-venv-2.3.3/opt/imunify360/venv/lib/python3.11/site-packages/humanize/i18n.py_get_default_locale_pathrsX  4w||BGOOH55x@@@ ttsA AA AAcz ttjS#ttf$rtdcYSwxYwN) _TRANSLATIONS_CURRENTr AttributeErrorKeyErrorrrrget_translationrsE#X_-- H %###T""""#s ::c|t}|td|tvr!tjd||g}|t|<|t _t|S)aRActivate internationalisation. Set `locale` as current locale. Search for locale in directory `path`. Args: locale (str): Language name, e.g. `en_GB`. path (str): Path to search for locales. Returns: dict: Translations. Raises: Exception: If humanize cannot find the locale folder. NznHumanize cannot determinate the default location of the 'locale' folder. You need to pass the path explicitly.humanize)r Exceptionrgettext_module translationrr )r rr"s rrr"so |')) | 4   ]""$0TF8LL + fHO   rcdt_dS)z Deactivate internationalisation.N)rr rrrrr@s HOOOrcDt|S)zvGet translation. Args: message (str): Text to translate. Returns: str: Translated text. )rrmessages rrrEs    $ $W - --rc t||S#t$r6|dz|z}t|}||kr|n|cYSwxYw)a Fetches a particular translation. It works with `msgctxt` .po modifiers and allows duplicate keys with different translations. Args: msgctxt (str): Context of the translation. message (str): Text to translate. Returns: str: Translated text. )rpgettextrr)msgctxtr&keyr"s rr)r)Qs>  ))'7;;; >>>(%''//44 %,,ww+=== >s!$=A$#A$cHt|||S)a5Plural version of gettext. Args: message (str): Singular text to translate. plural (str): Plural text to translate. num (str): The number (e.g. item count) to determine translation for the respective grammatical number. Returns: str: Translated text. )rr)r&pluralnums rrrjs"    % %gvs ; ;;rc|S)a^Mark a string as a translation string without translating it. Example usage: ```python CONSTANTS = [gettext_noop('first'), gettext_noop('second')] def num_name(n): return gettext(CONSTANTS[n]) ``` Args: message (str): Text to translate in the future. Returns: str: Original text, unchanged. rr%s r gettext_noopr0ys Nrc ||fS)aMark two strings as pluralized translations without translating them. Example usage: ```python CONSTANTS = [ngettext_noop('first', 'firsts'), ngettext_noop('second', 'seconds')] def num_name(n): return ngettext(*CONSTANTS[n]) ``` Args: singular (str): Singular text to translate in the future. plural (str): Plural text to translate in the future. Returns: tuple: Original text, unchanged. r)singularr-s r ngettext_noopr3s" f rreturncj ttj}n#ttf$rd}YnwxYw|S)ztReturn the thousands separator for a locale, default to comma. Returns: str: Thousands separator. ,)_THOUSANDS_SEPARATORrr rr)seps rrrsC "8?3 H % Js 00r)__doc__rr!os.pathr threadingr__all__NullTranslationsrrr7rrrrr)rr0r3strrrrrr?s00  R R R6~6889 577  S ###!!!!< . . .>>>2 < < <&( S      r