[users] Translate PWQuality error messages with numbers

This commit is contained in:
Adriaan de Groot 2020-11-09 15:14:41 +01:00
parent a843f34177
commit 4e9c18a565

View File

@ -172,62 +172,66 @@ public:
case PWQ_ERROR_MIN_DIGITS: case PWQ_ERROR_MIN_DIGITS:
if ( auxerror ) if ( auxerror )
{ {
return QCoreApplication::translate( "PWQ", "The password contains less than %1 digits" ) return QCoreApplication::translate(
.arg( mungeLong( auxerror ) ); "PWQ", "The password contains fewer than %n digits", nullptr, mungeLong( auxerror ) );
} }
return QCoreApplication::translate( "PWQ", "The password contains too few digits" ); return QCoreApplication::translate( "PWQ", "The password contains too few digits" );
case PWQ_ERROR_MIN_UPPERS: case PWQ_ERROR_MIN_UPPERS:
if ( auxerror ) if ( auxerror )
{ {
return QCoreApplication::translate( "PWQ", "The password contains less than %1 uppercase letters" ) return QCoreApplication::translate(
.arg( mungeLong( auxerror ) ); "PWQ", "The password contains fewer than %n uppercase letters", nullptr, mungeLong( auxerror ) );
} }
return QCoreApplication::translate( "PWQ", "The password contains too few uppercase letters" ); return QCoreApplication::translate( "PWQ", "The password contains too few uppercase letters" );
case PWQ_ERROR_MIN_LOWERS: case PWQ_ERROR_MIN_LOWERS:
if ( auxerror ) if ( auxerror )
{ {
return QCoreApplication::translate( "PWQ", "The password contains less than %1 lowercase letters" ) return QCoreApplication::translate(
.arg( mungeLong( auxerror ) ); "PWQ", "The password contains fewer than %n lowercase letters", nullptr, mungeLong( auxerror ) );
} }
return QCoreApplication::translate( "PWQ", "The password contains too few lowercase letters" ); return QCoreApplication::translate( "PWQ", "The password contains too few lowercase letters" );
case PWQ_ERROR_MIN_OTHERS: case PWQ_ERROR_MIN_OTHERS:
if ( auxerror ) if ( auxerror )
{ {
return QCoreApplication::translate( "PWQ", return QCoreApplication::translate( "PWQ",
"The password contains less than %1 non-alphanumeric characters" ) "The password contains fewer than %n non-alphanumeric characters",
.arg( mungeLong( auxerror ) ); nullptr,
mungeLong( auxerror ) );
} }
return QCoreApplication::translate( "PWQ", "The password contains too few non-alphanumeric characters" ); return QCoreApplication::translate( "PWQ", "The password contains too few non-alphanumeric characters" );
case PWQ_ERROR_MIN_LENGTH: case PWQ_ERROR_MIN_LENGTH:
if ( auxerror ) if ( auxerror )
{ {
return QCoreApplication::translate( "PWQ", "The password is shorter than %1 characters" ) return QCoreApplication::translate(
.arg( mungeLong( auxerror ) ); "PWQ", "The password is shorter than %n characters", nullptr, mungeLong( auxerror ) );
} }
return QCoreApplication::translate( "PWQ", "The password is too short" ); return QCoreApplication::translate( "PWQ", "The password is too short" );
case PWQ_ERROR_ROTATED: case PWQ_ERROR_ROTATED:
return QCoreApplication::translate( "PWQ", "The password is just rotated old one" ); return QCoreApplication::translate( "PWQ", "The password is a rotated version of the previous one" );
case PWQ_ERROR_MIN_CLASSES: case PWQ_ERROR_MIN_CLASSES:
if ( auxerror ) if ( auxerror )
{ {
return QCoreApplication::translate( "PWQ", "The password contains less than %1 character classes" ) return QCoreApplication::translate(
.arg( mungeLong( auxerror ) ); "PWQ", "The password contains fewer than %n character classes", nullptr, mungeLong( auxerror ) );
} }
return QCoreApplication::translate( "PWQ", "The password does not contain enough character classes" ); return QCoreApplication::translate( "PWQ", "The password does not contain enough character classes" );
case PWQ_ERROR_MAX_CONSECUTIVE: case PWQ_ERROR_MAX_CONSECUTIVE:
if ( auxerror ) if ( auxerror )
{ {
return QCoreApplication::translate( "PWQ", return QCoreApplication::translate( "PWQ",
"The password contains more than %1 same characters consecutively" ) "The password contains more than %n same characters consecutively",
.arg( mungeLong( auxerror ) ); nullptr,
mungeLong( auxerror ) );
} }
return QCoreApplication::translate( "PWQ", "The password contains too many same characters consecutively" ); return QCoreApplication::translate( "PWQ", "The password contains too many same characters consecutively" );
case PWQ_ERROR_MAX_CLASS_REPEAT: case PWQ_ERROR_MAX_CLASS_REPEAT:
if ( auxerror ) if ( auxerror )
{ {
return QCoreApplication::translate( return QCoreApplication::translate(
"PWQ", "The password contains more than %1 characters of the same class consecutively" ) "PWQ",
.arg( mungeLong( auxerror ) ); "The password contains more than %n characters of the same class consecutively",
nullptr,
mungeLong( auxerror ) );
} }
return QCoreApplication::translate( return QCoreApplication::translate(
"PWQ", "The password contains too many characters of the same class consecutively" ); "PWQ", "The password contains too many characters of the same class consecutively" );
@ -235,8 +239,10 @@ public:
if ( auxerror ) if ( auxerror )
{ {
return QCoreApplication::translate( return QCoreApplication::translate(
"PWQ", "The password contains monotonic sequence longer than %1 characters" ) "PWQ",
.arg( mungeLong( auxerror ) ); "The password contains monotonic sequence longer than %n characters",
nullptr,
mungeLong( auxerror ) );
} }
return QCoreApplication::translate( "PWQ", return QCoreApplication::translate( "PWQ",
"The password contains too long of a monotonic character sequence" ); "The password contains too long of a monotonic character sequence" );