Skip to content

Commit a024e27

Browse files
committed
refactor: add challenges description translations
1 parent 88c137c commit a024e27

File tree

6 files changed

+26
-19
lines changed

6 files changed

+26
-19
lines changed

public/locales/bg/common.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
"page.protocols.contact.name.2": "Paul Walton",
9090
"page.protocols.contact.title.2": "Business Development",
9191
"page.protocols.contact.email.2": "[email protected]",
92+
"communities.overview.challenges.title": "Предизвикателства",
93+
"communities.overview.challenges.description": "В курсовете на тази общност ще имате възможност да научите за нови технологии, да решавате предизвикателства, да получавате обратна връзка и да печелите награди.",
9294
"communities.overview.challenge": "Creative Challenge",
9395
"communities.overview.chapter": "Chapter Overview",
9496
"communities.overview.learning-modules": "Learning Modules",
@@ -165,8 +167,8 @@
165167
"communities.navigation.language.es": "Spanish",
166168
"communities.overview.courses.title": "Courses",
167169
"communities.overview.courses.description": "In the courses of this community, you will be able to learn about new technologies, solve challenges, get feedback and earn bounties.",
168-
"communities.overview.scoreboard.title": "Scoreboard",
169-
"communities.overview.scoreboard.description": "On the scoreboard, you can see which users have accumulated the most reputation by giving valuable feedback to their peers.",
170+
"communities.overview.scoreboard.title": "Табло за резултати",
171+
"communities.overview.scoreboard.description": "На таблото можете да видите кои потребители са натрупали най-много репутация, като предоставят ценни обратни връзки на своите колеги.",
170172
"communities.scoreboard.empty-state.title": "Няма оценки за тази категория.",
171173
"communities.card.estimated": "Estimated Time",
172174
"communities.card.earn": "Earn rewards",

public/locales/en/common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@
110110
"communities.submissions": "Submissions",
111111
"communities.submission": "Submission",
112112
"communities.challenge.title": "Challenge",
113+
"communities.overview.challenges.title": "Challenges",
114+
"communities.overview.challenges.description": "In the courses of this community, you will be able to learn about new technologies, solve challenges, get feedback, and earn bounties.",
113115
"communities.overview.challenge.title": "Already ready to complete the challenge?",
114116
"communities.overview.challenge.rewards": " Rewards",
115117
"communities.overview.challenge.certificate": "Certificate",

public/locales/es/common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@
110110
"communities.submissions": "Propuestas",
111111
"communities.submission": "Envío",
112112
"communities.challenge.title": "Reto",
113+
"communities.overview.challenges.title": "Desafíos",
114+
"communities.overview.challenges.description": "En los cursos de esta comunidad, podrás aprender sobre nuevas tecnologías, resolver desafíos, recibir retroalimentación y ganar recompensas.",
113115
"communities.overview.challenge.rewards": "Recompensas",
114116
"communities.overview.challenge.certificate": "Certificate",
115117
"communities.overview.challenge.subtitle": "Al completar con éxito",

public/locales/hr/common.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
"page.protocols.contact.name.2": "Paul Walton",
9090
"page.protocols.contact.title.2": "Business Development",
9191
"page.protocols.contact.email.2": "[email protected]",
92+
"communities.overview.challenges.title": "Izazovi",
93+
"communities.overview.challenges.description": "Kroz tečajeve ove zajednice, moći ćete učiti o novim tehnologijama, rješavati izazove, dobivati povratne informacije i zarađivati nagrade.",
9294
"communities.overview.challenge": "Kreativni izazov",
9395
"communities.overview.chapter": "Chapter Overview",
9496
"communities.overview.learning-modules": "Moduli učenja",
@@ -152,8 +154,8 @@
152154
"communities.navigation.language.es": "Spanish",
153155
"communities.overview.courses.title": "Courses",
154156
"communities.overview.courses.description": "In the courses of this community, you will be able to learn about new technologies, solve challenges, get feedback and earn bounties.",
155-
"communities.overview.scoreboard.title": "Scoreboard",
156-
"communities.overview.scoreboard.description": "On the scoreboard, you can see which users have accumulated the most reputation by giving valuable feedback to their peers.",
157+
"communities.overview.scoreboard.title": "Rezultatska ploča",
158+
"communities.overview.scoreboard.description": "Na ploči rezultata možete vidjeti koji su korisnici stekli najviše reputacije pružanjem vrijednih povratnih informacija svojim kolegama.",
157159
"communities.scoreboard.empty-state.title": "Nema bodova za ovu kategoriju.",
158160
"communities.card.estimated": "Estimated Time",
159161
"communities.card.earn": "Earn rewards",

src/components/sections/communities/overview/Sidebar.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useSelector } from "@/hooks/useTypedSelector";
22
import Link from "next/link";
33
import { useRouter } from "next/router";
4+
import { useTranslation } from "react-i18next";
45

