diff --git a/apps/settings/index.html b/apps/settings/index.html index 95328c4c56b3..d57358a16112 100644 --- a/apps/settings/index.html +++ b/apps/settings/index.html @@ -1658,6 +1658,10 @@

3 tries left. +
+ 3 tries left +
+
SIM PIN
diff --git a/apps/settings/js/simcard_dialog.js b/apps/settings/js/simcard_dialog.js index 770206404c0e..8a18fd794b7d 100644 --- a/apps/settings/js/simcard_dialog.js +++ b/apps/settings/js/simcard_dialog.js @@ -19,6 +19,8 @@ var SimPinDialog = { newPinInput: null, confirmPinInput: null, + triesLeftMsg: document.getElementById('triesLeft'), + errorMsg: document.getElementById('errorMsg'), errorMsgHeader: document.getElementById('messageHeader'), errorMsgBody: document.getElementById('messageBody'), @@ -83,6 +85,15 @@ var SimPinDialog = { handleCardState: function spl_handleCardState() { var _ = navigator.mozL10n.get; + var retryCount = this.mobileConnection.retryCount; + + if (!retryCount) { + this.triesLeftMsg.hidden = true; + } else { + var l10nArgs = { n: triesLeft }; + this.triesLeftMsg.textContent = _('inputCodeRetriesLeft', l10nArgs); + this.triesLeftMsg.hidden = false; + } var cardState = this.mobileConnection.cardState; switch (cardState) { @@ -95,9 +106,7 @@ var SimPinDialog = { case 'pukRequired': this.lockType = 'puk'; this.errorMsgHeader.textContent = _('simCardLockedMsg') || ''; - this.errorMsgHeader.dataset.l10nId = 'simCardLockedMsg'; this.errorMsgBody.textContent = _('enterPukMsg') || ''; - this.errorMsgBody.dataset.l10nId = 'enterPukMsg'; this.errorMsg.hidden = false; this.inputFieldControl(false, true, true); this.pukInput.focus(); @@ -107,7 +116,6 @@ var SimPinDialog = { break; } this.dialogTitle.textContent = _(this.lockType + 'Title') || ''; - this.dialogTitle.dataset.l10nId = this.lockType + 'Title'; }, handleError: function spl_handleLockError(evt) { @@ -125,17 +133,13 @@ var SimPinDialog = { showErrorMsg: function spl_showErrorMsg(retry, type) { var _ = navigator.mozL10n.get; + var l10nArgs = { n: retry }; + this.triesLeftMsg.textContent = _('inputCodeRetriesLeft', l10nArgs); this.errorMsgHeader.textContent = _(type + 'ErrorMsg'); - this.errorMsgHeader.dataset.l10nId = type + 'ErrorMsg'; - if (retry !== 1) { - var l10nArgs = { n: retry }; - this.errorMsgBody.dataset.l10nId = type + 'AttemptMsg2'; - this.errorMsgBody.dataset.l10nArgs = JSON.stringify(l10nArgs); - this.errorMsgBody.textContent = _(type + 'AttemptMsg2', l10nArgs); + this.errorMsgBody.textContent = _(type + 'AttemptMsg3', l10nArgs); } else { - this.errorMsgBody.dataset.l10nId = type + 'LastChanceMsg'; this.errorMsgBody.textContent = _(type + 'LastChanceMsg'); } @@ -163,7 +167,6 @@ var SimPinDialog = { if (newPin !== confirmPin) { this.errorMsgHeader.textContent = _('newPinErrorMsg'); - this.errorMsgHeader.dataset.l10nId = 'newPinErrorMsg'; this.errorMsgBody.textContent = ''; this.errorMsg.hidden = false; return; @@ -205,7 +208,6 @@ var SimPinDialog = { if (newPin !== confirmPin) { this.errorMsgHeader.textContent = _('newPinErrorMsg'); - this.errorMsgHeader.dataset.l10nId = 'newPinErrorMsg'; this.errorMsgBody.textContent = ''; this.errorMsg.hidden = false; return; @@ -279,12 +281,10 @@ var SimPinDialog = { case 'enable': this.inputFieldControl(true, false, false); this.dialogTitle.textContent = _('pinTitle') || ''; - this.dialogTitle.dataset.l10nId = 'pinTitle'; break; case 'changePin': this.inputFieldControl(true, false, true); this.dialogTitle.textContent = _('newpinTitle') || ''; - this.dialogTitle.dataset.l10nId = 'newpinTitle'; break; } diff --git a/apps/settings/locales/settings.en-US.properties b/apps/settings/locales/settings.en-US.properties index 9f94a99728b6..32ab335632b6 100644 --- a/apps/settings/locales/settings.en-US.properties +++ b/apps/settings/locales/settings.en-US.properties @@ -203,7 +203,7 @@ unpair-title = Unpair a connected device? unpair-msg = You are currently connected to this device. Unpairing will also disconnect from it. # Connectivity :: Internet Sharing -SSIDCannotBeEmpty=The SSID cannot be empty +SSIDCannotBeEmpty=The SSID cannot be empty internetSharing=Internet sharing internetSharing-usb=USB internetSharing-usb-desc=Share my phone’s Internet connection with a USB-connected device. @@ -389,17 +389,28 @@ pinTitle=Enter SIM PIN pukTitle=Enter PUK code newpinTitle=New PIN pinErrorMsg=The PIN was incorrect. -pinAttemptMsg2={[ plural(n) ]} -pinAttemptMsg2[one] = Last chance. -pinAttemptMsg2[two] = {{n}} tries left. -pinAttemptMsg2[few] = {{n}} tries left. -pinAttemptMsg2[many] = {{n}} tries left. -pinAttemptMsg2[other] = {{n}} tries left. +inputCodeRetriesLeft={[ plural(n) ]} +inputCodeRetriesLeft[one]=last try. +inputCodeRetriesLeft[two]={{n}} tries left. +inputCodeRetriesLeft[few]={{n}} tries left. +inputCodeRetriesLeft[many]={{n}} tries left. +inputCodeRetriesLeft[other]={{n}} tries left. +pinAttemptMsg3={[ plural(n) ]} +pinAttemptMsg3[one]=You have one try left to enter the correct code before locking the SIM card. +pinAttemptMsg3[two]=You have {{n}} tries left to enter the correct code before locking the SIM card. +pinAttemptMsg3[few]=You have {{n}} tries left to enter the correct code before locking the SIM card. +pinAttemptMsg3[many]=You have {{n}} tries left to enter the correct code before locking the SIM card. +pinAttemptMsg3[other]=You have {{n}} tries left to enter the correct code before locking the SIM card. pinLastChanceMsg=This is your last chance to enter the correct PIN. Otherwise, you must enter the PUK code to use this SIM card. simCardLockedMsg=The SIM card is locked. enterPukMsg=You must enter the Personal Unlocking Key (PUK) code for the SIM card. Refer to your SIM card documentation or contact your carrier for more information. pukErrorMsg=The PUK code is incorrect. -pukAttemptMsg2=You have {{n}} tries left to enter the correct code before this SIM card will be permanently unusable. Refer to your SIM card documentation or contact your carrier for more information. +pukAttemptMsg3={[ plural(n) ]} +pukAttemptMsg3[one]=You have one try left to enter the correct code before this SIM card will be permanently unusable. Refer to your SIM card documentation or contact your carrier for more information. +pukAttemptMsg3[two]=You have {{n}} tries left to enter the correct code before this SIM card will be permanently unusable. Refer to your SIM card documentation or contact your carrier for more information. +pukAttemptMsg3[few]=You have {{n}} tries left to enter the correct code before this SIM card will be permanently unusable. Refer to your SIM card documentation or contact your carrier for more information. +pukAttemptMsg3[many]=You have {{n}} tries left to enter the correct code before this SIM card will be permanently unusable. Refer to your SIM card documentation or contact your carrier for more information. +pukAttemptMsg3[other]=You have {{n}} tries left to enter the correct code before this SIM card will be permanently unusable. Refer to your SIM card documentation or contact your carrier for more information. pukLastChanceMsg=Last chance to enter the correct PUK code. Your SIM card will be permanently unusable if you enter in the wrong PUK code. Refer to your SIM card documentation or contact your carrier for more information. newSimPinMsg=Create PIN (must contain 4 to 8 digits) confirmNewSimPinMsg=Confirm new PIN