From 1f35ad8bbff68b2c2790758c406f552a995db848 Mon Sep 17 00:00:00 2001 From: Julian Roeland Date: Fri, 23 Feb 2024 16:12:45 +0100 Subject: [PATCH] :art: - fix: prefixed all of the translation component id's with 'mykn' --- src/components/boolean/bool.tsx | 10 ++-- src/components/data/paginator/paginator.tsx | 30 ++++++------ src/components/form/form/form.tsx | 4 +- src/components/form/select/select.tsx | 5 +- src/components/logo/logo.tsx | 8 ++-- src/lib/i18n/compiled/en.json | 28 +++++------ src/lib/i18n/compiled/nl.json | 28 +++++------ src/lib/i18n/i18n.stories.mdx | 4 +- src/lib/i18n/messages/en.json | 52 ++++++++++----------- src/lib/i18n/messages/nl.json | 52 ++++++++++----------- 10 files changed, 113 insertions(+), 108 deletions(-) diff --git a/src/components/boolean/bool.tsx b/src/components/boolean/bool.tsx index bf134e6a..042cad92 100644 --- a/src/components/boolean/bool.tsx +++ b/src/components/boolean/bool.tsx @@ -38,15 +38,17 @@ export const Bool: React.FC = ({ const _labelTrue = labelTrue || intl.formatMessage({ - id: "components.Bool.labelTrue", - description: "components.Bool: The accessible label when value is truthy", + id: "mykn.components.Bool.labelTrue", + description: + "mykn.components.Bool: The accessible label when value is truthy", defaultMessage: "ja", }); const _labelFalse = labelFalse || intl.formatMessage({ - id: "components.Bool.labelFalse", - description: "components.Bool: The accessible label when value is falsy", + id: "mykn.components.Bool.labelFalse", + description: + "mykn.components.Bool: The accessible label when value is falsy", defaultMessage: "nee", }); diff --git a/src/components/data/paginator/paginator.tsx b/src/components/data/paginator/paginator.tsx index 8ed306ef..869e1f34 100644 --- a/src/components/data/paginator/paginator.tsx +++ b/src/components/data/paginator/paginator.tsx @@ -128,9 +128,9 @@ export const Paginator: React.FC = ({ ? formatMessage(labelCurrentPageRange, context) : intl.formatMessage( { - id: "components.Paginator.labelCurrentPageRange", + id: "mykn.components.Paginator.labelCurrentPageRange", description: - "components.Paginator: The current page range (accessible) label", + "mykn.components.Paginator: The current page range (accessible) label", defaultMessage: "resultaat {pageStart} t/m {pageEnd} van {pageCount} pagina's", }, @@ -141,9 +141,9 @@ export const Paginator: React.FC = ({ ? formatMessage(labelGoToPage, context) : intl.formatMessage( { - id: "components.Paginator.labelGoToPage", + id: "mykn.components.Paginator.labelGoToPage", description: - "components.Paginator: The go to page (accessible) label", + "mykn.components.Paginator: The go to page (accessible) label", defaultMessage: "naar pagina", }, context, @@ -153,8 +153,9 @@ export const Paginator: React.FC = ({ ? formatMessage(labelPageSize, context) : intl.formatMessage( { - id: "components.Paginator.labelPageSize", - description: "components.Paginator: The page size (accessible) label", + id: "mykn.components.Paginator.labelPageSize", + description: + "mykn.components.Paginator: The page size (accessible) label", defaultMessage: "aantal resultaten", }, context, @@ -164,9 +165,9 @@ export const Paginator: React.FC = ({ ? formatMessage(labelPagination, context) : intl.formatMessage( { - id: "components.Paginator.labelPagination", + id: "mykn.components.Paginator.labelPagination", description: - "components.Paginator: The pagination (accessible) label", + "mykn.components.Paginator: The pagination (accessible) label", defaultMessage: "paginering", }, context, @@ -176,9 +177,9 @@ export const Paginator: React.FC = ({ ? formatMessage(labelPrevious, context) : intl.formatMessage( { - id: "components.Paginator.labelPrevious", + id: "mykn.components.Paginator.labelPrevious", description: - "components.Paginator: The go to previous page (accessible) label", + "mykn.components.Paginator: The go to previous page (accessible) label", defaultMessage: "vorige", }, context, @@ -188,9 +189,9 @@ export const Paginator: React.FC = ({ ? formatMessage(labelNext, context) : intl.formatMessage( { - id: "components.Paginator.labelNext", + id: "mykn.components.Paginator.labelNext", description: - "components.Paginator: The go to next page (accessible) label", + "mykn.components.Paginator: The go to next page (accessible) label", defaultMessage: "volgende", }, context, @@ -200,8 +201,9 @@ export const Paginator: React.FC = ({ ? formatMessage(labelLoading, context) : intl.formatMessage( { - id: "components.Paginator.labelLoading", - description: "components.Paginator: The loading (accessible) label", + id: "mykn.components.Paginator.labelLoading", + description: + "mykn.components.Paginator: The loading (accessible) label", defaultMessage: "bezig met laden...", }, context, diff --git a/src/components/form/form/form.tsx b/src/components/form/form/form.tsx index 9f43ebb2..a3429d55 100644 --- a/src/components/form/form/form.tsx +++ b/src/components/form/form/form.tsx @@ -113,8 +113,8 @@ export const Form: React.FC = ({ const _labelSubmit = labelSubmit ? labelSubmit : intl.formatMessage({ - id: "components.Form.labelSubmit", - description: "components.Form: The submit form label", + id: "mykn.components.Form.labelSubmit", + description: "mykn.components.Form: The submit form label", defaultMessage: "verzenden", }); diff --git a/src/components/form/select/select.tsx b/src/components/form/select/select.tsx index a5f2fa16..daa32e06 100644 --- a/src/components/form/select/select.tsx +++ b/src/components/form/select/select.tsx @@ -110,8 +110,9 @@ export const Select: React.FC = ({ const _labelClear = labelClear ? formatMessage(labelClear, i18nContext) : intl.formatMessage({ - id: "components.Select.labelClear", - description: "components.Select: The clear value (accessible) label", + id: "mykn.components.Select.labelClear", + description: + "mykn.components.Select: The clear value (accessible) label", defaultMessage: "waarde wissen", }); diff --git a/src/components/logo/logo.tsx b/src/components/logo/logo.tsx index 55a60f3c..d999fd7f 100644 --- a/src/components/logo/logo.tsx +++ b/src/components/logo/logo.tsx @@ -39,9 +39,9 @@ export const Logo: React.FC = ({ ? formatMessage(hrefLabel, context) : intl.formatMessage( { - id: "components.Logo.hrefLabel", + id: "mykn.components.Logo.hrefLabel", description: - "components.Logo: An aria-label describing the link action", + "mykn.components.Logo: An aria-label describing the link action", defaultMessage: 'go to "{href}"', }, context, @@ -50,9 +50,9 @@ export const Logo: React.FC = ({ ? formatMessage(label, context) : intl.formatMessage( { - id: "components.Logo.label", + id: "mykn.components.Logo.label", description: - "components.Logo: The aria-label to set on the SVG element", + "mykn.components.Logo: The aria-label to set on the SVG element", defaultMessage: "Maykin logo", }, context, diff --git a/src/lib/i18n/compiled/en.json b/src/lib/i18n/compiled/en.json index ecff0ee6..e3410126 100644 --- a/src/lib/i18n/compiled/en.json +++ b/src/lib/i18n/compiled/en.json @@ -1,23 +1,23 @@ { - "components.Bool.labelFalse": [ + "mykn.components.Bool.labelFalse": [ { "type": 0, "value": "no" } ], - "components.Bool.labelTrue": [ + "mykn.components.Bool.labelTrue": [ { "type": 0, "value": "yes" } ], - "components.Form.labelSubmit": [ + "mykn.components.Form.labelSubmit": [ { "type": 0, "value": "submit" } ], - "components.Logo.hrefLabel": [ + "mykn.components.Logo.hrefLabel": [ { "type": 0, "value": "go to \"" @@ -31,13 +31,13 @@ "value": "\"" } ], - "components.Logo.label": [ + "mykn.components.Logo.label": [ { "type": 0, "value": "Maykin logo" } ], - "components.Paginator.labelCurrentPageRange": [ + "mykn.components.Paginator.labelCurrentPageRange": [ { "type": 0, "value": "result " @@ -67,43 +67,43 @@ "value": " pages" } ], - "components.Paginator.labelGoToPage": [ + "mykn.components.Paginator.labelGoToPage": [ { "type": 0, "value": "go to page" } ], - "components.Paginator.labelLoading": [ + "mykn.components.Paginator.labelLoading": [ { "type": 0, "value": "loading..." } ], - "components.Paginator.labelNext": [ + "mykn.components.Paginator.labelNext": [ { "type": 0, "value": "next" } ], - "components.Paginator.labelPageSize": [ + "mykn.components.Paginator.labelPageSize": [ { "type": 0, "value": "number of results" } ], - "components.Paginator.labelPagination": [ + "mykn.components.Paginator.labelPagination": [ { "type": 0, "value": "pagination" } ], - "components.Paginator.labelPrevious": [ + "mykn.components.Paginator.labelPrevious": [ { "type": 0, "value": "previous" } ], - "components.Select.labelClear": [ + "mykn.components.Select.labelClear": [ { "type": 0, "value": "clear value" @@ -115,4 +115,4 @@ "value": "login" } ] -} \ No newline at end of file +} diff --git a/src/lib/i18n/compiled/nl.json b/src/lib/i18n/compiled/nl.json index 585e12f2..6a6bc9a1 100644 --- a/src/lib/i18n/compiled/nl.json +++ b/src/lib/i18n/compiled/nl.json @@ -1,23 +1,23 @@ { - "components.Bool.labelFalse": [ + "mykn.components.Bool.labelFalse": [ { "type": 0, "value": "nee" } ], - "components.Bool.labelTrue": [ + "mykn.components.Bool.labelTrue": [ { "type": 0, "value": "ja" } ], - "components.Form.labelSubmit": [ + "mykn.components.Form.labelSubmit": [ { "type": 0, "value": "verzenden" } ], - "components.Logo.hrefLabel": [ + "mykn.components.Logo.hrefLabel": [ { "type": 0, "value": "go to \"" @@ -31,13 +31,13 @@ "value": "\"" } ], - "components.Logo.label": [ + "mykn.components.Logo.label": [ { "type": 0, "value": "Maykin logo" } ], - "components.Paginator.labelCurrentPageRange": [ + "mykn.components.Paginator.labelCurrentPageRange": [ { "type": 0, "value": "resultaat " @@ -67,43 +67,43 @@ "value": " pagina's" } ], - "components.Paginator.labelGoToPage": [ + "mykn.components.Paginator.labelGoToPage": [ { "type": 0, "value": "naar pagina" } ], - "components.Paginator.labelLoading": [ + "mykn.components.Paginator.labelLoading": [ { "type": 0, "value": "bezig met laden..." } ], - "components.Paginator.labelNext": [ + "mykn.components.Paginator.labelNext": [ { "type": 0, "value": "volgende" } ], - "components.Paginator.labelPageSize": [ + "mykn.components.Paginator.labelPageSize": [ { "type": 0, "value": "aantal resultaten" } ], - "components.Paginator.labelPagination": [ + "mykn.components.Paginator.labelPagination": [ { "type": 0, "value": "paginering" } ], - "components.Paginator.labelPrevious": [ + "mykn.components.Paginator.labelPrevious": [ { "type": 0, "value": "vorige" } ], - "components.Select.labelClear": [ + "mykn.components.Select.labelClear": [ { "type": 0, "value": "waarde wissen" @@ -115,4 +115,4 @@ "value": "inloggen" } ] -} \ No newline at end of file +} diff --git a/src/lib/i18n/i18n.stories.mdx b/src/lib/i18n/i18n.stories.mdx index a3896585..9ee7b3eb 100644 --- a/src/lib/i18n/i18n.stories.mdx +++ b/src/lib/i18n/i18n.stories.mdx @@ -61,8 +61,8 @@ const intl = useIntl("en"); // locale can be left empty. const _labelTrue = labelTrue || intl.formatMessage({ - id: "components.Bool.labelTrue", - description: "components.Bool: The accessible label when value is truthy", + id: "mykn.components.Bool.labelTrue", + description: "mykn.components.Bool: The accessible label when value is truthy", defaultMessage: "ja", }); ``` diff --git a/src/lib/i18n/messages/en.json b/src/lib/i18n/messages/en.json index 96b4fad9..bedab974 100644 --- a/src/lib/i18n/messages/en.json +++ b/src/lib/i18n/messages/en.json @@ -1,67 +1,67 @@ { - "components.Bool.labelFalse": { + "mykn.components.Bool.labelFalse": { "defaultMessage": "no", - "description": "components.Bool: The accessible label when value is falsy", + "description": "mykn.components.Bool: The accessible label when value is falsy", "originalDefault": "nee" }, - "components.Bool.labelTrue": { + "mykn.components.Bool.labelTrue": { "defaultMessage": "yes", - "description": "components.Bool: The accessible label when value is truthy", + "description": "mykn.components.Bool: The accessible label when value is truthy", "originalDefault": "ja" }, - "components.Form.labelSubmit": { + "mykn.components.Form.labelSubmit": { "defaultMessage": "submit", - "description": "components.Form: The submit form label", + "description": "mykn.components.Form: The submit form label", "originalDefault": "verzenden" }, - "components.Logo.hrefLabel": { + "mykn.components.Logo.hrefLabel": { "defaultMessage": "go to \"{href}\"", - "description": "components.Logo: An aria-label describing the link action", + "description": "mykn.components.Logo: An aria-label describing the link action", "originalDefault": "go to \"{href}\"" }, - "components.Logo.label": { + "mykn.components.Logo.label": { "defaultMessage": "Maykin logo", - "description": "components.Logo: The aria-label to set on the SVG element", + "description": "mykn.components.Logo: The aria-label to set on the SVG element", "originalDefault": "Maykin logo" }, - "components.Paginator.labelCurrentPageRange": { + "mykn.components.Paginator.labelCurrentPageRange": { "defaultMessage": "result {pageStart} to {pageEnd} of {pageCount} pages", - "description": "components.Paginator: The current page range (accessible) label", + "description": "mykn.components.Paginator: The current page range (accessible) label", "originalDefault": "resultaat {pageStart} t/m {pageEnd} van {pageCount} pagina's" }, - "components.Paginator.labelGoToPage": { + "mykn.components.Paginator.labelGoToPage": { "defaultMessage": "go to page", - "description": "components.Paginator: The go to page (accessible) label", + "description": "mykn.components.Paginator: The go to page (accessible) label", "originalDefault": "naar pagina" }, - "components.Paginator.labelLoading": { + "mykn.components.Paginator.labelLoading": { "defaultMessage": "loading...", - "description": "components.Paginator: The loading (accessible) label", + "description": "mykn.components.Paginator: The loading (accessible) label", "originalDefault": "bezig met laden..." }, - "components.Paginator.labelNext": { + "mykn.components.Paginator.labelNext": { "defaultMessage": "next", - "description": "components.Paginator: The go to next page (accessible) label", + "description": "mykn.components.Paginator: The go to next page (accessible) label", "originalDefault": "volgende" }, - "components.Paginator.labelPageSize": { + "mykn.components.Paginator.labelPageSize": { "defaultMessage": "number of results", - "description": "components.Paginator: The page size (accessible) label", + "description": "mykn.components.Paginator: The page size (accessible) label", "originalDefault": "aantal resultaten" }, - "components.Paginator.labelPagination": { + "mykn.components.Paginator.labelPagination": { "defaultMessage": "pagination", - "description": "components.Paginator: The pagination (accessible) label", + "description": "mykn.components.Paginator: The pagination (accessible) label", "originalDefault": "paginering" }, - "components.Paginator.labelPrevious": { + "mykn.components.Paginator.labelPrevious": { "defaultMessage": "previous", - "description": "components.Paginator: The go to previous page (accessible) label", + "description": "mykn.components.Paginator: The go to previous page (accessible) label", "originalDefault": "vorige" }, - "components.Select.labelClear": { + "mykn.components.Select.labelClear": { "defaultMessage": "clear value", - "description": "components.Select: The clear value (accessible) label", + "description": "mykn.components.Select: The clear value (accessible) label", "originalDefault": "waarde wissen" }, "mm+twj": { diff --git a/src/lib/i18n/messages/nl.json b/src/lib/i18n/messages/nl.json index a4542ad4..d562aea6 100644 --- a/src/lib/i18n/messages/nl.json +++ b/src/lib/i18n/messages/nl.json @@ -1,67 +1,67 @@ { - "components.Bool.labelFalse": { + "mykn.components.Bool.labelFalse": { "defaultMessage": "nee", - "description": "components.Bool: The accessible label when value is falsy", + "description": "mykn.components.Bool: The accessible label when value is falsy", "originalDefault": "nee" }, - "components.Bool.labelTrue": { + "mykn.components.Bool.labelTrue": { "defaultMessage": "ja", - "description": "components.Bool: The accessible label when value is truthy", + "description": "mykn.components.Bool: The accessible label when value is truthy", "originalDefault": "ja" }, - "components.Form.labelSubmit": { + "mykn.components.Form.labelSubmit": { "defaultMessage": "verzenden", - "description": "components.Form: The submit form label", + "description": "mykn.components.Form: The submit form label", "originalDefault": "verzenden" }, - "components.Logo.hrefLabel": { + "mykn.components.Logo.hrefLabel": { "defaultMessage": "go to \"{href}\"", - "description": "components.Logo: An aria-label describing the link action", + "description": "mykn.components.Logo: An aria-label describing the link action", "originalDefault": "go to \"{href}\"" }, - "components.Logo.label": { + "mykn.components.Logo.label": { "defaultMessage": "Maykin logo", - "description": "components.Logo: The aria-label to set on the SVG element", + "description": "mykn.components.Logo: The aria-label to set on the SVG element", "originalDefault": "Maykin logo" }, - "components.Paginator.labelCurrentPageRange": { + "mykn.components.Paginator.labelCurrentPageRange": { "defaultMessage": "resultaat {pageStart} t/m {pageEnd} van {pageCount} pagina's", - "description": "components.Paginator: The current page range (accessible) label", + "description": "mykn.components.Paginator: The current page range (accessible) label", "originalDefault": "resultaat {pageStart} t/m {pageEnd} van {pageCount} pagina's" }, - "components.Paginator.labelGoToPage": { + "mykn.components.Paginator.labelGoToPage": { "defaultMessage": "naar pagina", - "description": "components.Paginator: The go to page (accessible) label", + "description": "mykn.components.Paginator: The go to page (accessible) label", "originalDefault": "naar pagina" }, - "components.Paginator.labelLoading": { + "mykn.components.Paginator.labelLoading": { "defaultMessage": "bezig met laden...", - "description": "components.Paginator: The loading (accessible) label", + "description": "mykn.components.Paginator: The loading (accessible) label", "originalDefault": "bezig met laden..." }, - "components.Paginator.labelNext": { + "mykn.components.Paginator.labelNext": { "defaultMessage": "volgende", - "description": "components.Paginator: The go to next page (accessible) label", + "description": "mykn.components.Paginator: The go to next page (accessible) label", "originalDefault": "volgende" }, - "components.Paginator.labelPageSize": { + "mykn.components.Paginator.labelPageSize": { "defaultMessage": "aantal resultaten", - "description": "components.Paginator: The page size (accessible) label", + "description": "mykn.components.Paginator: The page size (accessible) label", "originalDefault": "aantal resultaten" }, - "components.Paginator.labelPagination": { + "mykn.components.Paginator.labelPagination": { "defaultMessage": "paginering", - "description": "components.Paginator: The pagination (accessible) label", + "description": "mykn.components.Paginator: The pagination (accessible) label", "originalDefault": "paginering" }, - "components.Paginator.labelPrevious": { + "mykn.components.Paginator.labelPrevious": { "defaultMessage": "vorige", - "description": "components.Paginator: The go to previous page (accessible) label", + "description": "mykn.components.Paginator: The go to previous page (accessible) label", "originalDefault": "vorige" }, - "components.Select.labelClear": { + "mykn.components.Select.labelClear": { "defaultMessage": "waarde wissen", - "description": "components.Select: The clear value (accessible) label", + "description": "mykn.components.Select: The clear value (accessible) label", "originalDefault": "waarde wissen" }, "mm+twj": {