Skip to content

Commit

Permalink
chore: move authenticators name to localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-ajax committed Jan 15, 2025
1 parent e4f0b0e commit 0209b56
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: ice License 1.0

import 'package:flutter/material.dart';
import 'package:ion/app/extensions/build_context.dart';
import 'package:ion/generated/assets.gen.dart';

enum AuthenticatorType {
Expand All @@ -10,15 +11,13 @@ enum AuthenticatorType {
authy,
userLockPush;

String getDisplayName(BuildContext context) {
return switch (this) {
AuthenticatorType.google => 'Google Authenticator',
AuthenticatorType.microsoft => 'Microsoft Authenticator',
AuthenticatorType.lastpass => 'LastPass Authenticator',
AuthenticatorType.authy => 'Authy',
AuthenticatorType.userLockPush => 'UserLock Push',
};
}
String getDisplayName(BuildContext context) => switch (this) {
AuthenticatorType.google => context.i18n.authenticator_google,
AuthenticatorType.microsoft => context.i18n.authenticator_microsoft,
AuthenticatorType.lastpass => context.i18n.authenticator_lastpass,
AuthenticatorType.authy => context.i18n.authenticator_authy,
AuthenticatorType.userLockPush => context.i18n.authenticator_userLockPush,
};

String get iconAsset {
return switch (this) {
Expand Down
5 changes: 5 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,11 @@
"authenticator_delete_title": "Deleting an authenticator",
"authenticator_delete_description": "To delete the authenticator, you must confirm by selecting the options first",
"authenticator_has_deleted": "The authenticator was successfully deleted",
"authenticator_google": "Google Authenticator",
"authenticator_microsoft": "Microsoft Authenticator",
"authenticator_authy": "Authy",
"authenticator_lastpass": "LastPass Authenticator",
"authenticator_userLockPush": "UserLock Push",
"follow_instructions_title": "Follow instructions",
"follow_instructions_description": "Copy the installation key and paste it into your Authentication application",
"confirm_the_code_title": "Confirm the code",
Expand Down

0 comments on commit 0209b56

Please sign in to comment.