mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 18:01:04 +00:00
Add autogenerated docs for examples. Will be changed soon.
This commit is contained in:
parent
06097fffa1
commit
f9c1ce35bb
17 changed files with 216 additions and 0 deletions
28
docs/source/examples/i18n_example.rst
Normal file
28
docs/source/examples/i18n_example.rst
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
.. Autogenerated file at 2018-09-08 02:07:37.591007
|
||||
|
||||
============
|
||||
I18n example
|
||||
============
|
||||
|
||||
Internalize your bot
|
||||
Step 1: extract texts
|
||||
# pybabel extract i18n_example.py -o locales/mybot.pot
|
||||
Step 2: create *.po files. For e.g. create en, ru, uk locales.
|
||||
# echo {en,ru,uk} | xargs -n1 pybabel init -i locales/mybot.pot -d locales -D mybot -l
|
||||
Step 3: translate texts
|
||||
Step 4: compile translations
|
||||
# pybabel compile -d locales -D mybot
|
||||
Step 5: When you change the code of your bot you need to update po & mo files.
|
||||
Step 5.1: regenerate pot file:
|
||||
command from step 1
|
||||
Step 5.2: update po files
|
||||
# pybabel update -d locales -D mybot -i locales/mybot.pot
|
||||
Step 5.3: update your translations
|
||||
Step 5.4: compile mo files
|
||||
command from step 4
|
||||
|
||||
.. literalinclude:: ../../../examples/i18n_example.py
|
||||
:caption: i18n_example.py
|
||||
:language: python
|
||||
:linenos:
|
||||
:lines: 22-
|
||||
Loading…
Add table
Add a link
Reference in a new issue