Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Language Localization #473

Merged
merged 56 commits into from
Jan 22, 2025
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
0297ae2
add deps
Xavier-Charles Nov 19, 2024
4fdc7bf
hide overflow of screen
Xavier-Charles Nov 19, 2024
cbb0e4c
set up japanese translation
Xavier-Charles Nov 19, 2024
28e3316
make all navigation text translateable
Xavier-Charles Nov 20, 2024
84b3d7c
news and portfolio translation
Xavier-Charles Nov 20, 2024
264825a
add tutorials transcription
Xavier-Charles Nov 20, 2024
cf0ac7d
add more nav translations
Xavier-Charles Nov 20, 2024
bb57837
add podcast and video translations
Xavier-Charles Nov 20, 2024
24ef967
translate more items
Xavier-Charles Nov 22, 2024
91704ea
add translation for global messages
Xavier-Charles Nov 22, 2024
08405ed
add translation verasity widget
Xavier-Charles Nov 22, 2024
2a7f5ad
add cookies translate
Xavier-Charles Nov 22, 2024
2467503
countdown mudule
Xavier-Charles Nov 22, 2024
b9f8348
update date
Xavier-Charles Nov 22, 2024
a21ee0d
custom data module
Xavier-Charles Nov 22, 2024
4d92ddb
add error page
Xavier-Charles Nov 22, 2024
ea72e7e
gas
Xavier-Charles Nov 22, 2024
e705efa
market
Xavier-Charles Nov 22, 2024
ba7c839
qna
Xavier-Charles Nov 22, 2024
b35d195
summary
Xavier-Charles Nov 22, 2024
37f4aeb
video
Xavier-Charles Nov 22, 2024
53b8f01
translate about us
Xavier-Charles Nov 22, 2024
ea47a8b
calendar categories
Xavier-Charles Nov 22, 2024
8723f0a
error page
Xavier-Charles Nov 22, 2024
478c154
wallet_view
Xavier-Charles Nov 22, 2024
3963194
terns of service
Xavier-Charles Nov 22, 2024
f7fbcc3
add mroe translations
Xavier-Charles Nov 25, 2024
9620b8c
add migration
Xavier-Charles Nov 25, 2024
387822f
clean up trnsl
Xavier-Charles Nov 25, 2024
ddfa379
Add language switching
Xavier-Charles Nov 25, 2024
9af64ca
clean up
Xavier-Charles Nov 25, 2024
0193b49
clean up
Xavier-Charles Nov 25, 2024
28ed483
add spanish and french
Xavier-Charles Nov 27, 2024
53fd114
update date locale
Xavier-Charles Nov 27, 2024
9e092b7
date time translation
Xavier-Charles Nov 27, 2024
ad4b5fc
update england flag
Xavier-Charles Dec 2, 2024
b84f173
add turkish
Xavier-Charles Dec 3, 2024
7a209c8
add language button to menu
Xavier-Charles Dec 3, 2024
ea71ddb
update yarn
Xavier-Charles Dec 23, 2024
84d5899
reload on lang change
Xavier-Charles Dec 27, 2024
619fc26
remove unnecessary code
Xavier-Charles Dec 27, 2024
9784913
make news nav items update on lang change
Xavier-Charles Jan 13, 2025
4251e15
make sort items update on lang change
Xavier-Charles Jan 13, 2025
8da1b8f
make translations change on language change
Xavier-Charles Jan 13, 2025
fbbf1cc
refetch queries on lang change
Xavier-Charles Jan 13, 2025
a32cb99
fix unique key issue
Xavier-Charles Jan 13, 2025
cf01038
refactor dateUtils
Xavier-Charles Jan 13, 2025
691240b
update raw calls of i18next to use react patterns
Xavier-Charles Jan 13, 2025
69243d0
add language header
Xavier-Charles Jan 13, 2025
4df7325
update date
Xavier-Charles Jan 14, 2025
533d2b3
key lettering case update
Xavier-Charles Jan 14, 2025
31aa3c1
add feature flag
Xavier-Charles Jan 20, 2025
239b18d
use string literal
Xavier-Charles Jan 20, 2025
bd6e5bb
rename function
Xavier-Charles Jan 22, 2025
9a1aa11
rename arguement name
Xavier-Charles Jan 22, 2025
a706ff7
Merge branch 'dev' into feat/i18n
Xavier-Charles Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
error page
Xavier-Charles committed Dec 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 8723f0abbfdeb0f952fa78c7518b97a629a7ca5b
48 changes: 27 additions & 21 deletions packages/frontend/src/containers/error/ErrorContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import React from "react";
import i18next from "i18next";
import { useGetRemoteStatusQuery } from "src/api/services";
import { isNumber } from "src/api/utils/helpers";
import GeneralError from "src/components/error/GeneralError";

const t = i18next.t.bind(i18next);

