explore & share your baby code
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is even with cloudorz:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
codewow
.gitignore
README
babel.cfg
gevent_server.py
manager.py
messages.pot

README

codewow startup now

# 安装
mongodb

pip install ...
flask
flask-mongoalchemy
flask-principal
flask-wtf
flask-openid
flask-script
flask-babel
blinker
gevent
supervior # 运行管理

# 国际化
$vi  babel.cfg
[python: **.py]
[jinja2: **/templates/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_

$ pybabel extract -F babel.cfg -o messages.pot .
# if you use lazy_gettext()
$ pybabel extract -F babel.cfg -k lazy_gettext -o messages.pot .

# mapping to your lang  create the first translation
$ pybabel init -i messages.pot -d translations -l zh
-d translations tells pybabel to store the translations in this folder.
This is where Flask-Babel will look for translations.
Put it next to your template folder.

To compile the translations for use, pybabel helps again:
$ pybabel compile -d translations

What if the strings change? Create a new messages.pot like above and then let pybabel merge the changes:
$ pybabel update -i messages.pot -d translations

TODO:
搜索 # done simple mongo full text search
代码拷贝
上传头像
分享到SNS
下载文件接口