Skip to content

Commit

Permalink
feat: simplify error page messages (#4482)
Browse files Browse the repository at this point in the history
* feat: simplify error page messages

* chore: add scripts for i18n

* chore: update translations
  • Loading branch information
HeartSquared authored Jan 30, 2024
1 parent 2761c67 commit 166a0e3
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-dots-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kaizen/components": minor
---

Simplify error page messages for internationalisation.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
"pkg:aio": "yarn workspace @kaizen/components",
"ci:version": "yarn turbo prepublishOnly && yarn changeset version",
"ci:publish": "yarn turbo prepublishOnly && yarn changeset publish",
"update-icons": "yarn pkg:aio update-icons"
"update-icons": "yarn pkg:aio update-icons",
"i18n:extract": "yarn pkg:aio i18n:extract",
"i18n:extract:remove-obsolete": "yarn pkg:aio i18n:extract --deleteObsoleteTranslations"
},
"dependencies": {
"@kaizen/hosted-assets": "*",
Expand Down
8 changes: 4 additions & 4 deletions packages/components/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
},
"kzErrorPage.400.message": {
"description": "Call to action instructions for the user",
"message": "Sorry but your request couldn’t be completed. Go back and try again, or head to Home"
"message": "Problem loading page right now. Try again or head home."
},
"kzErrorPage.400.title": {
"description": "Heading for page",
"message": "Your request has slipped into the void"
"message": "Problem loading page"
},
"kzErrorPage.401.message": {
"description": "Call to action instructions for the user",
Expand All @@ -56,7 +56,7 @@
},
"kzErrorPage.404.title": {
"description": "Main title of page",
"message": "Missing pages are one of life's mysteries"
"message": "Page not found"
},
"kzErrorPage.413": {
"description": "Call to action instructions for the user",
Expand All @@ -72,7 +72,7 @@
},
"kzErrorPage.422.title": {
"description": "Main title of page",
"message": "Change never comes easy"
"message": "Change couldn't be made"
},
"kzErrorPage.500": {
"description": "Call to action instructions for the user",
Expand Down
3 changes: 2 additions & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"dist:combine-styles": "concat-cli -f ./dist/*.css ./dist/esm/*.css -o ./dist/raw-styles.css",
"dist:postcss": "postcss dist/raw-styles.css --output dist/styles.css",
"postBuild": "yarn dist:combine-styles && yarn dist:postcss",
"update-icons": "./src/Icon/bin/update-icons.sh"
"update-icons": "./src/Icon/bin/update-icons.sh",
"i18n:extract": "yarn i18n-extract"
},
"dependencies": {
"@floating-ui/react-dom": "^2.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export const Error: Story = {
illustration: <BrandMomentError {...illustrationProps} />,
header: <FakeNavBar />,
text: {
title: "Missing pages are one of life's mysteries",
title: "Page not found",
},
body: (
<>
Expand Down
8 changes: 4 additions & 4 deletions packages/components/src/ErrorPage/hooks/useErrorMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export const useErrorMessages = (
400: {
title: formatMessage({
id: "kzErrorPage.400.title",
defaultMessage: "Your request has slipped into the void",
defaultMessage: "Problem loading page",
description: "Heading for page",
}),
message: formatMessage({
id: "kzErrorPage.400.message",
defaultMessage:
"Sorry but your request couldn’t be completed. Go back and try again, or head to Home",
"Problem loading page right now. Try again or head home.",
description: "Call to action instructions for the user",
}),
},
Expand Down Expand Up @@ -63,7 +63,7 @@ export const useErrorMessages = (
404: {
title: formatMessage({
id: "kzErrorPage.404.title",
defaultMessage: "Missing pages are one of life's mysteries",
defaultMessage: "Page not found",
description: "Main title of page",
}),
message: formatMessage({
Expand All @@ -89,7 +89,7 @@ export const useErrorMessages = (
422: {
title: formatMessage({
id: "kzErrorPage.422.title",
defaultMessage: "Change never comes easy",
defaultMessage: "Change couldn't be made",
description: "Main title of page",
}),
message: formatMessage({
Expand Down

0 comments on commit 166a0e3

Please sign in to comment.