Commit 642148be authored by Aya Elgendy's avatar Aya Elgendy Committed by Commit Bot

Fix a typo in pin dialog error message

Fix a typo in the pin dialog error message which read
"1 attempts left" instead of "1 attempt left" when the user has
attempted incorrect pins and there's only 1 attempt remaining.

Fixed: 1060695
Change-Id: Ic9f51d03f87e8d4090cb6f93a5968e0436fdcdf8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2487106Reviewed-by: default avatarFabian Sommer <fabiansommer@chromium.org>
Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Commit-Queue: Aya Nader Elgendy‎ <ayag@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819389}
parent 859e10f3
...@@ -67,9 +67,8 @@ constexpr char kPinDialogDefaultTitle[] = "Smart card PIN"; ...@@ -67,9 +67,8 @@ constexpr char kPinDialogDefaultTitle[] = "Smart card PIN";
constexpr char kPinDialogInvalidPinTitle[] = "Invalid PIN."; constexpr char kPinDialogInvalidPinTitle[] = "Invalid PIN.";
constexpr char kPinDialogInvalidPin2AttemptsTitle[] = constexpr char kPinDialogInvalidPin2AttemptsTitle[] =
"Invalid PIN. 2 attempts left"; "Invalid PIN. 2 attempts left";
// TODO(crbug.com/1060695): Fix the incorrect plural in the message.
constexpr char kPinDialogInvalidPin1AttemptTitle[] = constexpr char kPinDialogInvalidPin1AttemptTitle[] =
"Invalid PIN. 1 attempts left"; "Invalid PIN. 1 attempt left";
constexpr char kPinDialogNoAttemptsLeftTitle[] = constexpr char kPinDialogNoAttemptsLeftTitle[] =
"Maximum allowed attempts exceeded."; "Maximum allowed attempts exceeded.";
......
...@@ -322,7 +322,9 @@ Try tapping the mic to ask me anything. ...@@ -322,7 +322,9 @@ Try tapping the mic to ask me anything.
<ph name="ATTEMPTS_LEFT">$1<ex>3</ex></ph> attempts left <ph name="ATTEMPTS_LEFT">$1<ex>3</ex></ph> attempts left
</message> </message>
<message name="IDS_REQUEST_PIN_DIALOG_ERROR_ATTEMPTS" desc="The text displayed in the certificate provider PIN request dialog when the previous login attempt was unsuccessful but there are more attempts remaining. Includes the reason for the previous failure."> <message name="IDS_REQUEST_PIN_DIALOG_ERROR_ATTEMPTS" desc="The text displayed in the certificate provider PIN request dialog when the previous login attempt was unsuccessful but there are more attempts remaining. Includes the reason for the previous failure.">
<ph name="ERROR_MESSAGE">$1<ex>Invalid PIN.</ex></ph> <ph name="ATTEMPTS_LEFT">$2<ex>3</ex></ph> attempts left {ATTEMPTS_LEFT, plural,
=1 {<ph name="ERROR_MESSAGE">{1}<ex>Invalid PIN.</ex></ph> {0} attempt left}
other {<ph name="ERROR_MESSAGE">{1}<ex>Invalid PIN.</ex></ph> {0} attempts left}}
</message> </message>
<!-- Print Management App --> <!-- Print Management App -->
......
bff3e9c779eeec926cb2a4e6483f615b8b797900
\ No newline at end of file
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "chromeos/components/security_token_pin/error_generator.h" #include "chromeos/components/security_token_pin/error_generator.h"
#include "base/i18n/message_formatter.h"
#include "base/i18n/number_formatting.h" #include "base/i18n/number_formatting.h"
#include "chromeos/strings/grit/chromeos_strings.h" #include "chromeos/strings/grit/chromeos_strings.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -51,9 +52,9 @@ base::string16 GenerateErrorMessage(ErrorLabel error_label, ...@@ -51,9 +52,9 @@ base::string16 GenerateErrorMessage(ErrorLabel error_label,
return l10n_util::GetStringFUTF16(IDS_REQUEST_PIN_DIALOG_ATTEMPTS_LEFT, return l10n_util::GetStringFUTF16(IDS_REQUEST_PIN_DIALOG_ATTEMPTS_LEFT,
base::FormatNumber(attempts_left)); base::FormatNumber(attempts_left));
} }
return l10n_util::GetStringFUTF16(IDS_REQUEST_PIN_DIALOG_ERROR_ATTEMPTS, return base::i18n::MessageFormatter::FormatWithNumberedArgs(
error_message, l10n_util::GetStringUTF16(IDS_REQUEST_PIN_DIALOG_ERROR_ATTEMPTS),
base::FormatNumber(attempts_left)); attempts_left, error_message);
} }
} // namespace security_token_pin } // namespace security_token_pin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment