Viewing File: /opt/alt/python35/lib/python3.5/site-packages/humanize/__pycache__/i18n.cpython-35.opt-1.pyc



ßdTëã@sÑddlZddlmZddlZddddgZdejƒiZeƒZ	ej
jej
je
ƒdƒZdd	„Zdd
d„Zdd„Zdd„Zd
d„Zdd„Zdd„ZdS)éN)ÚlocalÚactivateÚ
deactivateÚgettextÚngettextÚlocalecCs6yttjSWn ttfk
r1tdSYnXdS)N)Ú
_TRANSLATIONSÚ_CURRENTrÚAttributeErrorÚKeyError©rrú/i18n.pyÚget_translationsrcCsQ|dkrt}|tkr@tjd||gƒ}|t|<|t_t|S)zrSet 'locale' as current locale. Search for locale in directory 'path'
    @param locale: language name, eg 'en_GB'NZhumanize)Ú_DEFAULT_LOCALE_PATHrÚgettext_moduleÚtranslationr	r)rÚpathrrrr
rs
	cCs
dt_dS)N)r	rrrrr
r!scCstƒj|ƒS)N)rr)Úmessagerrr
r%scCs4|d|}tƒj|ƒ}||kr0|S|S)a
'Particular gettext' function.
    It works with 'msgctxt' .po modifiers and allow duplicate keys with
    different translations.
    Python 2 don't have support for this GNU gettext function, so we
    reimplement it. It works by joining msgctx and msgid by '4' byte.ú)rr)ZmsgctxtrÚkeyrrrr
Úpgettext)srcCstƒj|||ƒS)N)rr)rZpluralÚnumrrr
r4scCs|S)zˆExample usage:
    CONSTANTS = [gettext_noop('first'), gettext_noop('second')]
    def num_name(n):
        return gettext(CONSTANTS[n])r)rrrr
Úgettext_noop8sr)rrÚ	threadingrZos.pathÚosÚ__all__ZNullTranslationsrr	rÚjoinÚdirnameÚ__file__rrrrrrrrrrr
Ú<module>s	!
Back to Directory File Manager