छोड़कर चिह्नित किया गया है, मुझे फ्लास्क बेबेल में एक मूल अनुवाद कार्य नहीं मिल सकता है।फ्लास्क बेबेल - 'अनुवाद/डी/एलसी_एमएसएसएजीईएस/संदेश.po' को अस्पष्ट,
यहां मेरे कदम हैं।
मैं एक पेज
{{_("Hello")}}
मैं इस आदेश चला में यह है।
pybabel extract -F babel.cfg -o messages.pot .
मैं जर्मन के लिए यह आदेश चलाता हूं।
pybabel init -i messages.pot -d translations -l de
यहाँ मो मैं इस आदेश चला
/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 protected]>, 2012. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: [email protected]\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 protected]>\n" "Language-Team: de <[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.6\n" #: templates/baseh5.html:129 msgid "Hello" msgstr "Guten Tag"
में के लिए जर्मन फ़ाइल है।
pybabel compile -d translations
यही मुझे मिलता है।
catalog 'translations/de/LC_MESSAGES/messages.po' is marked as fuzzy, skipping
सेट इस कुप्पी
app.config['BABEL_DEFAULT_LOCALE'] = 'de'
मुझे क्या मिलेगा है? मुझे Hello
मिलता है। फ्लास्क बेबेल क्यों काम नहीं किया? मैं अस्पष्ट से कैसे निपटूं? यह मूल होना चाहिए था।
pybabel compile -f -d translations
'फजी' संदेश msgid
रेखा के ऊपर एक #, fuzzy
लाइन के साथ चिह्नित कर रहे हैं, और कर रहे हैं:
क्या आप निश्चित हैं कि आपकी .po फ़ाइल में कोई 'अस्पष्ट' रेखाएं नहीं हैं? शीर्ष पर लाइन के अलावा, वह है। आप '-f' ध्वज के साथ इसे किसी भी तरह संकलित करने के लिए बेबेल को मजबूर कर सकते हैं। –
मैं उस ध्वज को कहां रखूं? कमांड लाइन क्या दिखती है? क्या आप एक उत्तर पोस्ट कर सकते हैं? – Tampa
यह काम किया !!!!!!!!!! धन्यवाद – Tampa