56
/**
67
* @interface SidebarProps
@@ -16,6 +17,7 @@ export default function Sidebar(): JSX.Element {
1617
const currentCommunity = useSelector((state) => state.communities.current);
1718
const hasCurrentCommunity = !!currentCommunity; // Check if currentCommunity exists
1819
const router = useRouter();
20+
const { t } = useTranslation();
1921

2022
/**
2123
* Checks if the given link is the active (current) route.
@@ -33,19 +35,15 @@ export default function Sidebar(): JSX.Element {
3335
<div className="flex flex-col divide-y divide-solid divide-gray-100 w-full text-gray-700 space-y-6">
3436
<Link href={mainLink}>
3537
<div className={isActive(mainLink) ? "" : "opacity-80"}>
36-
<div className="font-medium text-.5xl leading-snug">Challenges</div>
37-
<div className="text-sm font-light lg:w-full lg:pr-7 pt-2 mb-6 md:mb-0">
38-
In the courses of this community, you will be able to learn about new technologies, solve challenges, get feedback, and earn bounties.
39-
</div>
38+
<div className="font-medium text-.5xl leading-snug">{t("communities.overview.challenges.title")}</div>
39+
<div className="text-sm font-light lg:w-full lg:pr-7 pt-2 mb-6 md:mb-0">{t("communities.overview.challenges.description")} </div>
4040
</div>
4141
</Link>
4242
{hasCurrentCommunity && (
4343
<Link href={scoreboardLink}>
4444
<div className={isActive(scoreboardLink) ? "pt-5" : "opacity-80 md:block hidden scroll-smooth pt-5"}>
45-
<div className="font-medium text-.5xl leading-snug">Scoreboard</div>
46-
<div className="text-sm font-light lg:w-full lg:pr-7 pt-2 mb-6 md:mb-0">
47-
On the scoreboard, you can see which users have accumulated the most reputation by giving valuable feedback to their peers.
48-
</div>
45+
<div className="font-medium text-.5xl leading-snug">{t("communities.overview.scoreboard.title")}</div>
46+
<div className="text-sm font-light lg:w-full lg:pr-7 pt-2 mb-6 md:mb-0">{t("communities.overview.scoreboard.description")}</div>
4947
</div>
5048
</Link>
5149
)}

src/pages/communities/[slug]/index.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,25 @@ import { fetchCurrentCommunity } from "@/store/services/community.service";
1111
import { fetchAllChallenges } from "@/store/services/communities/challenges";
1212
import { NotFoundError } from "@/utilities/errors/NotFoundError";
1313
import { fetchAllScoreboards } from "@/store/services/communities/scoreboard.service";
14+
import { useTranslation } from "react-i18next";
15+
1416
export default function Slug(props: {
1517
pageProps: {
1618
community: Community;
1719
challenges: Challenge[];
1820
};
1921
}): ReactElement {
2022
const { community, challenges } = props.pageProps;
23+
const { t } = useTranslation();
2124
return (
2225
<CommunityWrapper>
2326
{challenges.map((challenge) => (
2427
<ChallengeCard key={challenge.id} data={challenge} community={community} />
2528
))}
2629
<div className="md:hidden">
2730
<div className="active md:hidden mb-7 scroll-smooth pt-5">
28-
<div className="font-medium text-.5xl leading-snug">Scoreboard</div>
29-
<div className="text-sm font-light lg:w-full lg:pr-7 pt-2">
30-
On the scoreboard, you can see which users have accumulated the most reputation by giving valuable feedback to their peers.
31-
</div>
31+
<div className="font-medium text-.5xl leading-snug">{t("communities.overview.scoreboard.title")}</div>
32+
<div className="text-sm font-light lg:w-full lg:pr-7 pt-2">{t("communities.overview.scoreboard.description")} </div>
3233
</div>
3334
<Scoreboard />
3435
</div>
@@ -44,18 +45,18 @@ export const getServerSideProps = wrapper.getServerSideProps((store) => async ({
4445
try {
4546
const slug = params?.slug as string;
4647

47-
const [{ data: community }, { data: challenges }, { data: scoreboards }, translations] = await Promise.all([
48+
const [{ data: community }, { data: challenges }, { data: scoreboard }, translations] = await Promise.all([
4849
store.dispatch(fetchCurrentCommunity({ slug, locale })),
4950
store.dispatch(fetchAllChallenges({ slug })),
5051
store.dispatch(fetchAllScoreboards({ slug, locale: locale || "en" })),
5152
serverSideTranslations(locale as string),
5253
]);
53-
if (!community || !challenges || !scoreboards) throw new NotFoundError();
54+
if (!community || !challenges || !scoreboard) throw new NotFoundError();
5455
return {
5556
props: {
5657
community,
5758
challenges,
58-
scoreboards,
59+
scoreboard,
5960
...translations,
6061
},
6162
};

0 commit comments

Comments
 (0)