const getErrorMessage = ({
status,
}: {
@@ -12,12 +15,13 @@ const getErrorMessage = ({
return (
<>
<h1 className="font-montserrat text-primaryFiltered m-0 text-[120px] leading-none">
You&apos;re{" "}
<span className="text-secondaryOrange pr-1">offline</span>
{t("error_page.offline.heading.text")}{" "}
<span className="text-secondaryOrange pr-1">
{t("error_page.offline.heading.highlight")}
</span>
</h1>
<p className="font-montserrat text-primaryVariant100 text-xl mt-9 max-w-screen-sm">
Looks like you lost your connection. Please check it and try
again.
{t("error_page.offline.description")}
</p>
</>
);
@@ -27,25 +31,24 @@ const getErrorMessage = ({
return (
<>
<h1 className="font-montserrat text-primaryFiltered m-0 text-[120px] leading-none">
System{" "}
{t("error_page.503.heading.text")}{" "}
<span className="text-secondaryOrange pr-1">
maintenance
{t("error_page.503.heading.highlight")}
</span>
</h1>
<p className="font-montserrat text-primaryVariant100 text-xl mt-9 max-w-screen-sm">
We are performing some scheduled maintenance at the moment.
We&apos;ll be back up shortly! Meanwhile, you can check our{" "}
{t("error_page.503.description1.text")}{" "}
<a
href="https://twitter.com/AlphadayHQ"
href={t("error_page.503.description1.link.url")}
target="_blank"
rel="noreferrer noopener"
>
twitter
{t("error_page.503.description1.link.text")}
</a>
.
</p>
<p className="font-montserrat text-primaryVariant100 text-xl mt-9 max-w-screen-sm">
And make sure to check back again later.
{t("error_page.503.description2")}
</p>
</>
);
@@ -55,11 +58,13 @@ const getErrorMessage = ({
return (
<>
<h1 className="font-montserrat text-primaryFiltered m-0 text-[120px] leading-none">
unauthorised{" "}
<span className="text-secondaryOrange pr-1">403</span>
{t("error_page.403.heading.text")}{" "}
<span className="text-secondaryOrange pr-1">
{t("error_page.403.heading.highlight")}
</span>
</h1>
<p className="font-montserrat text-primaryVariant100 text-xl mt-9 max-w-screen-sm">
You don&apos;t have permissions to access this page.
{t("error_page.403.description")}
</p>
</>
);
@@ -69,10 +74,12 @@ const getErrorMessage = ({
return (
<>
<h1 className="font-montserrat text-primaryFiltered m-0 text-[120px] leading-none">
<span className="text-secondaryOrange pr-1">404</span>
<span className="text-secondaryOrange pr-1">
{t("error_page.404.heading.highlight")}
</span>
</h1>
<p className="font-montserrat text-primaryVariant100 text-xl mt-9 max-w-screen-sm">
Sorry, the page you are looking for could not be found.
{t("error_page.404.description")}
</p>
</>
);
@@ -86,17 +93,16 @@ const getErrorMessage = ({
</h1>
)}
<p className="font-montserrat text-primaryVariant100 text-xl mt-9 max-w-screen-sm">
Something went wrong, we&apos;ll be back up shortly! Meanwhile,
you can check our{" "}
{t("error_page.default.description.text")}{" "}
<a
className="twitter"
href="https://twitter.com/AlphadayHQ"
href={t("error_page.default.description.link.url")}
target="_blank"
rel="noreferrer noopener"
>
twitter
{t("error_page.default.description.link.text")}
</a>{" "}
for updates.
{t("error_page.default.description.textAfterLink")}
</p>
</>
);
96 changes: 96 additions & 0 deletions packages/frontend/src/locales/translation.ts
Original file line number Diff line number Diff line change
@@ -317,6 +317,54 @@ export const translationEN = {
"Alphaday's mission is to bring you all the tools needed to follow your favorite projects, stay up-to-date with the latest narratives, and use your favorite dapps, all from the comfort of one easy-to-use customizable dashboard.",
close_button: "Close",
},
error_page: {
offline: {
heading: {
text: "You're",
highlight: "offline",
},
description:
"Looks like you lost your connection. Please check it and try again.",
},
"503": {
heading: {
text: "System",
highlight: "maintenance",
},
description1: {
text: "We are performing some scheduled maintenance at the moment. We'll be back up shortly! Meanwhile, you can check our",
link: {
text: "twitter",
url: "https://twitter.com/AlphadayHQ",
},
},
description2: "And make sure to check back again later.",
},
"403": {
heading: {
text: "unauthorised",
highlight: "403",
},
description: "You don't have permissions to access this page.",
},
"404": {
heading: {
highlight: "404",
},
description:
"Sorry, the page you are looking for could not be found.",
},
default: {
description: {
text: "Something went wrong, we'll be back up shortly! Meanwhile, you can check our",
link: {
text: "twitter",
url: "https://twitter.com/AlphadayHQ",
},
textAfterLink: "for updates.",
},
},
},
};

export const translationJA: typeof translationEN = {
@@ -641,4 +689,52 @@ export const translationJA: typeof translationEN = {
"Alphadayは、お気に入りのプロジェクトをフォローし、最新の情報を常に把握し、使いやすいカスタマイズ可能なダッシュボードから好きなdappsを使用するために必要なすべてのツールを提供することを使命としています。",
close_button: "閉じる",
},
error_page: {
offline: {
heading: {
text: "オフラインです",
highlight: "",
},
description:
"接続が切れたようです。接続を確認して、もう一度お試しください。",
},
"503": {
heading: {
text: "システム",
highlight: "メンテナンス",
},
description1: {
text: "現在、定期メンテナンスを実施しています。すぐに戻ります!その間、",
link: {
text: "twitter",
url: "https://twitter.com/AlphadayHQ",
},
},
description2: "をチェックしてください。",
},
"403": {
heading: {
text: "未承認",
highlight: "403",
},
description: "このページにアクセスする権限がありません。",
},
"404": {
heading: {
highlight: "404",
},
description:
"申し訳ありませんが、お探しのページが見つかりませんでした。",
},
default: {
description: {
text: "何かが間違ってしまいました。すぐに戻ります!その間、",
link: {
text: "twitter",
url: "https://twitter.com/AlphadayHQ",
},
textAfterLink: "をチェックしてください。",
},
},
},
};