I cant get a basic translationto work in Flask Babel.
Here are my steps.
I have this in a page
{{_("Hello")}}
I run this command.
pybabel extract -F babel.cfg -o messages.pot .
I then run this command for German.
pybabel init -i messages.pot -d translations -l de
Here is the mo file for german in
/app/translations/de/LC_MESSAGES/messages.po
# German translations for PROJECT. # Copyright (C) 2012 ORGANIZATION # This file is distributed under the same license as the PROJECT project. # FIRST AUTHOR <EMAIL@ADDRESS>, 2012. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2012-09-24 03:36+0800\n" "PO-Revision-Date: 2012-09-24 03:37+0800\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: de <LL@li.org>\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.6\n" #: templates/baseh5.html:129 msgid "Hello" msgstr "Guten Tag"
I run this command.
pybabel compile -d translations
This is what I get.
catalog 'translations/de/LC_MESSAGES/messages.po' is marked as fuzzy, skipping
set this is flask
app.config['BABEL_DEFAULT_LOCALE'] = 'de'
What do I get? I get Hello
. Why did Flask Babel not work? How do I deal with fuzzy? This should have been basic.