Hi,
I can't set default locale, it does not work...
app.config['BABEL_DEFAULT_LOCALE'] = 'fr'
What am I doing wrong ?
Here is my whole code :
== views.py ==
from flask import Flask, render_template
from flaskext.babel import Babel
app = Flask(__name__)
app.config['BABEL_DEFAULT_LOCALE'] = 'fr'
babel = Babel(app)
@app.route('/')
def hello():
return render_template('hello.html')
if __name__ == '__main__':
app.run(debug=True)
== templates/hello.html ==
<h1>{{ _('Hello World') }}</h1>
== translations/fr/LC_MESSAGES/messages.po ==
# Italian translations for PROJECT.
# Copyright (C) 2010 ORGANIZATION
# This file is distributed under the same license as the PROJECT
project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2010-09-02 22:13+0700\n"
"PO-Revision-Date: 2010-09-02 22:18+0700\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: it <[email protected]>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 0.9.5\n"
#: templates/hello.html:1
msgid "Hello World"
msgstr "Bonjour tout le monde"
Thanks for your help
--
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pocoo-libs?hl=en.