Skip to content

Commit

Permalink
Update manage PIN/PUK dialog UI
Browse files Browse the repository at this point in the history
  • Loading branch information
elibon99 committed Jan 21, 2025
1 parent 0582f9b commit 331d4c3
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 17 deletions.
14 changes: 13 additions & 1 deletion lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@
"l_unlock_pin_first": "Mit PIN entsperren",
"l_pin_soft_locked": "PIN ist geblockt bis der YubiKey entfernt und wieder angeschlossen wird",
"l_pin_change_required_desc": "Vor Verwendung der Anwendung muss eine neue PIN gesetzt werden",
"p_enter_current_pin_or_puk": null,
"@p_enter_current_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_current_pin_or_reset": "Gib deine aktuelle PIN ein. Falls du die PIN nicht kennst, musst du sie mit der PUK entsperren oder deinen YubiKey zurücksetzen.",
"p_enter_current_pin_or_reset_no_puk": "Gib deine aktuelle PIN ein. Falls du die PIN nicht kennst, musst du deinen YubiKey zurücksetzen.",
"p_enter_current_puk_or_reset": "Gib deine aktuelle PUK ein. Wenn du die PUK nicht kennst, musst du deinen YubiKey zurücksetzen.",
Expand Down Expand Up @@ -330,8 +336,14 @@
"p_pin_required_desc": "Diese Aktion erfordert die PIV PIN.",
"l_piv_pin_blocked": "Gesperrt, verwende die PUK zum Zurücksetzen",
"l_piv_pin_puk_blocked": "Gesperrt, Zurücksetzen auf Werkseinstellungen erforderlich",
"p_enter_new_piv_pin_puk": "Gebe eine neue {name} ein. Sie muss mindestens {length} Zeichen lang sein.",
"p_enter_new_piv_pin_puk": null,
"@p_enter_new_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_new_piv_pin_puk_desc": null,
"@p_enter_new_piv_pin_puk_desc": {
"placeholders": {
"name": {},
"length": {}
Expand Down
16 changes: 14 additions & 2 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@
"l_unlock_pin_first": "Unlock with PIN",
"l_pin_soft_locked": "PIN has been blocked until the YubiKey is removed and reinserted",
"l_pin_change_required_desc": "A new PIN must be set before you can use this application",
"p_enter_current_pin_or_puk": "Enter your current {name}.",
"@p_enter_current_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_current_pin_or_reset": "Enter your current PIN. If you don't know your PIN, you'll need to unblock it with the PUK or reset the YubiKey.",
"p_enter_current_pin_or_reset_no_puk": "Enter your current PIN. If you don't know your PIN, you'll need to reset the YubiKey.",
"p_enter_current_puk_or_reset": "Enter your current PUK. If you don't know your PUK, you'll need to reset the YubiKey.",
Expand Down Expand Up @@ -330,14 +336,20 @@
"p_pin_required_desc": "The action you are about to perform requires the PIV PIN to be entered.",
"l_piv_pin_blocked": "Blocked, use PUK to reset",
"l_piv_pin_puk_blocked": "Blocked, factory reset needed",
"p_enter_new_piv_pin_puk": "Enter a new {name} to set. Must be at least {length} characters long.",
"p_enter_new_piv_pin_puk": "Enter a new {name} to set.",
"@p_enter_new_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_new_piv_pin_puk_desc": "A {name} must be at least {length} characters long.",
"@p_enter_new_piv_pin_puk_desc": {
"placeholders": {
"name": {},
"length": {}
}
},
"p_enter_new_piv_pin_puk_complexity_active": "Enter a new {name} to set. Must be at least {length} characters long, contain at least 2 unique characters, and not be a commonly used {name}, like \"{common}\".",
"p_enter_new_piv_pin_puk_complexity_active": "A {name} must be at least {length} characters long, contain at least 2 unique characters, and not be a commonly used {name}, like \"{common}\".",
"@p_enter_new_piv_pin_puk_complexity_active": {
"placeholders": {
"name": {},
Expand Down
14 changes: 13 additions & 1 deletion lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@
"l_unlock_pin_first": "Déverrouiller avec un code PIN",
"l_pin_soft_locked": "PIN bloqué jusqu'à ce que la YubiKey soit retirée et réinsérée",
"l_pin_change_required_desc": "Vous devez créer un nouveau PIN avant d'utiliser cette appli",
"p_enter_current_pin_or_puk": null,
"@p_enter_current_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_current_pin_or_reset": "Saisissez votre PIN actuel. Vous ne connaissez pas votre PIN\u00a0? Débloquez-le avec le PUK ou réinitialisez la YubiKey.",
"p_enter_current_pin_or_reset_no_puk": "Saisissez votre PIN actuel. Vous ne connaissez pas votre PIN\u00a0? Réinitialisez la YubiKey.",
"p_enter_current_puk_or_reset": "Saisissez votre PUK actuel. Vous ne connaissez pas votre PUK\u00a0? Réinitialisez la YubiKey.",
Expand Down Expand Up @@ -330,8 +336,14 @@
"p_pin_required_desc": "L'action que vous allez effectuer nécessite la saisie du PIN PIV.",
"l_piv_pin_blocked": "Bloqué, utilisez PUK pour réinitialiser",
"l_piv_pin_puk_blocked": "Bloqué, réinitialisation aux paramètres d'usine nécessaire",
"p_enter_new_piv_pin_puk": "Entrez un nouveau {name} à définir. Il doit comporter au moins {length} caractères.",
"p_enter_new_piv_pin_puk": null,
"@p_enter_new_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_new_piv_pin_puk_desc": null,
"@p_enter_new_piv_pin_puk_desc": {
"placeholders": {
"name": {},
"length": {}
Expand Down
14 changes: 13 additions & 1 deletion lib/l10n/app_ja.arb
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@
"l_unlock_pin_first": "PIN でロック解除",
"l_pin_soft_locked": "YubiKeyを取り外して再挿入するまで、PINがブロックされています",
"l_pin_change_required_desc": "このアプリケーションを使用する前に新しいPINを設定する必要があります",
"p_enter_current_pin_or_puk": null,
"@p_enter_current_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_current_pin_or_reset": "現在のPINを入力してください。PINがわからない場合は、PUKでブロックを解除するか、YubiKeyをリセットする必要があります。",
"p_enter_current_pin_or_reset_no_puk": "現在のPINを入力してください。PINがわからない場合は、YubiKeyをリセットする必要があります。",
"p_enter_current_puk_or_reset": "現在のPUKを入力してください。PUKがわからない場合は、YubiKeyをリセットする必要があります。",
Expand Down Expand Up @@ -330,8 +336,14 @@
"p_pin_required_desc": "実行しようとしているアクションでは、PIV PINを入力する必要があります。",
"l_piv_pin_blocked": "ブロックされています。リセットするにはPUKを使用してください",
"l_piv_pin_puk_blocked": "ブロックされています。工場出荷時の状態にリセットする必要があります",
"p_enter_new_piv_pin_puk": "新しく設定したい {name} を入力してください。最低 {length} 文字です。",
"p_enter_new_piv_pin_puk": null,
"@p_enter_new_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_new_piv_pin_puk_desc": null,
"@p_enter_new_piv_pin_puk_desc": {
"placeholders": {
"name": {},
"length": {}
Expand Down
14 changes: 13 additions & 1 deletion lib/l10n/app_pl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@
"l_unlock_pin_first": "Najpierw odblokuj kodem PIN",
"l_pin_soft_locked": "Kod PIN został zablokowany do momentu ponownego podłączenia klucza YubiKey",
"l_pin_change_required_desc": "Przed użyciem tej aplikacji ustaw nowy kod PIN",
"p_enter_current_pin_or_puk": null,
"@p_enter_current_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_current_pin_or_reset": "Wpisz obecny kod PIN. Jeśli go nie pamiętasz, zresetuj klucz YubiKey lub odblokuj go za pomocą kodu PUK.",
"p_enter_current_pin_or_reset_no_puk": "Wpisz obecny kod PIN. Jeśli go nie pamiętasz, zresetuj klucz YubiKey.",
"p_enter_current_puk_or_reset": "Wpisz obecny kod PUK. Jeśli go nie pamiętasz, zresetuj klucz YubiKey.",
Expand Down Expand Up @@ -330,8 +336,14 @@
"p_pin_required_desc": "Działanie wymaga wpisania kodu PIN PIV.",
"l_piv_pin_blocked": "Zablokowano, użyj kodu PUK, aby zresetować",
"l_piv_pin_puk_blocked": "Zablokowano, zresetuj do ustawień fabrycznych",
"p_enter_new_piv_pin_puk": "Wprowadź nowy adres {name} do ustawienia. Musi mieć co najmniej {length} znaków.",
"p_enter_new_piv_pin_puk": null,
"@p_enter_new_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_new_piv_pin_puk_desc": null,
"@p_enter_new_piv_pin_puk_desc": {
"placeholders": {
"name": {},
"length": {}
Expand Down
14 changes: 13 additions & 1 deletion lib/l10n/app_sk.arb
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@
"l_unlock_pin_first": "Odomknúť pomocou PIN",
"l_pin_soft_locked": "PIN bol zablokovaný, kým sa kľúč YubiKey nevyberie a nevloží znova",
"l_pin_change_required_desc": "Pred použitím tejto aplikácie je potrebné nastaviť nový PIN kód",
"p_enter_current_pin_or_puk": null,
"@p_enter_current_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_current_pin_or_reset": "Zadajte svoj aktuálny PIN kód. Ak nepoznáte svoj PIN, musíte ho odblokovať pomocou PUK alebo obnoviť YubiKey.",
"p_enter_current_pin_or_reset_no_puk": "Zadajte svoj aktuálny PIN kód. Ak nepoznáte svoj PIN kód, budete musieť YubiKey obnoviť.",
"p_enter_current_puk_or_reset": "Zadajte svoj aktuálny PUK. Ak svoj PUK nepoznáte, budete musieť YubiKey obnoviť.",
Expand Down Expand Up @@ -330,8 +336,14 @@
"p_pin_required_desc": "Akcia, ktorú sa chystáte vykonať, vyžaduje zadanie kódu PIV PIN.",
"l_piv_pin_blocked": "Zablokované, na obnovenie použite PUK",
"l_piv_pin_puk_blocked": "Zablokované, je potrebné obnovenie výrobných nastavení",
"p_enter_new_piv_pin_puk": "Zadajte nový {name}, ktorý chcete nastaviť. Musí mať dĺžku aspoň {length} znakov.",
"p_enter_new_piv_pin_puk": null,
"@p_enter_new_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_new_piv_pin_puk_desc": null,
"@p_enter_new_piv_pin_puk_desc": {
"placeholders": {
"name": {},
"length": {}
Expand Down
14 changes: 13 additions & 1 deletion lib/l10n/app_vi.arb
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@
"l_unlock_pin_first": "Mở khóa bằng Mã PIN",
"l_pin_soft_locked": "Mã PIN đã bị khóa cho đến khi YubiKey được tháo ra và cắm lại",
"l_pin_change_required_desc": "Cần thiết lập một Mã PIN mới trước khi bạn có thể sử dụng ứng dụng này",
"p_enter_current_pin_or_puk": null,
"@p_enter_current_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_current_pin_or_reset": "Nhập Mã PIN hiện tại của bạn. Nếu bạn không biết Mã PIN, bạn sẽ cần phải mở khóa bằng Mã PUK hoặc khôi phục cài đặt gốc YubiKey.",
"p_enter_current_pin_or_reset_no_puk": "Nhập Mã PIN hiện tại của bạn. Nếu bạn không biết Mã PIN, bạn sẽ cần phải khôi phục cài đặt gốc YubiKey.",
"p_enter_current_puk_or_reset": "Nhập Mã PUK hiện tại của bạn. Nếu bạn không biết Mã PUK, bạn sẽ cần phải khôi phục cài đặt gốc YubiKey.",
Expand Down Expand Up @@ -330,8 +336,14 @@
"p_pin_required_desc": "Hành động bạn sắp thực hiện yêu cầu phải nhập Mã PIN PIV.",
"l_piv_pin_blocked": "Bị khóa, sử dụng PUK để khôi phục",
"l_piv_pin_puk_blocked": "Bị khóa, cần khôi phục cài đặt gốc",
"p_enter_new_piv_pin_puk": "Nhập một {name} mới để thiết lập. Phải có ít nhất {length} ký tự.",
"p_enter_new_piv_pin_puk": null,
"@p_enter_new_piv_pin_puk": {
"placeholders": {
"name": {}
}
},
"p_enter_new_piv_pin_puk_desc": null,
"@p_enter_new_piv_pin_puk_desc": {
"placeholders": {
"name": {},
"length": {}
Expand Down
29 changes: 20 additions & 9 deletions lib/piv/views/manage_pin_puk_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,8 @@ class _ManagePinPukDialogState extends ConsumerState<ManagePinPukDialog> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(widget.target == ManageTarget.pin
? l10n.p_enter_current_pin_or_reset
: l10n.p_enter_current_puk_or_reset),
Text(l10n.p_enter_current_pin_or_puk(
widget.target == ManageTarget.pin ? l10n.s_pin : l10n.s_puk)),
AppTextField(
autofocus: !(showDefaultPinUsed || showDefaultPukUsed),
obscureText: _isObscureCurrent,
Expand Down Expand Up @@ -227,7 +226,7 @@ class _ManagePinPukDialogState extends ConsumerState<ManagePinPukDialog> {
_attemptsRemaining))
: null),
errorMaxLines: 3,
prefixIcon: const Icon(Symbols.password),
icon: const Icon(Symbols.password),
suffixIcon: IconButton(
icon: Icon(_isObscureCurrent
? Symbols.visibility
Expand All @@ -254,9 +253,9 @@ class _ManagePinPukDialogState extends ConsumerState<ManagePinPukDialog> {
widget.target == ManageTarget.puk ? l10n.s_puk : l10n.s_pin,
newMinPinLen,
'123456')
: l10n.p_enter_new_piv_pin_puk(
widget.target == ManageTarget.puk ? l10n.s_puk : l10n.s_pin,
newMinPinLen)),
: l10n.p_enter_new_piv_pin_puk(widget.target == ManageTarget.puk
? l10n.s_puk
: l10n.s_pin)),
AppTextField(
key: keys.newPinPukField,
autofocus: showDefaultPinUsed || showDefaultPukUsed,
Expand All @@ -269,11 +268,23 @@ class _ManagePinPukDialogState extends ConsumerState<ManagePinPukDialog> {
autofillHints: const [AutofillHints.newPassword],
decoration: AppInputDecoration(
border: const OutlineInputBorder(),
helperText: hasPinComplexity
? l10n.p_enter_new_piv_pin_puk_complexity_active(
widget.target == ManageTarget.puk
? l10n.s_puk
: l10n.s_pin,
newMinPinLen,
'123456')
: l10n.p_enter_new_piv_pin_puk_desc(
widget.target == ManageTarget.puk
? l10n.s_puk
: l10n.s_pin,
newMinPinLen),
labelText: widget.target == ManageTarget.puk
? l10n.s_new_puk
: l10n.s_new_pin,
errorText: _newIsWrong ? _newPinError : null,
prefixIcon: const Icon(Symbols.password),
icon: const Icon(Symbols.password),
suffixIcon: IconButton(
icon: Icon(_isObscureNew
? Symbols.visibility
Expand Down Expand Up @@ -314,7 +325,7 @@ class _ManagePinPukDialogState extends ConsumerState<ManagePinPukDialog> {
labelText: widget.target == ManageTarget.puk
? l10n.s_confirm_puk
: l10n.s_confirm_pin,
prefixIcon: const Icon(Symbols.password),
icon: const Icon(Symbols.password),
suffixIcon: IconButton(
icon: Icon(_isObscureConfirm
? Symbols.visibility
Expand Down

0 comments on commit 331d4c3

Please sign in to comment.