Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
explore & share your baby code
branch: master

This branch is even with cloudorz:master

:dfan

latest commit 8ab60806cb
fangqi authored
Failed to load latest commit information.
codewow
.gitignore mv production file
README add full text search
babel.cfg i18n zh-tw zh-hk zh
gevent_server.py fix bug
manager.py fix bug
messages.pot i18n zh-tw zh-hk zh

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
下载文件接口
Something went wrong with that request. Please try again.