diff --git a/.changeset/lovely-masks-relax.md b/.changeset/lovely-masks-relax.md new file mode 100644 index 000000000..b7ddbc9da --- /dev/null +++ b/.changeset/lovely-masks-relax.md @@ -0,0 +1,7 @@ +--- +"@logto/phrases-experience": patch +"@logto/core-kit": patch +"@logto/experience": patch +--- + +fix a bug that prevents user from customizing i18n translations in Sign-in Experience config diff --git a/packages/phrases-experience/README.md b/packages/phrases-experience/README.md index 230ee6968..06e819aa3 100644 --- a/packages/phrases-experience/README.md +++ b/packages/phrases-experience/README.md @@ -1,3 +1,7 @@ # `@logto/phrases-experience` See [the main README](../../README.md) for more information. + +## Caveats + +Dots (`.`) are not allowed in the phrase keys. Despite i18next supporting them, they may cause issues when customizing the phrases in the Console. See [this pull request](https://github.com/logto-io/logto/pull/4565) for more information. diff --git a/packages/phrases-experience/src/locales/de/description.ts b/packages/phrases-experience/src/locales/de/description.ts index 24062a0cf..228efbf31 100644 --- a/packages/phrases-experience/src/locales/de/description.ts +++ b/packages/phrases-experience/src/locales/de/description.ts @@ -63,12 +63,14 @@ const description = { verify_email: 'Bestätige deine E-Mail-Adresse', verify_phone: 'Bestätige deine Telefonnummer', password_requirements: 'Passwort {{items, list}}.', - 'password_requirement.length_one': 'erfordert mindestens {{count}} Zeichen', - 'password_requirement.length_other': 'erfordert mindestens {{count}} Zeichen', - 'password_requirement.character_types_one': - 'sollte mindestens {{count}} Kategorie der folgenden Zeichenarten enthalten: Großbuchstaben, Kleinbuchstaben, Zahlen und Symbole', - 'password_requirement.character_types_other': - 'sollte mindestens {{count}} Kategorien der folgenden Zeichenarten enthalten: Großbuchstaben, Kleinbuchstaben, Zahlen und Symbole', + password_requirement: { + length_one: 'erfordert mindestens {{count}} Zeichen', + length_other: 'erfordert mindestens {{count}} Zeichen', + character_types_one: + 'sollte mindestens {{count}} Kategorie der folgenden Zeichenarten enthalten: Großbuchstaben, Kleinbuchstaben, Zahlen und Symbole', + character_types_other: + 'sollte mindestens {{count}} Kategorien der folgenden Zeichenarten enthalten: Großbuchstaben, Kleinbuchstaben, Zahlen und Symbole', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/de/error/password-rejected.ts b/packages/phrases-experience/src/locales/de/error/password-rejected.ts index b2234df8d..f31c918ca 100644 --- a/packages/phrases-experience/src/locales/de/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/de/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: 'Nicht unterstütztes Zeichen gefunden.', pwned: 'Verwenden Sie keine einfachen Passwörter, die leicht zu erraten sind.', restricted_found: 'Vermeiden Sie übermäßigen Gebrauch von {{list, list}}.', - 'restricted.repetition': 'wiederholte Zeichen', - 'restricted.sequence': 'sequenzielle Zeichen', - 'restricted.user_info': 'Ihre persönlichen Informationen', - 'restricted.words': 'Produktkontext', + restricted: { + repetition: 'wiederholte Zeichen', + sequence: 'sequenzielle Zeichen', + user_info: 'Ihre persönlichen Informationen', + words: 'Produktkontext', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases-experience/src/locales/en/description.ts b/packages/phrases-experience/src/locales/en/description.ts index 3772af7e0..b23f0807c 100644 --- a/packages/phrases-experience/src/locales/en/description.ts +++ b/packages/phrases-experience/src/locales/en/description.ts @@ -60,12 +60,14 @@ const description = { verify_email: 'Verify your email', verify_phone: 'Verify your phone number', password_requirements: 'Password {{items, list}}.', - 'password_requirement.length_one': 'requires a minimum of {{count}} character', - 'password_requirement.length_other': 'requires a minimum of {{count}} characters', - 'password_requirement.character_types_one': - 'should contain at least {{count}} type of uppercase letters, lowercase letters, digits, and symbols', - 'password_requirement.character_types_other': - 'should contain at least {{count}} types of uppercase letters, lowercase letters, digits, and symbols', + password_requirement: { + length_one: 'requires a minimum of {{count}} character', + length_other: 'requires a minimum of {{count}} characters', + character_types_one: + 'should contain at least {{count}} type of uppercase letters, lowercase letters, digits, and symbols', + character_types_other: + 'should contain at least {{count}} types of uppercase letters, lowercase letters, digits, and symbols', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/en/error/password-rejected.ts b/packages/phrases-experience/src/locales/en/error/password-rejected.ts index 36d3f2b27..8ace7df15 100644 --- a/packages/phrases-experience/src/locales/en/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/en/error/password-rejected.ts @@ -1,5 +1,13 @@ import { type PasswordRejectionCode } from '@logto/core-kit'; +type BreakdownKeysToObject = { + [K in Key as K extends `${infer A}.${string}` ? A : K]: K extends `${string}.${infer B}` + ? BreakdownKeysToObject + : string; +}; + +type RejectionPhrases = BreakdownKeysToObject; + const password_rejected = { too_short: 'Minimum length is {{min}}.', too_long: 'Maximum length is {{max}}.', @@ -7,11 +15,13 @@ const password_rejected = { unsupported_characters: 'Unsupported character found.', pwned: 'Avoid using simple passwords that are easy to guess.', restricted_found: 'Avoid overusing {{list, list}}.', - 'restricted.repetition': 'repeated characters', - 'restricted.sequence': 'sequential characters', - 'restricted.user_info': 'your personal information', - 'restricted.words': 'product context', -} satisfies Record & { + restricted: { + repetition: 'repeated characters', + sequence: 'sequential characters', + user_info: 'your personal information', + words: 'product context', + }, +} satisfies RejectionPhrases & { // Use for displaying a list of restricted issues restricted_found: string; }; diff --git a/packages/phrases-experience/src/locales/es/description.ts b/packages/phrases-experience/src/locales/es/description.ts index 3425b357b..5d4397e42 100644 --- a/packages/phrases-experience/src/locales/es/description.ts +++ b/packages/phrases-experience/src/locales/es/description.ts @@ -61,12 +61,14 @@ const description = { verify_email: 'Verificar su correo electrónico', verify_phone: 'Verificar su número de teléfono', password_requirements: 'Contraseña {{items, lista}}.', - 'password_requirement.length_one': 'requiere un mínimo de {{count}} carácter', - 'password_requirement.length_other': 'requiere un mínimo de {{count}} caracteres', - 'password_requirement.character_types_one': - 'debe contener al menos {{count}} tipo de letras mayúsculas, letras minúsculas, dígitos y símbolos', - 'password_requirement.character_types_other': - 'debe contener al menos {{count}} tipos de letras mayúsculas, letras minúsculas, dígitos y símbolos', + password_requirement: { + length_one: 'requiere un mínimo de {{count}} carácter', + length_other: 'requiere un mínimo de {{count}} caracteres', + character_types_one: + 'debe contener al menos {{count}} tipo de letras mayúsculas, letras minúsculas, dígitos y símbolos', + character_types_other: + 'debe contener al menos {{count}} tipos de letras mayúsculas, letras minúsculas, dígitos y símbolos', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/es/error/password-rejected.ts b/packages/phrases-experience/src/locales/es/error/password-rejected.ts index 138124752..8bde018e5 100644 --- a/packages/phrases-experience/src/locales/es/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/es/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: 'Se encontró un carácter no admitido.', pwned: 'Evite usar contraseñas simples que sean fáciles de adivinar.', restricted_found: 'Evite utilizar en exceso {{list, list}}.', - 'restricted.repetition': 'caracteres repetidos', - 'restricted.sequence': 'caracteres secuenciales', - 'restricted.user_info': 'su información personal', - 'restricted.words': 'contexto del producto', + restricted: { + repetition: 'caracteres repetidos', + sequence: 'caracteres secuenciales', + user_info: 'su información personal', + words: 'contexto del producto', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases-experience/src/locales/fr/description.ts b/packages/phrases-experience/src/locales/fr/description.ts index d67dc06ce..7fb55eaa5 100644 --- a/packages/phrases-experience/src/locales/fr/description.ts +++ b/packages/phrases-experience/src/locales/fr/description.ts @@ -63,12 +63,14 @@ const description = { verify_email: 'Vérifiez votre e-mail', verify_phone: 'Vérifiez votre numéro de téléphone', password_requirements: 'Mot de passe {{items, list}}.', - 'password_requirement.length_one': 'doit contenir au minimum {{count}} caractère', - 'password_requirement.length_other': 'doit contenir au minimum {{count}} caractères', - 'password_requirement.character_types_one': - 'doit contenir au moins {{count}} type de lettres majuscules, lettres minuscules, chiffres et symboles', - 'password_requirement.character_types_other': - 'doit contenir au moins {{count}} types de lettres majuscules, lettres minuscules, chiffres et symboles', + password_requirement: { + length_one: 'doit contenir au minimum {{count}} caractère', + length_other: 'doit contenir au minimum {{count}} caractères', + character_types_one: + 'doit contenir au moins {{count}} type de lettres majuscules, lettres minuscules, chiffres et symboles', + character_types_other: + 'doit contenir au moins {{count}} types de lettres majuscules, lettres minuscules, chiffres et symboles', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/fr/error/password-rejected.ts b/packages/phrases-experience/src/locales/fr/error/password-rejected.ts index cb48ca053..d0f7f2547 100644 --- a/packages/phrases-experience/src/locales/fr/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/fr/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: 'Caractère non supporté trouvé.', pwned: "Évitez d'utiliser des mots de passe simples faciles à deviner.", restricted_found: "Évitez d'utiliser de manière excessive {{list, list}}.", - 'restricted.repetition': 'caractères répétés', - 'restricted.sequence': 'caractères séquentiels', - 'restricted.user_info': 'vos informations personnelles', - 'restricted.words': 'contexte produit', + restricted: { + repetition: 'caractères répétés', + sequence: 'caractères séquentiels', + user_info: 'vos informations personnelles', + words: 'contexte produit', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases-experience/src/locales/it/description.ts b/packages/phrases-experience/src/locales/it/description.ts index 6d99c16dc..e861a652c 100644 --- a/packages/phrases-experience/src/locales/it/description.ts +++ b/packages/phrases-experience/src/locales/it/description.ts @@ -59,12 +59,14 @@ const description = { verify_email: 'Verifica la tua email', verify_phone: 'Verifica il tuo numero di telefono', password_requirements: 'Password {{items, list}}.', - 'password_requirement.length_one': 'richiede almeno {{count}} carattere', - 'password_requirement.length_other': 'richiede almeno {{count}} caratteri', - 'password_requirement.character_types_one': - 'dovrebbe contenere almeno {{count}} tipo di lettere maiuscole, lettere minuscole, numeri e simboli', - 'password_requirement.character_types_other': - 'dovrebbe contenere almeno {{count}} tipi di lettere maiuscole, lettere minuscole, numeri e simboli', + password_requirement: { + length_one: 'richiede almeno {{count}} carattere', + length_other: 'richiede almeno {{count}} caratteri', + character_types_one: + 'dovrebbe contenere almeno {{count}} tipo di lettere maiuscole, lettere minuscole, numeri e simboli', + character_types_other: + 'dovrebbe contenere almeno {{count}} tipi di lettere maiuscole, lettere minuscole, numeri e simboli', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/it/error/password-rejected.ts b/packages/phrases-experience/src/locales/it/error/password-rejected.ts index fe9b4ae37..eabdea304 100644 --- a/packages/phrases-experience/src/locales/it/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/it/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: 'Carattere non supportato trovato.', pwned: 'Evita di utilizzare password semplici facili da indovinare.', restricted_found: 'Evita di utilizzare in eccesso {{list, list}}.', - 'restricted.repetition': 'caratteri ripetuti', - 'restricted.sequence': 'caratteri sequenziali', - 'restricted.user_info': 'le tue informazioni personali', - 'restricted.words': 'contesto del prodotto', + restricted: { + repetition: 'caratteri ripetuti', + sequence: 'caratteri sequenziali', + user_info: 'le tue informazioni personali', + words: 'contesto del prodotto', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases-experience/src/locales/ja/description.ts b/packages/phrases-experience/src/locales/ja/description.ts index ce1d69fe0..c0ee7b246 100644 --- a/packages/phrases-experience/src/locales/ja/description.ts +++ b/packages/phrases-experience/src/locales/ja/description.ts @@ -61,12 +61,12 @@ const description = { verify_email: 'Eメールを確認する', verify_phone: '電話番号を確認する', password_requirements: 'パスワード {{items, list}}。', - 'password_requirement.length_one': '最低{{count}}文字', - 'password_requirement.length_other': '最低{{count}}文字', - 'password_requirement.character_types_one': - '大文字、小文字、数字、記号のうち{{count}}種類を含む必要があります', - 'password_requirement.character_types_other': - '大文字、小文字、数字、記号のうち{{count}}種類を含む必要があります', + password_requirement: { + length_one: '最低 {{count}} 文字', + length_other: '最低 {{count}} 文字', + character_types_one: '大文字、小文字、数字、記号のうち {{count}} 種類を含む必要があります', + character_types_other: '大文字、小文字、数字、記号のうち {{count}} 種類を含む必要があります', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/ja/error/password-rejected.ts b/packages/phrases-experience/src/locales/ja/error/password-rejected.ts index a5cde5d77..0be9b9576 100644 --- a/packages/phrases-experience/src/locales/ja/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/ja/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: 'サポートされていない文字が見つかりました。', pwned: '簡単に推測できる簡単なパスワードの使用を避けてください。', restricted_found: '{{list, list}}の過度な使用を避けてください。', - 'restricted.repetition': '繰り返された文字', - 'restricted.sequence': '連続する文字', - 'restricted.user_info': '個人情報', - 'restricted.words': '製品のコンテキスト', + restricted: { + repetition: '繰り返された文字', + sequence: '連続する文字', + user_info: '個人情報', + words: '製品のコンテキスト', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases-experience/src/locales/ja/list.ts b/packages/phrases-experience/src/locales/ja/list.ts index 908bda133..daa05a1be 100644 --- a/packages/phrases-experience/src/locales/ja/list.ts +++ b/packages/phrases-experience/src/locales/ja/list.ts @@ -4,6 +4,4 @@ const list = { separator: ',', }; -Object.freeze(list); - -export default list; +export default Object.freeze(list); diff --git a/packages/phrases-experience/src/locales/ko/description.ts b/packages/phrases-experience/src/locales/ko/description.ts index fb7acea07..d3b3cdf8d 100644 --- a/packages/phrases-experience/src/locales/ko/description.ts +++ b/packages/phrases-experience/src/locales/ko/description.ts @@ -55,13 +55,13 @@ const description = { no_region_code_found: '지역 코드를 찾을 수 없습니다.', verify_email: '이메일 인증', verify_phone: '휴대전화번호 인증', - password_requirements: '비밀번호는 {{items, list}}로 이루어져야 합니다.', - 'password_requirement.length_one': '최소 {{count}}자 이상이어야 함', - 'password_requirement.length_other': '최소 {{count}} 문자 이상이어야 함', - 'password_requirement.character_types_one': - '최소 {{count}}개의 대문자, 소문자, 숫자, 특수 기호를 포함해야 함', - 'password_requirement.character_types_other': - '최소 {{count}}개의 대문자, 소문자, 숫자, 특수 기호를 포함해야 함', + password_requirements: '비밀번호는 {{items, list}} 로 이루어져야 합니다.', + password_requirement: { + length_one: '최소 {{count}} 자 이상이어야 함', + length_other: '최소 {{count}} 문자 이상이어야 함', + character_types_one: '최소 {{count}} 개의 대문자, 소문자, 숫자, 특수 기호를 포함해야 함', + character_types_other: '최소 {{count}} 개의 대문자, 소문자, 숫자, 특수 기호를 포함해야 함', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/ko/error/password-rejected.ts b/packages/phrases-experience/src/locales/ko/error/password-rejected.ts index 760f8b655..da3d85393 100644 --- a/packages/phrases-experience/src/locales/ko/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/ko/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: '지원되지 않는 문자가 발견되었습니다.', pwned: '추측하기 쉬운 간단한 암호 사용을 피하십시오.', restricted_found: '{{list, list}}을(를) 과도하게 사용하지 마십시오.', - 'restricted.repetition': '반복된 문자', - 'restricted.sequence': '연속된 문자', - 'restricted.user_info': '개인 정보', - 'restricted.words': '품질 가능성', + restricted: { + repetition: '반복된 문자', + sequence: '연속된 문자', + user_info: '개인 정보', + words: '품질 가능성', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases-experience/src/locales/pl-pl/description.ts b/packages/phrases-experience/src/locales/pl-pl/description.ts index 692362770..d47f90b4a 100644 --- a/packages/phrases-experience/src/locales/pl-pl/description.ts +++ b/packages/phrases-experience/src/locales/pl-pl/description.ts @@ -59,12 +59,14 @@ const description = { verify_email: 'Potwierdź swój email', verify_phone: 'Potwierdź swój numer telefonu', password_requirements: 'Wymagania dotyczące hasła {{items, list}}.', - 'password_requirement.length_one': 'wymaga co najmniej {{count}} znaku', - 'password_requirement.length_other': 'wymaga co najmniej {{count}} znaków', - 'password_requirement.character_types_one': - 'powinno zawierać co najmniej {{count}} rodzaj liter wielkich, małych liter, cyfr i symboli', - 'password_requirement.character_types_other': - 'powinno zawierać co najmniej {{count}} rodzaje liter wielkich, małych liter, cyfr i symboli', + password_requirement: { + length_one: 'wymaga co najmniej {{count}} znaku', + length_other: 'wymaga co najmniej {{count}} znaków', + character_types_one: + 'powinno zawierać co najmniej {{count}} rodzaj liter wielkich, małych liter, cyfr i symboli', + character_types_other: + 'powinno zawierać co najmniej {{count}} rodzaje liter wielkich, małych liter, cyfr i symboli', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/pl-pl/error/password-rejected.ts b/packages/phrases-experience/src/locales/pl-pl/error/password-rejected.ts index 2704bb703..1d4e649dc 100644 --- a/packages/phrases-experience/src/locales/pl-pl/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/pl-pl/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: 'Znaleziono niedozwolony znak.', pwned: 'Unikaj używania prostych haseł, które są łatwe do odgadnięcia.', restricted_found: 'Unikaj nadużywania {{list, list}}.', - 'restricted.repetition': 'powtarzających się znaków', - 'restricted.sequence': 'sekwencyjnych znaków', - 'restricted.user_info': 'twoich informacji osobistych', - 'restricted.words': 'kontekstu produktu', + restricted: { + repetition: 'powtarzających się znaków', + sequence: 'sekwencyjnych znaków', + user_info: 'twoich informacji osobistych', + words: 'kontekstu produktu', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases-experience/src/locales/pt-br/description.ts b/packages/phrases-experience/src/locales/pt-br/description.ts index 0f056a50b..c242d80b7 100644 --- a/packages/phrases-experience/src/locales/pt-br/description.ts +++ b/packages/phrases-experience/src/locales/pt-br/description.ts @@ -58,12 +58,14 @@ const description = { verify_email: 'Verificar e-mail', verify_phone: 'Verificar número de telefone', password_requirements: 'Senha {{items, list}}.', - 'password_requirement.length_one': 'requer no mínimo 1 caractere.', - 'password_requirement.length_other': 'requer no mínimo {{count}} caracteres.', - 'password_requirement.character_types_one': - 'deve conter pelo menos 1 tipo de letra maiúscula, letra minúscula, dígito e símbolo.', - 'password_requirement.character_types_other': - 'deve conter pelo menos {{count}} tipos de letra maiúscula, letra minúscula, dígito e símbolo.', + password_requirement: { + length_one: 'requer no mínimo 1 caractere.', + length_other: 'requer no mínimo {{count}} caracteres.', + character_types_one: + 'deve conter pelo menos 1 tipo de letra maiúscula, letra minúscula, dígito e símbolo.', + character_types_other: + 'deve conter pelo menos {{count}} tipos de letra maiúscula, letra minúscula, dígito e símbolo.', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/pt-br/error/password-rejected.ts b/packages/phrases-experience/src/locales/pt-br/error/password-rejected.ts index bab0893d6..f367cfa70 100644 --- a/packages/phrases-experience/src/locales/pt-br/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/pt-br/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: 'Caractere não suportado encontrado.', pwned: 'Evite o uso de senhas simples que são fáceis de adivinhar.', restricted_found: 'Evite usar em excesso {{list, list}}.', - 'restricted.repetition': 'caracteres repetidos', - 'restricted.sequence': 'caracteres sequenciais', - 'restricted.user_info': 'suas informações pessoais', - 'restricted.words': 'contexto do produto', + restricted: { + repetition: 'caracteres repetidos', + sequence: 'caracteres sequenciais', + user_info: 'suas informações pessoais', + words: 'contexto do produto', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases-experience/src/locales/pt-pt/description.ts b/packages/phrases-experience/src/locales/pt-pt/description.ts index a7f73d78c..11faa3b2f 100644 --- a/packages/phrases-experience/src/locales/pt-pt/description.ts +++ b/packages/phrases-experience/src/locales/pt-pt/description.ts @@ -58,12 +58,14 @@ const description = { verify_email: 'Verifique o seu email', verify_phone: 'Verifique o seu número de telefone', password_requirements: 'Requisitos de senha {{items, list}}.', - 'password_requirement.length_one': 'requer um mínimo de {{count}} caracter', - 'password_requirement.length_other': 'requer um mínimo de {{count}} caracteres', - 'password_requirement.character_types_one': - 'deve conter pelo menos {{count}} tipo de letras maiúsculas, letras minúsculas, dígitos e símbolos', - 'password_requirement.character_types_other': - 'deve conter pelo menos {{count}} tipos de letras maiúsculas, letras minúsculas, dígitos e símbolos', + password_requirement: { + length_one: 'requer um mínimo de {{count}} caracter', + length_other: 'requer um mínimo de {{count}} caracteres', + character_types_one: + 'deve conter pelo menos {{count}} tipo de letras maiúsculas, letras minúsculas, dígitos e símbolos', + character_types_other: + 'deve conter pelo menos {{count}} tipos de letras maiúsculas, letras minúsculas, dígitos e símbolos', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/pt-pt/error/password-rejected.ts b/packages/phrases-experience/src/locales/pt-pt/error/password-rejected.ts index 403dbb18a..24cf78bb4 100644 --- a/packages/phrases-experience/src/locales/pt-pt/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/pt-pt/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: 'Caractere não suportado encontrado.', pwned: 'Evite o uso de senhas simples que são fáceis de adivinhar.', restricted_found: 'Evite o uso excessivo de {{list, list}}.', - 'restricted.repetition': 'caracteres repetidos', - 'restricted.sequence': 'caracteres sequenciais', - 'restricted.user_info': 'suas informações pessoais', - 'restricted.words': 'contexto do produto', + restricted: { + repetition: 'caracteres repetidos', + sequence: 'caracteres sequenciais', + user_info: 'suas informações pessoais', + words: 'contexto do produto', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases-experience/src/locales/ru/description.ts b/packages/phrases-experience/src/locales/ru/description.ts index 758c10422..b5ffc4579 100644 --- a/packages/phrases-experience/src/locales/ru/description.ts +++ b/packages/phrases-experience/src/locales/ru/description.ts @@ -62,12 +62,14 @@ const description = { verify_email: 'Подтвердите Ваш электронный адрес', verify_phone: 'Подтвердите свой номер телефона', password_requirements: 'Требования к паролю {{items, list}}.', - 'password_requirement.length_one': 'требуется минимум {{count}} символ', - 'password_requirement.length_other': 'требуется минимум {{count}} символов', - 'password_requirement.character_types_one': - 'должен содержать по крайней мере {{count}} тип прописных букв, строчных букв, цифр и символов', - 'password_requirement.character_types_other': - 'должен содержать по крайней мере {{count}} типа прописных букв, строчных букв, цифр и символов', + password_requirement: { + length_one: 'требуется минимум {{count}} символ', + length_other: 'требуется минимум {{count}} символов', + character_types_one: + 'должен содержать по крайней мере {{count}} тип прописных букв, строчных букв, цифр и символов', + character_types_other: + 'должен содержать по крайней мере {{count}} типа прописных букв, строчных букв, цифр и символов', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/ru/error/password-rejected.ts b/packages/phrases-experience/src/locales/ru/error/password-rejected.ts index 2c4f86c0b..e0c904505 100644 --- a/packages/phrases-experience/src/locales/ru/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/ru/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: 'Найден неподдерживаемый символ.', pwned: 'Избегайте использования простых паролей, которые легко угадать.', restricted_found: 'Избегайте чрезмерного использования {{list,list}}.', - 'restricted.repetition': 'повторяющиеся символы', - 'restricted.sequence': 'последовательные символы', - 'restricted.user_info': 'ваши личные данные', - 'restricted.words': 'контекст продукта', + restricted: { + repetition: 'повторяющиеся символы', + sequence: 'последовательные символы', + user_info: 'ваши личные данные', + words: 'контекст продукта', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases-experience/src/locales/tr-tr/description.ts b/packages/phrases-experience/src/locales/tr-tr/description.ts index 79dfc7c56..f5ba7cae3 100644 --- a/packages/phrases-experience/src/locales/tr-tr/description.ts +++ b/packages/phrases-experience/src/locales/tr-tr/description.ts @@ -59,12 +59,13 @@ const description = { verify_email: 'E-postanızın doğrulanması', verify_phone: 'Telefon numaranızın doğrulanması', password_requirements: 'Şifre {{items, list}}.', - 'password_requirement.length_one': 'en az {{count}} karakter gerektirir', - 'password_requirement.length_other': 'en az {{count}} karakter gerektirir', - 'password_requirement.character_types_one': - 'en az {{count}} tane büyük harf, küçük harf, rakam ve sembol içermelidir', - 'password_requirement.character_types_other': - 'en az {{count}} tane büyük harf, küçük harf, rakam ve sembol içermelidir', + password_requirement: { + length_one: 'en az {{count}} karakter gerektirir', + length_other: 'en az {{count}} karakter gerektirir', + character_types_one: 'en az {{count}} tane büyük harf, küçük harf, rakam ve sembol içermelidir', + character_types_other: + 'en az {{count}} tane büyük harf, küçük harf, rakam ve sembol içermelidir', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/tr-tr/error/password-rejected.ts b/packages/phrases-experience/src/locales/tr-tr/error/password-rejected.ts index 5ed0cf713..08eda65a6 100644 --- a/packages/phrases-experience/src/locales/tr-tr/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/tr-tr/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: 'Desteklenmeyen karakter bulundu.', pwned: 'Kolayca tahmin edilebilen basit şifreleri kullanmaktan kaçının.', restricted_found: '{{list, list}} fazla kullanımdan kaçının.', - 'restricted.repetition': 'tekrarlanan karakterler', - 'restricted.sequence': 'dizisel karakterler', - 'restricted.user_info': 'kişisel bilgileriniz', - 'restricted.words': 'ürünle ilgili terimler', + restricted: { + repetition: 'tekrarlanan karakterler', + sequence: 'dizisel karakterler', + user_info: 'kişisel bilgileriniz', + words: 'ürünle ilgili terimler', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases-experience/src/locales/zh-cn/description.ts b/packages/phrases-experience/src/locales/zh-cn/description.ts index d56e0e6b0..e1cf1d1ce 100644 --- a/packages/phrases-experience/src/locales/zh-cn/description.ts +++ b/packages/phrases-experience/src/locales/zh-cn/description.ts @@ -52,11 +52,12 @@ const description = { verify_email: '验证你的邮箱', verify_phone: '验证你的手机号', password_requirements: '密码 {{items, list}}。', - 'password_requirement.length_one': '应至少有{{count}}个字符', - 'password_requirement.length_other': '应至少有{{count}}个字符', - 'password_requirement.character_types_one': '应包含至少{{count}}种大写字母、小写字母、数字和符号', - 'password_requirement.character_types_other': - '应包含至少{{count}}种大写字母、小写字母、数字和符号', + password_requirement: { + length_one: '应至少有 {{count}} 个字符', + length_other: '应至少有 {{count}} 个字符', + character_types_one: '应包含至少 {{count}} 种大写字母、小写字母、数字和符号', + character_types_other: '应包含至少 {{count}} 种大写字母、小写字母、数字和符号', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/zh-cn/error/password-rejected.ts b/packages/phrases-experience/src/locales/zh-cn/error/password-rejected.ts index a08f83c1d..7e122d206 100644 --- a/packages/phrases-experience/src/locales/zh-cn/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/zh-cn/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: '发现不支持的字符。', pwned: '避免使用容易被猜到的简单密码。', restricted_found: '避免过度使用{{list, list}}。', - 'restricted.repetition': '重复字符', - 'restricted.sequence': '连续字符', - 'restricted.user_info': '您的个人信息', - 'restricted.words': '产品上下文', + restricted: { + repetition: '重复字符', + sequence: '连续字符', + user_info: '您的个人信息', + words: '产品上下文', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases-experience/src/locales/zh-hk/description.ts b/packages/phrases-experience/src/locales/zh-hk/description.ts index 990b2b07f..dc9313d4b 100644 --- a/packages/phrases-experience/src/locales/zh-hk/description.ts +++ b/packages/phrases-experience/src/locales/zh-hk/description.ts @@ -52,12 +52,12 @@ const description = { verify_email: '驗證你的郵箱', verify_phone: '驗證你的手機號', password_requirements: '要求密碼 {{items, list}}。', - 'password_requirement.length_one': '要求至少{{count}}個字符', - 'password_requirement.length_other': '要求至少{{count}}個字符', - 'password_requirement.character_types_one': - '要求包含至少{{count}}類型的大寫字母,小寫字母,數字和符號', - 'password_requirement.character_types_other': - '要求包含至少{{count}}類型的大寫字母,小寫字母,數字和符號', + password_requirement: { + length_one: '要求至少 {{count}} 個字符', + length_other: '要求至少 {{count}} 個字符', + character_types_one: '要求包含至少 {{count}} 類型的大寫字母,小寫字母,數字和符號', + character_types_other: '要求包含至少 {{count}} 類型的大寫字母,小寫字母,數字和符號', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/zh-hk/error/password-rejected.ts b/packages/phrases-experience/src/locales/zh-hk/error/password-rejected.ts index 7b1270e23..0d930d0c7 100644 --- a/packages/phrases-experience/src/locales/zh-hk/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/zh-hk/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: '發現不支援的字符。', pwned: '避免使用容易猜測的簡單密碼。', restricted_found: '避免過度使用{{list, list}}。', - 'restricted.repetition': '重複的字符', - 'restricted.sequence': '連續的字符', - 'restricted.user_info': '個人資訊', - 'restricted.words': '產品上下文', + restricted: { + repetition: '重複的字符', + sequence: '連續的字符', + user_info: '個人資訊', + words: '產品上下文', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases-experience/src/locales/zh-tw/description.ts b/packages/phrases-experience/src/locales/zh-tw/description.ts index 57e6491dc..8d3d16ecd 100644 --- a/packages/phrases-experience/src/locales/zh-tw/description.ts +++ b/packages/phrases-experience/src/locales/zh-tw/description.ts @@ -5,21 +5,21 @@ const description = { reminder: '提示', not_found: '404 頁面不存在', agree_with_terms: '我已閱讀並同意 ', - agree_with_terms_modal: '請先同意 以繼續', + agree_with_terms_modal: '請先同意以繼續', terms_of_use: '使用條款', sign_in: '登錄', privacy_policy: '隱私政策', create_account: '創建帳號', or: '或', and: '和', - enter_passcode: '驗證碼已經發送至你的{{ address }} {{target}}', + enter_passcode: '驗證碼已經發送至你的{{address}} {{target}}', passcode_sent: '驗證碼已經發送', - resend_after_seconds: '在 {{ seconds }} 秒後重新發送', + resend_after_seconds: '在 {{seconds}} 秒後重新發送', resend_passcode: '重新發送驗證碼', - create_account_id_exists: '{{type}}為 {{value}} 的帳號已存在,你要登錄嗎?', - link_account_id_exists: ' {{type}}為 {{value}} 的帳號已註冊,你要綁定至這個帳號嗎?', - sign_in_id_does_not_exist: '{{type}}為 {{value}} 的帳號不存在,你要創建一個新帳號嗎?', - sign_in_id_does_not_exist_alert: '{{type}}為 {{value}} 的帳號不存在。', + create_account_id_exists: '{{type}} 為 {{value}} 的帳號已存在,你要登錄嗎?', + link_account_id_exists: ' {{type}} 為 {{value}} 的帳號已註冊,你要綁定至這個帳號嗎?', + sign_in_id_does_not_exist: '{{type}} 為 {{value}} 的帳號不存在,你要創建一個新帳號嗎?', + sign_in_id_does_not_exist_alert: '{{type}} 為 {{value}} 的帳號不存在。', create_account_id_exists_alert: '{{type}} {{value}} 已綁定其他帳號。請嘗試其他{{type}}。', social_identity_exist: ' {{type}} {{value}} 已綁定其他帳號。請嘗試其他{{type}}', bind_account_title: '綁定或註冊帳號', @@ -36,7 +36,7 @@ const description = { no_account: '還沒有帳號?', have_account: ' 已有帳號?', enter_password: '輸入密碼', - enter_password_for: '輸入{{method}} {{value}} 對應的密碼進行登錄', + enter_password_for: '輸入{{method}} {{value}}對應的密碼進行登錄', enter_username: '設置用戶名', enter_username_description: '用戶名可以用來進行登錄。用戶名僅可以包含字母、數字和下劃線。', link_email: '綁定郵箱', @@ -52,11 +52,12 @@ const description = { verify_email: '驗證你的郵箱', verify_phone: '驗證你的手機號碼', password_requirements: '密碼{{items, list}}。', - 'password_requirement.length_one': '長度至少為{{count}}個字符', - 'password_requirement.length_other': '長度至少為{{count}}個字符', - 'password_requirement.character_types_one': '需包含{{count}}類型的大寫字母、小寫字母、數字和符號', - 'password_requirement.character_types_other': - '需包含{{count}}類型的大寫字母、小寫字母、數字和符號', + password_requirement: { + length_one: '長度至少為 {{count}} 個字符', + length_other: '長度至少為 {{count}} 個字符', + character_types_one: '需包含 {{count}} 類型的大寫字母、小寫字母、數字和符號', + character_types_other: '需包含 {{count}} 類型的大寫字母、小寫字母、數字和符號', + }, }; export default Object.freeze(description); diff --git a/packages/phrases-experience/src/locales/zh-tw/error/password-rejected.ts b/packages/phrases-experience/src/locales/zh-tw/error/password-rejected.ts index ac8fe35b4..1dcf727e2 100644 --- a/packages/phrases-experience/src/locales/zh-tw/error/password-rejected.ts +++ b/packages/phrases-experience/src/locales/zh-tw/error/password-rejected.ts @@ -5,10 +5,12 @@ const password_rejected = { unsupported_characters: '發現不支援的字元。', pwned: '請避免使用容易被猜中的簡單密碼。', restricted_found: '請避免過度使用 {{list, list}}。', - 'restricted.repetition': '連續重複的字元', - 'restricted.sequence': '連續的字元', - 'restricted.user_info': '個人資訊', - 'restricted.words': '使用產品相關的字詞', + restricted: { + repetition: '連續重複的字元', + sequence: '連續的字元', + user_info: '個人資訊', + words: '使用產品相關的字詞', + }, }; export default Object.freeze(password_rejected); diff --git a/packages/phrases/README.md b/packages/phrases/README.md index 162a5718a..753ab982a 100644 --- a/packages/phrases/README.md +++ b/packages/phrases/README.md @@ -1,11 +1,7 @@ # `@logto/phrases` -> TODO: description +See [the main README](../../README.md) for more information. -## Usage +## Caveats -``` -const phrases = require('@logto/phrases'); - -// TODO: DEMONSTRATE API -``` +Dots (`.`) are not allowed in the phrase keys. Despite i18next supporting them, they may cause issues when customizing the phrases in the Console. See [this pull request](https://github.com/logto-io/logto/pull/4565) for more information.