mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Completed I18N examples descriptions
This commit is contained in:
parent
93b97fc3fe
commit
10b5886dcc
@ -41,6 +41,12 @@ When you delete/update your texts you also need to update them in .po files:
|
|||||||
pybabel update -i locales/{domain_name}.pot -d locales
|
pybabel update -i locales/{domain_name}.pot -d locales
|
||||||
- translate
|
- translate
|
||||||
pybabel compile -d locales
|
pybabel compile -d locales
|
||||||
|
|
||||||
|
If you have any exceptions check:
|
||||||
|
- you have installed babel
|
||||||
|
- translations are ready, so you just compiled it
|
||||||
|
- in the commands above you replaced {domain_name} to messages
|
||||||
|
- you are writing commands from correct path in terminal
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
@ -81,7 +87,7 @@ class I18NMiddleware(I18N):
|
|||||||
|
|
||||||
|
|
||||||
storage = StateMemoryStorage()
|
storage = StateMemoryStorage()
|
||||||
bot = AsyncTeleBot("1254795383:AAE7gbj1aas4lEDHB1eVuZZhSGPWcH1B5ds", state_storage=storage)
|
bot = AsyncTeleBot("", state_storage=storage)
|
||||||
|
|
||||||
i18n = I18NMiddleware(translations_path='locales', domain_name='messages')
|
i18n = I18NMiddleware(translations_path='locales', domain_name='messages')
|
||||||
_ = i18n.gettext # for singular translations
|
_ = i18n.gettext # for singular translations
|
||||||
|
@ -41,6 +41,12 @@ When you delete/update your texts you also need to update them in .po files:
|
|||||||
pybabel update -i locales/{domain_name}.pot -d locales
|
pybabel update -i locales/{domain_name}.pot -d locales
|
||||||
- translate
|
- translate
|
||||||
pybabel compile -d locales
|
pybabel compile -d locales
|
||||||
|
|
||||||
|
If you have any exceptions check:
|
||||||
|
- you have installed babel
|
||||||
|
- translations are ready, so you just compiled it
|
||||||
|
- in the commands above you replaced {domain_name} to messages
|
||||||
|
- you are writing commands from correct path in terminal
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
Loading…
Reference in New Issue
Block a user