Revision 0fe371da
Added by koszko over 1 year ago
src/hydrilla/util/_util.py | ||
---|---|---|
136 | 136 |
def translation(localedir: Union[Path, str], lang: Optional[str]=None) \ |
137 | 137 |
-> gettext.GNUTranslations: |
138 | 138 |
""" |
139 |
Configure translations for domain 'messages' and return the object that
|
|
140 |
represents them. |
|
139 |
Configure translations for domain 'hydrilla-messages' and return the object
|
|
140 |
that represents them.
|
|
141 | 141 |
|
142 | 142 |
If `lang` is set, look for translations for `lang`. Otherwise, try to |
143 | 143 |
determine system's default language and use that. |
... | ... | |
151 | 151 |
except: |
152 | 152 |
lang = locale.getdefaultlocale()[0] or 'C' |
153 | 153 |
|
154 |
return gettext.translation('messages', localedir=localedir, |
|
154 |
return gettext.translation('hydrilla-messages', localedir=localedir,
|
|
155 | 155 |
languages=[lang, 'en_US']) |
156 | 156 |
|
157 | 157 |
_ = translation(here.parent / 'builder' / 'locales').gettext |
Also available in: Unified diff
change translation domain to 'hydrilla-messages'