o ]Lb1 @szddlmZddlZddlZddlZddlZddlmZddl m Z ddl m Z mZej r5ddlmZmZeedddurAejZneeZdZejr~d e jvr~d e jvr~d e jvr~d e jvr~zddlZejjZejegZWn eee fy}Ynwe!e j"Z"ej#$e"d Z%ej&de%eddZ'ze'j(Z)Wn eye'jZ)YnwiZ*ddZddZ+e+rddZ,dSeZ,dS))absolute_importN)getattr) resourceutil)encodingpycompat)CallableListfrozensLANGUAGEsLC_ALLs LC_MESSAGESsLANGlocalehgT)fallbackcCs|dusts|Sttji}||vrXt|tjur |d}n dd|dD}ddd|D}zt tj}| |d||<W||St yW|||<Y||Sw||S)a'Translate message. The message is looked up in the catalog to get a Unicode string, which is encoded in the local encoding before being returned. Important: message is restricted to characters in the encoding given by sys.getdefaultencoding() which is most likely 'ascii'. Nz cSsg|]}|dqS)zutf-8)decode.0pr0/usr/lib/python3/dist-packages/mercurial/i18n.py _szgettext..s cSsg|] }|r t|p dqS)) _ugettextrrrrrbsreplace) r _msgcache setdefaultrtyperunicodesplitjoinsysstrencode LookupError)messagecache paragraphsu encodingstrrrrgettextHs"    r&cCs8dtjvr dtjvr dStjddd}d|vS)NsHGPLAINs HGPLAINEXCEPTF,si18n)renvirongetstripr) exceptionsrrr_plainqs  r-cCs|S)Nr)r!rrr|sr.)- __future__rr& gettextmodr ossysrrutilsrrr TYPE_CHECKINGtypingrr sysexecutablemodulefsencode__file__ _languages iswindowsr)ctypeswindllkernel32GetUserDefaultUILanguagelangidwindows_locale ImportErrorAttributeErrorKeyErrorfsdecodedatapathpathr localedir translationtugettextrrr-_rrrrsR             )