django-passwords
django-passwords copied to clipboard
can't enable fuzzy matching for translation
It looks like two strings are being used interchangably, but with different meaning and format specification:
https://github.com/dstufft/django-passwords/blob/master/passwords/locale/es/LC_MESSAGES/django.po#L65-L67
#: validators.py:106
#, fuzzy, python-format
#| msgid "Must contain %(WORDS)s or more unique words"
msgid "%(LETTERS)s or more unique letters"
msgstr "Debe tener %(WORDS)s o más palabras únicas"
normally this doesn't get translated at all by gettext, but with fuzzy translation enabled, the mismatch between LETTERS in msgid and WORDS in msgstr can't be reconciled.
There's a similar problem with SPECIAL and NON-ASCII later in the file.
$ python manage.py compilemessages --locale=es
...
processing file django.po in ...venv/lib/python2.7/site-packages/passwords/locale/es/LC_MESSAGES
CommandError: Execution of msgfmt failed: ...venv/lib/python2.7/site-packages/passwords/locale/es/LC_MESSAGES/django.po:67: a format specification for argument 'LETTERS' doesn't exist in 'msgstr'
...venv/lib/python2.7/site-packages/passwords/locale/es/LC_MESSAGES/django.po:85: a format specification for argument 'NON ASCII', as in 'msgstr', doesn't exist in 'msgid'
Looking at validators.py, it seems safe to remove the fuzzy match and get new translation strings, but that involves getting new translation strings, which is beyond my capabilities to propose.
If I understand correctly, no fuzzy translation is currently working though.