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
key lettering case update
  • Loading branch information
Xavier-Charles committed Jan 14, 2025
commit 533d2b33ee3bd7155e87f5fc395dbe8b2b7da3fe
19 changes: 16 additions & 3 deletions packages/frontend/src/api/hooks/useTutorial.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useCallback } from "react";
import { useCallback, useMemo } from "react";
import { useTranslation } from "react-i18next";
import { setCurrentTutorialTip, setStoreShowTutorial } from "src/api/store";
import { useAppSelector, useAppDispatch } from "src/api/store/hooks";
import { tutorials } from "src/containers/tutorial/staticData";
@@ -20,16 +21,28 @@ interface ITutorial {
}

export const useTutorial: () => ITutorial = () => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const { tutFocusElemRef, setTutFocusElemRef } = useTutorialContext();
const { isFullSize } = useViewRoute();
const { enabled: isWalletBoardAllowed } = useFeatureFlags(
EFeaturesRegistry.WalletBoard
);

const translate = useCallback(
(key: string) => {
return t(`tutorials.${key}`);
},
[t]
);
const translatedTutorials = useMemo(
() => tutorials(translate),
[translate]
);

const allowedTutorials = isWalletBoardAllowed
? tutorials
: tutorials.filter(
? translatedTutorials
: translatedTutorials.filter(
(tutorial) => tutorial.id !== ETutorialTipId.WalletView
);

32 changes: 16 additions & 16 deletions packages/frontend/src/components/AboutUsModal.tsx
Original file line number Diff line number Diff line change
@@ -18,25 +18,25 @@ export const AboutUsModal: React.FC<IProps> = ({ showModal, onClose }) => {
return (
<Modal showModal={showModal} onClose={onClose} size="md">
<ModalHeader>
<ModalTitle>{t("about_us.title")}</ModalTitle>
<ModalTitle>{t("aboutUs.title")}</ModalTitle>
</ModalHeader>

<ModalBody className="[&_a]:text-secondaryOrange [&_a]:focus:outline-none">
<h6>{t("about_us.company_overview.title")}</h6>
<h6>{t("aboutUs.companyOverview.title")}</h6>
<p>
{t("about_us.company_overview.registered_name")}
{t("aboutUs.companyOverview.registeredName")}
<br />
{t("about_us.company_overview.registration_number")}
{t("aboutUs.companyOverview.registrationNumber")}
<br />
{t("about_us.company_overview.registered_office")}
{t("aboutUs.companyOverview.registeredOffice")}
</p>

<h6>{t("about_us.contact_info.title")}</h6>
<h6>{t("aboutUs.contactInfo.title")}</h6>
<p>
{t("about_us.contact_info.email")}{" "}
{t("aboutUs.contactInfo.email")}{" "}
<a href="mailto:[email protected]">[email protected]</a>
<br />
{t("about_us.contact_info.xcom")}{" "}
{t("aboutUs.contactInfo.xcom")}{" "}
<a
href="https://x.com/AlphadayHQ"
target="_blank"
@@ -46,9 +46,9 @@ export const AboutUsModal: React.FC<IProps> = ({ showModal, onClose }) => {
</a>
</p>

<h6>{t("about_us.legal_info.title")}</h6>
<h6>{t("aboutUs.legalInfo.title")}</h6>
<p>
{t("about_us.legal_info.terms")}{" "}
{t("aboutUs.legalInfo.terms")}{" "}
<a
href="https://alphaday.com/terms"
target="_blank"
@@ -57,7 +57,7 @@ export const AboutUsModal: React.FC<IProps> = ({ showModal, onClose }) => {
https://alphaday.com/terms
</a>
<br />
{t("about_us.legal_info.privacy")}{" "}
{t("aboutUs.legalInfo.privacy")}{" "}
<a
href="https://alphaday.com/privacy"
target="_blank"
@@ -67,9 +67,9 @@ export const AboutUsModal: React.FC<IProps> = ({ showModal, onClose }) => {
</a>
</p>

<h6>{t("about_us.additional_resources.title")}</h6>
<h6>{t("aboutUs.additionalResources.title")}</h6>
<p>
{t("about_us.additional_resources.faqs")}{" "}
{t("aboutUs.additionalResources.faqs")}{" "}
<a
href="https://alphaday.com/"
target="_blank"
@@ -78,7 +78,7 @@ export const AboutUsModal: React.FC<IProps> = ({ showModal, onClose }) => {
alphaday.com
</a>
<br />
{t("about_us.additional_resources.feedback")}{" "}
{t("aboutUs.additionalResources.feedback")}{" "}
<a
href="https://forms.gle/RbrrLGdFPAeuNJhk9"
target="_blank"
@@ -87,11 +87,11 @@ export const AboutUsModal: React.FC<IProps> = ({ showModal, onClose }) => {
https://forms.gle/RbrrLGdFPAeuNJhk9
</a>
</p>
<p>{t("about_us.mission")}</p>
<p>{t("aboutUs.mission")}</p>
</ModalBody>
<ModalFooter>
<Button className="pt-1.5" onClick={onClose}>
{t("about_us.close_button")}
{t("aboutUs.closeButton")}
</Button>
</ModalFooter>
</Modal>
2 changes: 1 addition & 1 deletion packages/frontend/src/components/LanguageModal.tsx
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ export const LanguageModal: React.FC<IProps> = ({
</ModalBody>
<ModalFooter>
<Button className="pt-1.5" onClick={onClose}>
{t("language.close_button")}
{t("language.closeButton")}
</Button>
</ModalFooter>
</Modal>
Original file line number Diff line number Diff line change
@@ -254,16 +254,16 @@ const BoardsLibrary: FC<IBoardsLibrary> = ({
<span className="flex flex-col">
<span className="fontGroup-highlightSemi">
{t(
"navigation.boards_library.custom_boards_title"
"navigation.boards_library.customBoardsTitle"
)}
</span>
<span className="text-primaryVariant100">
{isAuthenticated
? t(
"navigation.boards_library.custom_boards_description_with_auth"
"navigation.boards_library.customBoardsDescriptionWithAuth"
)
: t(
"navigation.boards_library.custom_boards_description"
"navigation.boards_library.customBoardsDescription"
)}
</span>
</span>
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ export const EventLink: FC<{ event: TEventDetails }> = ({ event }) => {
<ExternalLinkSVG className="w-3.5 h-3.5 pt-[1px] text-primaryVariant100 stroke-3" />
</span>
<span className="pt-0.5 min-w-full whitespace-nowrap">
{t("calendar.more_details")}
{t("calendar.moreDetails")}
</span>
</Button>
</a>
36 changes: 18 additions & 18 deletions packages/frontend/src/components/calendarCategories.ts
Original file line number Diff line number Diff line change
@@ -4,94 +4,94 @@ import { TEventCategory } from "./types";
export const typeOptions: { value: string; name: string; color: string }[] = [
{
value: "Co",
name: i18next.t("calendar.event_types.conferences"),
name: i18next.t("calendar.eventTypes.conferences"),
color: "rgb(185, 225, 135)",
},
{
value: "MU",
name: i18next.t("calendar.event_types.meetups"),
name: i18next.t("calendar.eventTypes.meetups"),
color: "rgb(117, 71, 247)",
},
{
value: "Hk",
name: i18next.t("calendar.event_types.hackathons"),
name: i18next.t("calendar.eventTypes.hackathons"),
color: "rgb(162, 117, 84)",
},
{
value: "PR",
name: i18next.t("calendar.event_types.product_releases"),
name: i18next.t("calendar.eventTypes.productReleases"),
color: "rgb(249, 132, 104)",
},
{
value: "DC",
name: i18next.t("calendar.event_types.developer_conferences"),
name: i18next.t("calendar.eventTypes.developer_conferences"),
color: "rgb(224, 135, 135)",
},
{
value: "ICO",
name: i18next.t("calendar.event_types.icos"),
name: i18next.t("calendar.eventTypes.icos"),
color: "rgb(144, 190, 109)",
},
{
value: "IDO",
name: i18next.t("calendar.event_types.idos"),
name: i18next.t("calendar.eventTypes.idos"),
color: "rgb(67, 170, 139)",
},
{
value: "DV",
name: i18next.t("calendar.event_types.dev_updates"),
name: i18next.t("calendar.eventTypes.dev_updates"),
color: "rgb(77, 144, 142)",
},
{
value: "EE",
name: i18next.t("calendar.event_types.exchange_events"),
name: i18next.t("calendar.eventTypes.exchange_events"),
color: "rgb(87, 117, 144)",
},
{
value: "CC",
name: i18next.t("calendar.event_types.community_calls"),
name: i18next.t("calendar.eventTypes.communityCalls"),
color: "rgb(39, 125, 161)",
},
{
value: "SF",
name: i18next.t("calendar.event_types.soft_forks"),
name: i18next.t("calendar.eventTypes.softForks"),
color: "rgb(253, 153, 153)",
},
{
value: "HF",
name: i18next.t("calendar.event_types.hard_forks"),
name: i18next.t("calendar.eventTypes.hardForks"),
color: "rgb(198, 179, 14)",
},
{
value: "EDU",
name: i18next.t("calendar.event_types.education"),
name: i18next.t("calendar.eventTypes.education"),
color: "rgb(71, 127, 247)",
},
{
value: "INT",
name: i18next.t("calendar.event_types.interviews"),
name: i18next.t("calendar.eventTypes.interviews"),
color: "rgb(17, 157, 164)",
},
{
value: "PY",
name: i18next.t("calendar.event_types.partnerships"),
name: i18next.t("calendar.eventTypes.partnerships"),
color: "rgb(216, 227, 118)",
},
{
value: "WK",
name: i18next.t("calendar.event_types.workshops"),
name: i18next.t("calendar.eventTypes.workshops"),
color: "rgb(126, 74, 15)",
},
{
value: "Unfiltered",
name: i18next.t("calendar.event_types.unfiltered"),
name: i18next.t("calendar.eventTypes.unfiltered"),
color: "rgb(17, 78, 198)",
},
];

export const defaultEventCategory: TEventCategory = {
value: "Unfiltered",
label: i18next.t("calendar.event_types.unfiltered"),
label: i18next.t("calendar.eventTypes.unfiltered"),
category: "Unfiltered",
color: "rgb(17, 78, 198)",
};
Original file line number Diff line number Diff line change
@@ -225,19 +225,19 @@ const PieChartModule: FC<IPieChart> = ({ data }) => {
<div className="fontGroup-normal">
<div className="mx-4 my-1">
<span className="text-primaryVariant100 capitalize">
{t("verasity.token_name")}:
{t("verasity.tokenName")}:
</span>{" "}
{name}
</div>
<div className="mx-4 my-1">
<span className="text-primaryVariant100 capitalize">
{t("verasity.token_ticker")}:
{t("verasity.tokenTicker")}:
</span>{" "}
${ticker}
</div>
<div className="mx-4 my-1">
<span className="text-primaryVariant100 capitalize">
{t("verasity.sm_address")}:
{t("verasity.smAddress")}:
</span>{" "}
<span
role="button"
@@ -261,19 +261,19 @@ const PieChartModule: FC<IPieChart> = ({ data }) => {
</div>
<div className="mx-4 my-1">
<span className="text-primaryVariant100 capitalize">
{t("verasity.total_supply")}:
{t("verasity.totalSupply")}:
</span>{" "}
{totalSupply}
</div>
<div className="mx-4 my-1">
<span className="text-primaryVariant100 capitalize">
{t("verasity.max_circle_supply")}:
{t("verasity.max_circleSupply")}:
</span>{" "}
{maxSupply}
</div>
<div className="mx-4 my-1">
<span className="text-primaryVariant100 capitalize">
{t("verasity.circle_supply")}:
{t("verasity.circleSupply")}:
</span>{" "}
{supply}
</div>
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ const CustomTableModule: FC<ICustomTableProps> = ({
if (items.length === 0) {
return (
<div className="flex flex-auto h-300 justify-center items-center">
<p>{t("others.no_items_found")}</p>
<p>{t("others.noItemsFound")}</p>
</div>
);
}
2 changes: 1 addition & 1 deletion packages/frontend/src/components/error/GeneralError.tsx
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ const GeneralError: FC<{ children?: React.ReactNode }> = ({ children }) => {
alt="alphaday logo"
className="m-0 mr-2 h-5"
/>{" "}
{t("back_to_home")}
{t("backTo_home")}
</a>
)}
</div>
2 changes: 1 addition & 1 deletion packages/frontend/src/components/gas/GasPriceTable.tsx
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ const GasPriceTable: FC<TGasPriceTable> = ({
return (
<>
<div className="w-full text-uppercase text-primary mb-5 mt-4">
{t("gas.beacon_chain_data")}
{t("gas.beaconChainData")}
</div>
<KeyValueTable items={items} />
</>
8 changes: 4 additions & 4 deletions packages/frontend/src/components/market/MarketModule.tsx
Original file line number Diff line number Diff line change
@@ -71,14 +71,14 @@ const MarketModule: FC<IMarketModule> = ({
if (selectedMarket === undefined) {
chartComponent = (
<div className="flex items-center justify-center top-[220px] h-[200px] text-primaryVariant100">
{t("market.no_coins_selected")}
{t("market.noCoinSelected")}
</div>
);
} else if (priceHistoryData === undefined && !isLoadingHistory) {
chartComponent = (
<div className="flex items-center justify-center top-[220px] h-[200px] text-primaryVariant100">
{globalMessages.error.requestFailed(
evaluateTemplate(t("market.history_error"), {
evaluateTemplate(t("market.historyError"), {
selectedChartRange,
})
)}
@@ -175,7 +175,7 @@ const MarketModule: FC<IMarketModule> = ({
>
<div className="flex flex-col items-start w-full max-w-[117px] min-w-[120px] my-4 mx-0 fontGroup-normal text-primary">
<span className="fontGroup-mini text-primaryVariant100">
{t("market.market_cap")}
{t("market.marketCap")}
</span>
<span className="value">
<span>
@@ -191,7 +191,7 @@ const MarketModule: FC<IMarketModule> = ({
</div>
<div className="flex flex-col items-start w-full max-w-[117px] min-w-[120px] my-4 mx-0 fontGroup-normal text-primary">
<span className="fontGroup-mini text-primaryVariant100">
{t("market.volume_24h")}
{t("market.volume24h")}
</span>
<span className="value">
<span>
Loading