mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
I18n example patch (added docs and fixed typos) (#419)
* Update i18n example 1. Replaced one file translation to all project folder translation. It's more usable case. 2. `For e.g.` --> `E.g.`. E.g. is short for `exempli gratia` which means simply “for example.” So if you write for e.g., you are in effect writing `for for example`. 3. `xargs` replased with serveral lines, `xargs` is not appliable for Microsoft Windows users. 4. Added info about translation tools. 5. Minor edits. * i18n middlaware typo fix * i18n example header typo fix
This commit is contained in:
parent
9ab2945267
commit
56ffa00c8c
2 changed files with 15 additions and 8 deletions
|
|
@ -59,13 +59,13 @@ class I18nMiddleware(BaseMiddleware):
|
|||
with open(mo_path, 'rb') as fp:
|
||||
translations[name] = gettext.GNUTranslations(fp)
|
||||
elif os.path.exists(mo_path[:-2] + 'po'):
|
||||
raise RuntimeError(f"Found locale '{name} but this language is not compiled!")
|
||||
raise RuntimeError(f"Found locale '{name}' but this language is not compiled!")
|
||||
|
||||
return translations
|
||||
|
||||
def reload(self):
|
||||
"""
|
||||
Hot reload locles
|
||||
Hot reload locales
|
||||
"""
|
||||
self.locales = self.find_locales()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue