﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
37202	MinimumLengthValidator.get_error_message has a bug that breaks translation	meng		"Hello,
The get_error_message method of the MinimumLengthValidator class in Django's auth password_validation.py file has a bug that prevents translations from working correctly.

The problem code is：

{{{
class MinimumLengthValidator:
    ...
    def get_error_message(self):
        return (
            ngettext(
                ""This password is too short. It must contain at least %d character."",
                ""This password is too short. It must contain at least %d characters."",
                self.min_length,
            )
            % self.min_length
        )
}}}


The correct code should be：
{{{
class MinimumLengthValidator:
    ...
    def get_error_message(self):
        return (
            ngettext(
                ""This password is too short. It must contain at least %(min_length)d character."",
                ""This password is too short. It must contain at least %(min_length)d characters."",
                self.min_length,
            )
            % {""min_length"": self.min_length}
        )
}}}"	Bug	closed	contrib.auth	5.2	Normal	duplicate		meng	Unreviewed	1	0	0	0	0	0
