Closed swoiow closed 2 years ago
I believe this might be what you're looking for: Translating Applications. It gives you a series of steps to follow in order to produce necessary translation files.
Thanks your answer @born2discover . Yeah, i just tested it again before i writing.
The doc provide the situation work good when the the venv folder under the project folder, just like that
+ projectFolder
- venv
- babel.cfg
- .... more others folders
so run pybabel extract -F babel.cfg -o messages.pot .
is ok, and more extensions=jinja2.ext.autoescape,jinja2.ext.with_
is not need any more in latest jinja2.
But, how about the venv is not under the project, maybe use system env? That is not work for me. Any suggestions?
venv
folder is traditionally used for virtual environments in order to isolate dependencies on a per-project basis. However, strictly speaking they are not a requirement. That is, one can install everything system-wide and it'll work fine-ish.
So in your case, you could just as well install Babel (the underlying library that flask-babel extends) system-wide with: pip install Babel
or sudo pip install Babel
.
From there, pybabel command should be accessible to you in terminal without any virtualenv.
Thanks @born2discover . You give the best help for me.
As title.. and the more details:
I want to translate falsk-admin html to others language, how to include those templates files?