0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

fix: correct error messages (#2656)

This commit is contained in:
Darcy Ye 2022-12-14 11:38:53 +08:00 committed by GitHub
parent d111e5d407
commit a134ea14b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 32 additions and 24 deletions

View file

@ -130,11 +130,11 @@ export default function connectorRoutes<T extends AuthedRouter>(router: T) {
assertThat( assertThat(
connectorFactory.metadata.isStandard !== true || metadata?.target, connectorFactory.metadata.isStandard !== true || metadata?.target,
'connector.can_not_modify_target' 'connector.should_specify_target'
); );
assertThat( assertThat(
connectorFactory.metadata.isStandard === true || metadata === undefined, connectorFactory.metadata.isStandard === true || metadata === undefined,
'connector.cannot_change_metadata_for_non_standard_connector' 'connector.cannot_overwrite_metadata_for_non_standard_connector'
); );
const { count } = await countConnectorByConnectorId(connectorId); const { count } = await countConnectorByConnectorId(connectorId);
@ -215,7 +215,7 @@ export default function connectorRoutes<T extends AuthedRouter>(router: T) {
assertThat( assertThat(
originalMetadata.isStandard === true || metadata === undefined, originalMetadata.isStandard === true || metadata === undefined,
'connector.cannot_change_metadata_for_non_standard_connector' 'connector.cannot_overwrite_metadata_for_non_standard_connector'
); );
if (syncProfile) { if (syncProfile) {

View file

@ -109,11 +109,12 @@ const errors = {
multiple_instances_not_supported: multiple_instances_not_supported:
'Can not create multiple instance with picked standard connector.', 'Can not create multiple instance with picked standard connector.',
invalid_type_for_syncing_profile: 'You can only sync user profile with social connectors.', invalid_type_for_syncing_profile: 'You can only sync user profile with social connectors.',
can_not_modify_target: 'The connector target can not be modified.', can_not_modify_target: "The connector 'target' can not be modified.",
should_specify_target: "You should specify 'target'.",
multiple_target_with_same_platform: multiple_target_with_same_platform:
'You can not have multiple social connectors that have same target and platform.', 'You can not have multiple social connectors that have same target and platform.',
cannot_change_metadata_for_non_standard_connector: cannot_overwrite_metadata_for_non_standard_connector:
"This connector's `metadata` cannot be changed.", "This connector's 'metadata' cannot be overwritten.",
}, },
passcode: { passcode: {
phone_email_empty: 'Telefonnummer oder E-Mail darf nicht leer sein.', phone_email_empty: 'Telefonnummer oder E-Mail darf nicht leer sein.',

View file

@ -108,11 +108,12 @@ const errors = {
multiple_instances_not_supported: multiple_instances_not_supported:
'Can not create multiple instance with picked standard connector.', 'Can not create multiple instance with picked standard connector.',
invalid_type_for_syncing_profile: 'You can only sync user profile with social connectors.', invalid_type_for_syncing_profile: 'You can only sync user profile with social connectors.',
can_not_modify_target: 'The connector target can not be modified.', can_not_modify_target: "The connector 'target' can not be modified.",
should_specify_target: "You should specify 'target'.",
multiple_target_with_same_platform: multiple_target_with_same_platform:
'You can not have multiple social connectors that have same target and platform.', 'You can not have multiple social connectors that have same target and platform.',
cannot_change_metadata_for_non_standard_connector: cannot_overwrite_metadata_for_non_standard_connector:
"This connector's `metadata` cannot be changed.", "This connector's 'metadata' cannot be overwritten.",
}, },
passcode: { passcode: {
phone_email_empty: 'Both phone and email are empty.', phone_email_empty: 'Both phone and email are empty.',

View file

@ -115,11 +115,12 @@ const errors = {
multiple_instances_not_supported: multiple_instances_not_supported:
'Can not create multiple instance with picked standard connector.', // UNTRANSLATED 'Can not create multiple instance with picked standard connector.', // UNTRANSLATED
invalid_type_for_syncing_profile: 'You can only sync user profile with social connectors.', // UNTRANSLATED invalid_type_for_syncing_profile: 'You can only sync user profile with social connectors.', // UNTRANSLATED
can_not_modify_target: 'The connector target can not be modified.', // UNTRANSLATED can_not_modify_target: "The connector 'target' can not be modified.", // UNTRANSLATED
should_specify_target: "You should specify 'target'.", // UNTRANSLATED
multiple_target_with_same_platform: multiple_target_with_same_platform:
'You can not have multiple social connectors that have same target and platform.', // UNTRANSLATED 'You can not have multiple social connectors that have same target and platform.', // UNTRANSLATED
cannot_change_metadata_for_non_standard_connector: cannot_overwrite_metadata_for_non_standard_connector:
"This connector's `metadata` cannot be changed.", // UNTRANSLATED "This connector's 'metadata' cannot be overwritten.", // UNTRANSLATED
}, },
passcode: { passcode: {
phone_email_empty: "Le téléphone et l'email sont vides.", phone_email_empty: "Le téléphone et l'email sont vides.",

View file

@ -107,11 +107,12 @@ const errors = {
multiple_instances_not_supported: multiple_instances_not_supported:
'Can not create multiple instance with picked standard connector.', // UNTRANSLATED 'Can not create multiple instance with picked standard connector.', // UNTRANSLATED
invalid_type_for_syncing_profile: 'You can only sync user profile with social connectors.', // UNTRANSLATED invalid_type_for_syncing_profile: 'You can only sync user profile with social connectors.', // UNTRANSLATED
can_not_modify_target: 'The connector target can not be modified.', // UNTRANSLATED can_not_modify_target: "The connector 'target' can not be modified.", // UNTRANSLATED
should_specify_target: "You should specify 'target'.", // UNTRANSLATED
multiple_target_with_same_platform: multiple_target_with_same_platform:
'You can not have multiple social connectors that have same target and platform.', // UNTRANSLATED 'You can not have multiple social connectors that have same target and platform.', // UNTRANSLATED
cannot_change_metadata_for_non_standard_connector: cannot_overwrite_metadata_for_non_standard_connector:
"This connector's `metadata` cannot be changed.", // UNTRANSLATED "This connector's 'metadata' cannot be overwritten.", // UNTRANSLATED
}, },
passcode: { passcode: {
phone_email_empty: '휴대전화번호 그리고 이메일이 비어있어요.', phone_email_empty: '휴대전화번호 그리고 이메일이 비어있어요.',

View file

@ -113,10 +113,11 @@ const errors = {
invalid_type_for_syncing_profile: invalid_type_for_syncing_profile:
'Você só pode sincronizar o perfil do usuário com conectores sociais.', 'Você só pode sincronizar o perfil do usuário com conectores sociais.',
can_not_modify_target: 'O destino do conector não pode ser modificado.', can_not_modify_target: 'O destino do conector não pode ser modificado.',
should_specify_target: "You should specify 'target'.", // UNTRANSLATED
multiple_target_with_same_platform: multiple_target_with_same_platform:
'Você não pode ter vários conectores sociais com o mesmo destino e plataforma.', 'Você não pode ter vários conectores sociais com o mesmo destino e plataforma.',
cannot_change_metadata_for_non_standard_connector: cannot_overwrite_metadata_for_non_standard_connector:
"This connector's `metadata` cannot be changed.", // UNTRANSLATED "This connector's 'metadata' cannot be overwritten.", // UNTRANSLATED
}, },
passcode: { passcode: {
phone_email_empty: 'Telefone e e-mail estão vazios.', phone_email_empty: 'Telefone e e-mail estão vazios.',

View file

@ -110,11 +110,12 @@ const errors = {
multiple_instances_not_supported: multiple_instances_not_supported:
'Can not create multiple instance with picked standard connector.', // UNTRANSLATED 'Can not create multiple instance with picked standard connector.', // UNTRANSLATED
invalid_type_for_syncing_profile: 'You can only sync user profile with social connectors.', // UNTRANSLATED invalid_type_for_syncing_profile: 'You can only sync user profile with social connectors.', // UNTRANSLATED
can_not_modify_target: 'The connector target can not be modified.', // UNTRANSLATED can_not_modify_target: "The connector 'target' can not be modified.", // UNTRANSLATED
should_specify_target: "You should specify 'target'.", // UNTRANSLATED
multiple_target_with_same_platform: multiple_target_with_same_platform:
'You can not have multiple social connectors that have same target and platform.', // UNTRANSLATED 'You can not have multiple social connectors that have same target and platform.', // UNTRANSLATED
cannot_change_metadata_for_non_standard_connector: cannot_overwrite_metadata_for_non_standard_connector:
"This connector's `metadata` cannot be changed.", // UNTRANSLATED "This connector's 'metadata' cannot be overwritten.", // UNTRANSLATED
}, },
passcode: { passcode: {
phone_email_empty: 'O campos telefone e email estão vazios.', phone_email_empty: 'O campos telefone e email estão vazios.',

View file

@ -109,11 +109,12 @@ const errors = {
multiple_instances_not_supported: multiple_instances_not_supported:
'Can not create multiple instance with picked standard connector.', // UNTRANSLATED 'Can not create multiple instance with picked standard connector.', // UNTRANSLATED
invalid_type_for_syncing_profile: 'You can only sync user profile with social connectors.', // UNTRANSLATED invalid_type_for_syncing_profile: 'You can only sync user profile with social connectors.', // UNTRANSLATED
can_not_modify_target: 'The connector target can not be modified.', // UNTRANSLATED can_not_modify_target: "The connector 'target' can not be modified.", // UNTRANSLATED
should_specify_target: "You should specify 'target'.", // UNTRANSLATED
multiple_target_with_same_platform: multiple_target_with_same_platform:
'You can not have multiple social connectors that have same target and platform.', // UNTRANSLATED 'You can not have multiple social connectors that have same target and platform.', // UNTRANSLATED
cannot_change_metadata_for_non_standard_connector: cannot_overwrite_metadata_for_non_standard_connector:
"This connector's `metadata` cannot be changed.", // UNTRANSLATED "This connector's 'metadata' cannot be overwritten.", // UNTRANSLATED
}, },
passcode: { passcode: {
phone_email_empty: 'Hem telefon hem de e-posta adresi yok.', phone_email_empty: 'Hem telefon hem de e-posta adresi yok.',

View file

@ -102,8 +102,9 @@ const errors = {
multiple_instances_not_supported: '你选择的连接器不支持创建多实例。', multiple_instances_not_supported: '你选择的连接器不支持创建多实例。',
invalid_type_for_syncing_profile: '只有社交连接器可以开启用户档案同步。', invalid_type_for_syncing_profile: '只有社交连接器可以开启用户档案同步。',
can_not_modify_target: '不可修改连接器 target。', can_not_modify_target: '不可修改连接器 target。',
should_specify_target: '你需要声明 target 的值。',
multiple_target_with_same_platform: '不能同时存在多个有相同 target 和平台类型的社交连接器。', multiple_target_with_same_platform: '不能同时存在多个有相同 target 和平台类型的社交连接器。',
cannot_change_metadata_for_non_standard_connector: '不可配置该连接器的 metadata 参数。', cannot_overwrite_metadata_for_non_standard_connector: '不可覆盖该连接器的 metadata 参数。',
}, },
passcode: { passcode: {
phone_email_empty: '手机号与邮箱地址均为空', phone_email_empty: '手机号与邮箱地址均为空',