Lc@sdZddkZddkZddkZddkZddkZddkZddklZdddddd d d d d ddg Z ei i ei ddZ dZdZdZdd'dYZdefdYZddddZhZdddeddZdedddZhahadaddZddZddZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&eZ'dS((sInternationalization and localization support. This module provides internationalization (I18N) and localization (L10N) support for your Python programs by providing an interface to the GNU gettext message catalog library. I18N refers to the operation by which a program is made aware of multiple languages. L10N refers to the adaptation of your program, once internationalized, to the local language and cultural habits. iN(tENOENTtNullTranslationstGNUTranslationstCatalogtfindt translationtinstallt textdomaintbindtextdomaintdgettextt dngettexttgettexttngettexttsharetlocalecCs|o|S|SdS(sy Implements the C expression: condition ? true : false Required to correctly interpret plural forms. N((t conditionttruetfalse((s/usr/lib64/python2.6/gettext.pyttest=sc syddkl}Wn#tj oddkl}nXddk}ddk}|i||i}yNg}|D]6}|d|ijo|ddjo ||qxqx~}Wn|ij ot dnX|o t dn|i d d }|i d d }t i d i d|}t i dfddg}x|D]} | djo|idqd| djoPt|djo t dni |i} |dcd| 7 ss4Is>IIsBad magic numberisFile is corruptt#t:is s content-typescharset=s plural-formst;splural=tN(tstructtunpacktgetattrt_catalogR-treadR*tLE_MAGICtBE_MAGICtIOErrortxrangeRIt splitlineststript startswithtsplittlowerRHRJR4RYR9(RNRORotfilenametcatalogtbuftbuflentmagictversiontmsgcountt masteridxttransidxtiiREtmlentmofftmendttlenttoffttendtmsgttmsgtlastktktitemtvR-RURVR/R((s/usr/lib64/python2.6/gettext.pyRMs|     " "                  1   cCst}|ii||}||jo |io|ii|S|S|io|i|iS|io|i|iS|S(N(tobjectRqtgetRLR RKtencodeRJ(RNRStmissingR((s/usr/lib64/python2.6/gettext.pyR Ys     cCsyt}|ii||}||jo |io|ii|S|S|io|i|iS|itiS(N( RRqRRLRTRKRRtgetpreferredencoding(RNRSRR((s/usr/lib64/python2.6/gettext.pyRTgs    cCsyZ|i||i|f}|io|i|iS|io|i|iS|SWnJtj o>|io|ii|||S|djo|S|SnXdS(Ni(RqR-RKRRJtKeyErrorRLR (RNRURVRR((s/usr/lib64/python2.6/gettext.pyR rs    cCsyN|i||i|f}|io|i|iS|itiSWnJtj o>|io|ii|||S|djo|S|SnXdS(Ni( RqR-RKRRRRRLRW(RNRURVRR((s/usr/lib64/python2.6/gettext.pyRWs   cCsUt}|ii||}||jo&|io|ii|St|S|S(N(RRqRRLRXRY(RNRSRR((s/usr/lib64/python2.6/gettext.pyRXs    cCsy |i||i|f}Wn]tj oQ|io|ii|||S|djot|}qt|}nX|S(Ni(RqR-RRLRZRY(RNRURVRR((s/usr/lib64/python2.6/gettext.pyRZs   ( RdReRsRtRMR RTR RWRXRZ(((s/usr/lib64/python2.6/gettext.pyRs S    ic Csf|djo t}n|djofg}x;dD]3}tii|}|o|id}Pq1q1Wd|jo|idqng}xC|D];}x2t|D]$}||jo|i|qqWqW|o g} nd} xr|D]j}|djoPntii ||dd|} tii | o |o| i| q^| SqqW| S( NtLANGUAGEtLC_ALLt LC_MESSAGEStLANGRktCs%s.mo(RRRR( RIt_default_localedirtostenvironRRzR)RGtpathtjointexists( tdomaint localedirt languagestalltenvarRFtnelangstlangtnelangtresulttmofile((s/usr/lib64/python2.6/gettext.pyRs@          c Cs|djo t}nt|||dd}|p%|otSttd|nd}x|D]}tii|} t i | } | djo%t i | |t |d} nt i | } |o| i|n|djo | }qh|i| qhW|S(NRis$No translation file found for domaintrb(RIRRRRuRRRtabspatht _translationsRt setdefaulttopentcopyR^RQ( RRRtclass_RRRAtmofilesRRtkeytt((s/usr/lib64/python2.6/gettext.pyRs*   %  cCs/t||dtd|}|i||dS(NRRRA(RtTrueR(RRRYRARcR((s/usr/lib64/python2.6/gettext.pyRstmessagescCs|dj o |antS(N(RIt_current_domain(R((s/usr/lib64/python2.6/gettext.pyRs  cCs+|dj o|t| s>&H   7 +T&