caravel中文_caravel汉化

来源:互联网 发布:数据库cursor什么意思 编辑:程序博客网 时间:2024/06/01 11:31

1、设置搜索路径

caravel路径下:

vi babel.cfg:
[ignore: static/assets/node_modules/**]
[python: **.py]
[jinja2: templates/**.html]
encoding = utf-8


2、生成翻译模板

pybabel extract -F babel.cfg -o messages.pot .


3、创建中文翻译

pybabel init -i messages.pot -d translations -l zh_CN


4、编写对应翻译

vi translations/zh_CN/LC_MESSAGES/messages.po


5、编译

pybabel compile -d translations


6、重启

ps aux|grep gunicorn|awk '{print $2}'|xargs kill -9 

nohup gunicorn -w 16 --timeout 60 -b 0.0.0.0:8018 caravel:app > /tmp/caravel.log 2>&1 & 



学习自:http://blog.csdn.net/lichengtongxiazai/article/details/22270561


0 0
原创粉丝点击