From 861e12c1fcaedb69d331120bd4ae58757df1fae1 Mon Sep 17 00:00:00 2001 From: Julien Tant Date: Wed, 12 Feb 2025 15:29:23 -0700 Subject: [PATCH] i18n --- .../channels/app/custom_profile_attributes.go | 6 ++--- server/i18n/en.json | 24 +++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/server/channels/app/custom_profile_attributes.go b/server/channels/app/custom_profile_attributes.go index 79d70085e4f..4eae1f361d3 100644 --- a/server/channels/app/custom_profile_attributes.go +++ b/server/channels/app/custom_profile_attributes.go @@ -263,7 +263,7 @@ func validateCustomProfileAttributesField(field *model.PropertyField) *model.App } valueTypeStr = strings.TrimSpace(valueTypeStr) if !model.IsKnownCustomProfilteAttributesValueType(valueTypeStr) { - return model.NewAppError("CreateCPAField", "app.custom_profile_attributes.unknown_value_type.app_error", map[string]any{"value_type": valueTypeStr}, "", http.StatusUnprocessableEntity) + return model.NewAppError("CreateCPAField", "app.custom_profile_attributes.unknown_value_type.app_error", map[string]any{"ValueType": valueTypeStr}, "", http.StatusUnprocessableEntity) } field.Attrs[model.CustomProfileAttributesPropertyAttrsValueType] = valueTypeStr @@ -279,7 +279,7 @@ func validateCustomProfileAttributesField(field *model.PropertyField) *model.App for i, option := range optionsArr { optionMap, ok := option.(map[string]any) if !ok { - return model.NewAppError("CreateCPAField", "app.custom_profile_attributes.not_map_option.app_error", map[string]any{"index": i}, "", http.StatusUnprocessableEntity) + return model.NewAppError("CreateCPAField", "app.custom_profile_attributes.not_map_option.app_error", map[string]any{"Index": i}, "", http.StatusUnprocessableEntity) } option := model.NewCustomProfileAttributesSelectOptionFromMap(optionMap) finalOptions = append(finalOptions, option) @@ -296,7 +296,7 @@ func validateCustomProfileAttributesField(field *model.PropertyField) *model.App if visibilityStr, ok := visibilityAttr.(string); ok { visibilityStr = strings.TrimSpace(visibilityStr) if !model.IsKnownCustomProfilteAttributesVisibility(visibilityStr) { - return model.NewAppError("CreateCPAField", "app.custom_profile_attributes.unknown_visibility.app_error", map[string]any{"visibility": visibilityStr}, "", http.StatusUnprocessableEntity) + return model.NewAppError("CreateCPAField", "app.custom_profile_attributes.unknown_visibility.app_error", map[string]any{"Visibility": visibilityStr}, "", http.StatusUnprocessableEntity) } visibility = visibilityStr } diff --git a/server/i18n/en.json b/server/i18n/en.json index ae5b7c51ed9..eb0f39d1a3e 100644 --- a/server/i18n/en.json +++ b/server/i18n/en.json @@ -5018,6 +5018,10 @@ "id": "app.custom_profile_attributes.get_property_field.app_error", "translation": "Unable to get Custom Profile Attribute field" }, + { + "id": "app.custom_profile_attributes.invalid_options.app_error", + "translation": "Unable to validate the options" + }, { "id": "app.custom_profile_attributes.limit_reached.app_error", "translation": "Custom Profile Attributes field limit reached" @@ -5026,6 +5030,18 @@ "id": "app.custom_profile_attributes.list_property_values.app_error", "translation": "Unable to get custom profile attribute values" }, + { + "id": "app.custom_profile_attributes.not_array_options.app_error", + "translation": "The attribute options must be an array" + }, + { + "id": "app.custom_profile_attributes.not_map_option.app_error", + "translation": "The attribute option #{{.Index}} must be a key value pair" + }, + { + "id": "app.custom_profile_attributes.not_string_value_type.app_error", + "translation": "The value type must be a string" + }, { "id": "app.custom_profile_attributes.property_field_delete.app_error", "translation": "Unable to delete Custom Profile Attribute field" @@ -5054,6 +5070,14 @@ "id": "app.custom_profile_attributes.search_property_fields.app_error", "translation": "Unable to search Custom Profile Attribute fields" }, + { + "id": "app.custom_profile_attributes.unknown_value_type.app_error", + "translation": "The value type '{{.ValueType}}' is not supported" + }, + { + "id": "app.custom_profile_attributes.unknown_visibility.app_error", + "translation": "The visibility '{{.Visibility}}' is not supported" + }, { "id": "app.delete_scheduled_post.delete_error", "translation": "Failed to delete scheduled post from database."