From cdabe790321f1458ea9e5bb6250eca7019a8d218 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 22 Apr 2023 12:13:12 +0300 Subject: [PATCH] Add Twitter links to translator contributors Closes #1352 --- app/routes/contributions.tsx | 37 ++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/app/routes/contributions.tsx b/app/routes/contributions.tsx index 9429270bd..279bc86d7 100644 --- a/app/routes/contributions.tsx +++ b/app/routes/contributions.tsx @@ -16,6 +16,7 @@ import { } from "~/utils/urls"; import { type SendouRouteHandle } from "~/utils/remix"; import { useTranslation } from "~/hooks/useTranslation"; +import * as React from "react"; export const meta: MetaFunction = () => { return { @@ -35,7 +36,7 @@ const PROGRAMMERS = [ ] as const; const TRANSLATORS: Array<{ - translators: Array; + translators: Array; language: (typeof languages)[number]["code"]; }> = [ { @@ -43,7 +44,10 @@ const TRANSLATORS: Array<{ language: "da", }, { - translators: ["NoAimâ„¢bUrn", "Alice"], + translators: [ + { name: "NoAimâ„¢bUrn", twitter: "noaim_brn" }, + { name: "Alice", twitter: "Aloschus" }, + ], language: "de", }, { @@ -55,7 +59,7 @@ const TRANSLATORS: Array<{ language: "fr", }, { - translators: ["funyaaa", "taqm"], + translators: [{ name: "funyaaa", twitter: "funyaaa1" }, "taqm"], language: "ja", }, { @@ -67,11 +71,11 @@ const TRANSLATORS: Array<{ language: "pl", }, { - translators: ["Ferrari"], + translators: [{ name: "Ferrari", twitter: "Blusling" }], language: "nl", }, { - translators: ["DoubleCookies", "yaga"], + translators: [{ name: "DoubleCookies", twitter: "DblCookies" }, "yaga"], language: "ru", }, { @@ -140,7 +144,28 @@ export default function ContributionsPage() { {TRANSLATORS.map(({ translators, language }) => (
  • - {translators.join(", ")} - {t("contributions:translation")} ( + {translators + .map((t) => + typeof t === "string" ? ( + t + ) : ( + + {t.name} + + ) + ) + .map((element, i, arr) => ( + + {element} + {i !== arr.length - 1 ? ", " : null} + + ))}{" "} + - {t("contributions:translation")} ( {languages.find((lang) => lang.code === language)!.name})
  • ))}