diff --git a/i18n/en.pot b/i18n/en.pot index 2b3a266e..7180dd07 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2023-10-16T12:26:20.848Z\n" -"PO-Revision-Date: 2023-10-16T12:26:20.848Z\n" +"POT-Creation-Date: 2023-10-26T12:50:29.542Z\n" +"PO-Revision-Date: 2023-10-26T12:50:29.542Z\n" msgid "schemas" msgstr "schemas" @@ -561,6 +561,40 @@ msgstr "Basic information" msgid "Set up the information for this data element" msgstr "Set up the information for this data element" +msgid "Disaggregation and Option sets" +msgstr "Disaggregation and Option sets" + +msgid "Set up disaggregation and predefined options." +msgstr "Set up disaggregation and predefined options." + +msgid "LegendSet" +msgstr "LegendSet" + +msgid "" +"Visualize values for this data element in Analytics app. Multiple legendSet " +"can be applied." +msgstr "" +"Visualize values for this data element in Analytics app. Multiple legendSet " +"can be applied." + +msgid "Aggregation levels" +msgstr "Aggregation levels" + +msgid "Custom attributes" +msgstr "Custom attributes" + +msgid "Custom fields for your DHIS2 instance" +msgstr "Custom fields for your DHIS2 instance" + +msgid "Required" +msgstr "Required" + +msgid "Cannot be longer than {{number}} character" +msgstr "Cannot be longer than {{number}} character" + +msgid "The value is to long. You can use up to 255 characters" +msgstr "The value is to long. You can use up to 255 characters" + msgid "{{fieldLabel}} (required)" msgstr "{{fieldLabel}} (required)" @@ -588,6 +622,16 @@ msgstr "Url" msgid "A web link that provides extra information" msgstr "A web link that provides extra information" +msgid "Color and icon" +msgstr "Color and icon" + +msgid "" +"A color and icon are helpful for identifying data elements in " +"information-dense screens." +msgstr "" +"A color and icon are helpful for identifying data elements in " +"information-dense screens." + msgid "Field mask" msgstr "Field mask" @@ -606,41 +650,6 @@ msgstr "An alternative name used in section or automatic data entry forms." msgid "Store zero data values" msgstr "Store zero data values" -msgid "Disaggregation and Option sets" -msgstr "Disaggregation and Option sets" - -msgid "Set up disaggregation and predefined options." -msgstr "Set up disaggregation and predefined options." - -msgid "LegendSet" -msgstr "LegendSet" - -msgid "" -"Visualize values for this data element in Analytics app. Multiple legendSet " -"can be applied." -msgstr "" -"Visualize values for this data element in Analytics app. Multiple legendSet " -"can be applied." - -msgid "Aggregation levels" -msgstr "Aggregation levels" - -msgid "Custom attributes" -msgstr "Custom attributes" - -msgid "Custom fields for your DHIS2 instance" -msgstr "Custom fields for your DHIS2 instance" - -msgid "Color and icon" -msgstr "Color and icon" - -msgid "" -"A color and icon are helpful for identifying data elements in " -"information-dense screens." -msgstr "" -"A color and icon are helpful for identifying data elements in " -"information-dense screens." - msgid "A data element can either be aggregated or tracked data." msgstr "A data element can either be aggregated or tracked data." @@ -677,12 +686,6 @@ msgstr "Option set comment" msgid "Choose a set of predefined comment for data entry" msgstr "Choose a set of predefined comment for data entry" -msgid "Required" -msgstr "Required" - -msgid "The value is to long. You can use up to 255 characters" -msgstr "The value is to long. You can use up to 255 characters" - msgid "Metadata management" msgstr "Metadata management" diff --git a/src/pages/dataElements/form/dataElementSchema.ts b/src/pages/dataElements/form/dataElementSchema.ts index a5c8a99c..27c5de38 100644 --- a/src/pages/dataElements/form/dataElementSchema.ts +++ b/src/pages/dataElements/form/dataElementSchema.ts @@ -2,10 +2,19 @@ import i18n from '@dhis2/d2-i18n' import { z } from 'zod' const requiredMessage = i18n.t('Required') +const max50Message = i18n.t('Cannot be longer than {{number}} character', { + number: 50, +}) export const dataElementSchema = z.object({ - name: z.string().min(1, { message: requiredMessage }), - shortName: z.string().min(1, { message: requiredMessage }), + name: z + .string() + .min(1, { message: requiredMessage }) + .max(50, { message: max50Message }), + shortName: z + .string() + .min(1, { message: requiredMessage }) + .max(50, { message: max50Message }), code: z.string().optional(), description: z .string()