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

Translated missing messages #151

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 8 additions & 2 deletions src/components/Auxilliary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { isMobile } from "react-device-detect";
import { globeImg } from "../util/globe";
import { FormattedMessage } from "react-intl";
import { Link, useNavigate } from "react-router-dom";
import localeList from "../i18n/messages";
import { LocaleContext } from "../i18n/LocaleContext";
// import SnackAdUnit from "./SnackAdUnit";
const ReactGlobe = lazy(() => import("react-globe.gl"));

Expand All @@ -14,6 +16,10 @@ type Props = {
};

export default function Auxilliary({ screen }: Props) {
// Locales
const localeContext = useContext(LocaleContext);
const { locale } = localeContext;

// Navigation
const navigate = useNavigate();

Expand Down Expand Up @@ -99,9 +105,9 @@ export default function Auxilliary({ screen }: Props) {
</div>
{(screen === "Help" || screen === "Settings") && (
<p className="dark:text-gray-200 my-6">
<i>Globle: Capitals</i> is now available.{" "}
<i>{localeList[locale]["Aux4"]}</i> {localeList[locale]["Aux5"]}{" "}
<a href="https://globle-capitals.com" className="underline">
Click here to play!
{localeList[locale]["Aux6"]}
</a>{" "}
</p>
)}
Expand Down
14 changes: 7 additions & 7 deletions src/components/Statistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,22 @@ ${lastWin === today ? emojiGuesses : "--"} = ${todaysGuesses}
try {
if ("canShare" in navigator && isMobile && !isFirefox) {
await navigator.share({ title: "Plurality Stats", text: shareString });
setMsg("Shared!");
setMsg(localeList[locale]["Shared"]);
setShowCopyMsg(true);
return setTimeout(() => setShowCopyMsg(false), 2000);
} else if (navigator.clipboard && window.isSecureContext) {
await navigator.clipboard.writeText(shareString);
setMsg("Copied!");
setMsg(localeList[locale]["Shared"]);
setShowCopyMsg(true);
return setTimeout(() => setShowCopyMsg(false), 2000);
} else {
document.execCommand("copy", true, shareString);
setMsg("Copied!");
setMsg(localeList[locale]["Shared"]);
setShowCopyMsg(true);
return setTimeout(() => setShowCopyMsg(false), 2000);
}
} catch (e) {
setMsg("This browser cannot share");
setMsg(localeList[locale]["ShareErr"]);
setShowCopyMsg(true);
return setTimeout(() => setShowCopyMsg(false), 2000);
}
Expand Down Expand Up @@ -209,7 +209,7 @@ ${lastWin === today ? emojiGuesses : "--"} = ${todaysGuesses}
className="text-md text-center font-extrabold dark:text-gray-200 mb-2"
style={{ fontFamily: "'Montserrat'" }}
>
New game from the creator of Globle!
<FormattedMessage id="ShamelessPlug" />
</h3>
<button
className="rounded-md px-4 py-2 text-xl font-bold mx-auto my-2
Expand Down Expand Up @@ -262,15 +262,15 @@ ${lastWin === today ? emojiGuesses : "--"} = ${todaysGuesses}
onClick={resetStats}
disabled={resetComplete}
>
Yes
<FormattedMessage id="Yes" />
</button>
<button
className="bg-blue-700 text-white rounded-md px-6 py-2 block
text-base font-medium hover:bg-blue-900 disabled:bg-blue-900 focus:outline-none focus:ring-2 focus:ring-blue-300"
onClick={() => setShowResetMsg(false)}
disabled={resetComplete}
>
No
<FormattedMessage id="No" />
</button>
</div>
</Fade>
Expand Down
9 changes: 9 additions & 0 deletions src/i18n/messages/de-DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export const German: Messages = {
Aux1: `<b>["Klick auf", "Drücke"]</b> den Globus zum Spielen!`,
Aux2: "Hast du eine Frage?",
Aux3: "Schau dir das FAQ an",
Aux4: "Globle: Capitals", // TODO: Translate this
Aux5: "is now Available.", // TODO: Translate this
Aux6: "Click here to play!", // TODO: Translate this
Footer1: "von The Abe Train",
Footer2: "Gefällt dir das Spiel?",
Footer3: "Kauf mir einen Kaffee",
Expand Down Expand Up @@ -78,4 +81,10 @@ export const German: Messages = {
PracticeNew: "New practice game", //TODO: Translate
SortByGuesses: "Sort by order of guesses", //TODO: Translate
SortByDistance: "Sort by distance", //TODO: Translate
Copied: "Copied!", // TODO: Translate this
Shared: "Shared!", // TODO: Translate this
ShareErr: "This browser cannot share", // TODO: Translate this
ShamelessPlug: "New game from the creator of Globle!", // TODO: Translate this
Yes: "Yes", // TODO: Translate this
No: "No", // TODO: Translate this
};
9 changes: 9 additions & 0 deletions src/i18n/messages/en-CA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export const English: Messages = {
Aux1: `<b>["Click", "Tap"]</b> the globe to play!`,
Aux2: "Have a question?",
Aux3: "Check out the FAQ",
Aux4: "Globle: Capitals",
Aux5: "is now Available.",
Aux6: "Click here to play!",
Footer1: "by The Abe Train",
Footer2: "Enjoying the game?",
Footer3: "Buy me a coffee",
Expand Down Expand Up @@ -79,4 +82,10 @@ export const English: Messages = {
PracticeNew: "New practice game",
SortByGuesses: "Sort by order of guesses",
SortByDistance: "Sort by distance",
Copied: "Copied!",
Shared: "Shared!",
ShareErr: "This browser cannot share",
ShamelessPlug: "New game from the creator of Globle!",
Yes: "Yes",
No: "No",
};
9 changes: 9 additions & 0 deletions src/i18n/messages/es-MX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export const Spanish: Messages = {
Aux1: "¡Haz click en el globo para jugar!",
Aux2: "¿Tienes alguna duda?",
Aux3: "Visita Preguntas Frecuentes.",
Aux4: "Globle: Capitals", // TODO: Translate this
Aux5: "is now Available.", // TODO: Translate this
Aux6: "Click here to play!", // TODO: Translate this
Footer1: "Creado por The Abe Train",
Footer2: "¿Estas disfrutando el juego?",
Footer3: "Cómprame un café!",
Expand Down Expand Up @@ -75,6 +78,12 @@ export const Spanish: Messages = {
PracticeNew: "New practice game", //TODO: Translate
SortByGuesses: "Sort by order of guesses", //TODO: Translate
SortByDistance: "Sort by distance", //TODO: Translate
Copied: "Copied!", // TODO: Translate this
Shared: "Shared!", // TODO: Translate this
ShareErr: "This browser cannot share", // TODO: Translate this
ShamelessPlug: "New game from the creator of Globle!", // TODO: Translate this
Yes: "Yes", // TODO: Translate this
No: "No", // TODO: Translate this
};

// export default {
Expand Down
9 changes: 9 additions & 0 deletions src/i18n/messages/fr-FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export const French: Messages = {
Aux1: `<b>["Cliquez sur", "Touchez"]</b> le globe pour jouer!`,
Aux2: "Vous avez une question?",
Aux3: "Consultez la FAQ",
Aux4: "Globle: Capitals", // TODO: Translate this
Aux5: "is now Available.", // TODO: Translate this
Aux6: "Click here to play!", // TODO: Translate this
Footer1: "Auteur: The Abe Train",
Footer2: "Le jeu vous plaît?",
Footer3: "Payez-moi un café.",
Expand Down Expand Up @@ -79,4 +82,10 @@ export const French: Messages = {
PracticeNew: "Nouvelle partie d'entraînement",
SortByGuesses: "Trier par ordre des tentatives",
SortByDistance: "Trier par distance",
Copied: "Copied!", // TODO: Translate this
Shared: "Shared!", // TODO: Translate this
ShareErr: "This browser cannot share", // TODO: Translate this
ShamelessPlug: "New game from the creator of Globle!", // TODO: Translate this
Yes: "Yes", // TODO: Translate this
No: "No", // TODO: Translate this
};
9 changes: 9 additions & 0 deletions src/i18n/messages/hu-HU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export const Hungarian: Messages = {
Aux1: `<b>["Kattincs", "Tap"]</b> a földgömbre!`,
Aux2: "Van kérdésed?",
Aux3: "Nézd meg a gyakori kérdéseket",
Aux4: "Globle: Capitals", // TODO: Translate this
Aux5: "is now Available.", // TODO: Translate this
Aux6: "Click here to play!", // TODO: Translate this
Footer1: "The Abe Train által",
Footer2: "Élvezed a játékot?",
Footer3: "Hívj meg egy kávera",
Expand Down Expand Up @@ -78,4 +81,10 @@ export const Hungarian: Messages = {
Guessed: "sejtette",
SortByGuesses: "Rendezés a találgatások sorrendje szerint",
SortByDistance: "Rendezés távolság szerint",
Copied: "Copied!", // TODO: Translate this
Shared: "Shared!", // TODO: Translate this
ShareErr: "This browser cannot share", // TODO: Translate this
ShamelessPlug: "New game from the creator of Globle!", // TODO: Translate this
Yes: "Yes", // TODO: Translate this
No: "No", // TODO: Translate this
};
9 changes: 9 additions & 0 deletions src/i18n/messages/it_IT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export const Italian: Messages = {
Aux1: `<b>["Clicca", "Tap"]</b> sul globo per giocare!`,
Aux2: "Hai una domanda?",
Aux3: "Vai a vedere le FAQ",
Aux4: "Globle: Capitals", // TODO: Translate this
Aux5: "is now Available.", // TODO: Translate this
Aux6: "Click here to play!", // TODO: Translate this
Footer1: "di The Abe Train",
Footer2: "Ti piace il gioco?",
Footer3: "Offrimi un caffè",
Expand Down Expand Up @@ -79,4 +82,10 @@ export const Italian: Messages = {
PracticeNew: "Nuovo gioco di pratica",
SortByGuesses: "Sort by order of guesses", //TODO: Translate
SortByDistance: "Sort by distance", //TODO: Translate
Copied: "Copied!", // TODO: Translate this
Shared: "Shared!", // TODO: Translate this
ShareErr: "This browser cannot share", // TODO: Translate this
ShamelessPlug: "New game from the creator of Globle!", // TODO: Translate this
Yes: "Yes", // TODO: Translate this
No: "No", // TODO: Translate this
};
9 changes: 9 additions & 0 deletions src/i18n/messages/pl-PL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export const Polish: Messages = {
Aux1: `<b>["Kliknij", "Dotknij"]</b> kulę ziemską, żeby zagrać!`,
Aux2: "Masz pytania?",
Aux3: "Zobacz FAQ",
Aux4: "Globle: Capitals", // TODO: Translate this
Aux5: "is now Available.", // TODO: Translate this
Aux6: "Click here to play!", // TODO: Translate this
Footer1: "stworzone przez The Abe Train",
Footer2: "Podoba Ci się gra?",
Footer3: "Kup mi kawę",
Expand Down Expand Up @@ -74,4 +77,10 @@ export const Polish: Messages = {
PracticeNew: "Nowa gra treningowa",
SortByGuesses: "Sort by order of guesses", //TODO: Translate
SortByDistance: "Sort by distance", //TODO: Translate
Copied: "Copied!", // TODO: Translate this
Shared: "Shared!", // TODO: Translate this
ShareErr: "This browser cannot share", // TODO: Translate this
ShamelessPlug: "New game from the creator of Globle!", // TODO: Translate this
Yes: "Yes", // TODO: Translate this
No: "No", // TODO: Translate this
};
13 changes: 11 additions & 2 deletions src/i18n/messages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export const Portuguese: Messages = {
Aux1: `<b>["Clique", "Toque"]</b> no globo para jogar`,
Aux2: "Alguma dúvida?",
Aux3: "Cheque a área Perguntas Frequentes",
Aux4: "Globle: Capitals",
Aux5: "está disponível.",
Aux6: "Clique aqui para jogar!",
Footer1: "por The Abe Train",
Footer2: "Curtindo o jogo?",
Footer3: "Pague meu cafezinho",
Expand Down Expand Up @@ -71,11 +74,17 @@ export const Portuguese: Messages = {
Settings10: "Arco-íris ativado",
Settings11: "Arco-íris desativado",
Answer: "Resposta",
Closest: "Mais próximo",
Closest: "Mais próximos",
Guessed: "Chutados",
PracticeMode: "Você está no modo de treino.",
PracticeExit: "Sair do modo de treino",
PracticeNew: "Novo jogo de trino",
PracticeNew: "Novo jogo de treino",
SortByGuesses: "Listar pela ordem dos chutes",
SortByDistance: "Ordenar pela distância",
Copied: "Copiado!",
Shared: "Compartilhado!",
ShareErr: "This browser cannot share",
ShamelessPlug: "Novo jogo do criador de Globle!",
Yes: "Sim",
No: "Não",
};
9 changes: 9 additions & 0 deletions src/i18n/messages/sv-SE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export const Swedish: Messages = {
Aux1: `<b>["Klicka", "Tryck"]</b> på globen för att spela!`,
Aux2: "Har du en fråga?",
Aux3: "Läs vår FAQ",
Aux4: "Globle: Capitals", // TODO: Translate this
Aux5: "is now Available.", // TODO: Translate this
Aux6: "Click here to play!", // TODO: Translate this
Footer1: "av The Abe Train",
Footer2: "Gillar du spelet?",
Footer3: "Bjud mig på en kaffe",
Expand Down Expand Up @@ -74,4 +77,10 @@ export const Swedish: Messages = {
Guessed: "gissade",
SortByGuesses: "Sortera efter gissningsordning",
SortByDistance: "Sortera efter avstånd",
Copied: "Copied!", // TODO: Translate this
Shared: "Shared!", // TODO: Translate this
ShareErr: "This browser cannot share", // TODO: Translate this
ShamelessPlug: "New game from the creator of Globle!", // TODO: Translate this
Yes: "Yes", // TODO: Translate this
No: "No", // TODO: Translate this
};
9 changes: 9 additions & 0 deletions src/lib/locale.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export type Messages = {
Aux1: string;
Aux2: string;
Aux3: string;
Aux4: string;
Aux5: string;
Aux6: string;
Footer1: string;
Footer2: string;
Footer3: string;
Expand Down Expand Up @@ -85,6 +88,12 @@ export type Messages = {
PracticeNew: string;
SortByGuesses: string;
SortByDistance: string;
Copied: string;
Shared: string;
ShareErr: string;
ShamelessPlug: string;
Yes: string;
No: string;
};

export type LocaleMessages = Record<Locale, Messages>;