I am trying to translate default messages from WTForms using the Flask-WTF plugin. According to this ( https://github.com/ajford/flask-wtf/pull/65 ) it should work. You can also see that wtforms use gettext for default error messages ( https://bitbucket.org/simplecodes/wtforms/src/113994790508/wtforms/validators.py ).
I added WTF_I18n_ENABLED to my configuration file and I created my .po file using the following commands
pybabel extract -F babel.cfg -k lazy_gettext -o messages.pot myapp pybabel init -i messages.pot -d myapp/translations -l en pybabel compile -d myapp/translations
I expected the default messages to appear, but they do not. Am I expecting too much or am I doing something wrong?
A checkbox can only search in one folder ( translations by default, not on eggs). Therefore, you need to copy the wtforms.mo / wtforms.po to your LS_MESSAGES application.
translations
wtforms.mo
wtforms.po
LS_MESSAGES
Source: https://habr.com/ru/post/1502198/More articles:Why is the static method of the parent class called when the subclass has already overridden it? - javaFunction called before filling the $ scope array - javascriptAndroid development in Python Realistic - pythonTesting (test device) - meta tag name and content to make sure the content is not empty - ruby | fooobar.comhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1502197/why-do-i-have-to-clone-an-existing-git-repository-to-access-it&usg=ALkJrhgjTNbrKm_jqN82iSaFFSgOAOtikAHow to center Roman numerals over list items - htmlHow to detect outliers in ArrayList - javaPass the initialized object to javascript function - javascriptUnexpected pattern matching behavior - haskellHaskell List and Control.Lens - listAll Articles