Skip to content

Commit

Permalink
🎨 - fix: prefixed all of the translation component id's with 'mykn'
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaohs authored and svenvandescheur committed Feb 26, 2024
1 parent 7de85e9 commit 1f35ad8
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 108 deletions.
10 changes: 6 additions & 4 deletions src/components/boolean/bool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ export const Bool: React.FC<BoolProps> = ({
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",
});

Expand Down
30 changes: 16 additions & 14 deletions src/components/data/paginator/paginator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ export const Paginator: React.FC<PaginatorProps> = ({
? 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",
},
Expand All @@ -141,9 +141,9 @@ export const Paginator: React.FC<PaginatorProps> = ({
? 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,
Expand All @@ -153,8 +153,9 @@ export const Paginator: React.FC<PaginatorProps> = ({
? 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,
Expand All @@ -164,9 +165,9 @@ export const Paginator: React.FC<PaginatorProps> = ({
? 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,
Expand All @@ -176,9 +177,9 @@ export const Paginator: React.FC<PaginatorProps> = ({
? 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,
Expand All @@ -188,9 +189,9 @@ export const Paginator: React.FC<PaginatorProps> = ({
? 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,
Expand All @@ -200,8 +201,9 @@ export const Paginator: React.FC<PaginatorProps> = ({
? 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,
Expand Down
4 changes: 2 additions & 2 deletions src/components/form/form/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ export const Form: React.FC<FormProps> = ({
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",
});

Expand Down
5 changes: 3 additions & 2 deletions src/components/form/select/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ export const Select: React.FC<SelectProps> = ({
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",
});

Expand Down
8 changes: 4 additions & 4 deletions src/components/logo/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export const Logo: React.FC<LogoProps> = ({
? 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,
Expand All @@ -50,9 +50,9 @@ export const Logo: React.FC<LogoProps> = ({
? 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,
Expand Down
28 changes: 14 additions & 14 deletions src/lib/i18n/compiled/en.json
Original file line number Diff line number Diff line change
@@ -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 \""
Expand All @@ -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 "
Expand Down Expand Up @@ -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"
Expand All @@ -115,4 +115,4 @@
"value": "login"
}
]
}
}
28 changes: 14 additions & 14 deletions src/lib/i18n/compiled/nl.json
Original file line number Diff line number Diff line change
@@ -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 \""
Expand All @@ -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 "
Expand Down Expand Up @@ -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"
Expand All @@ -115,4 +115,4 @@
"value": "inloggen"
}
]
}
}
4 changes: 2 additions & 2 deletions src/lib/i18n/i18n.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
});
```
Expand Down
Loading

0 comments on commit 1f35ad8

Please sign in to comment.