Skip to content

Commit

Permalink
Merge pull request #228 from bryanlundberg/solves-opt-translations
Browse files Browse the repository at this point in the history
feat: Add modal translations for resolution
  • Loading branch information
bryanlundberg authored Dec 26, 2023
2 parents d697945 + f17ce92 commit 5873219
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 6 deletions.
15 changes: 11 additions & 4 deletions src/components/solves/ModalSolve.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ import DocumentDuplicate from "@/icons/DocumentDuplicate";
import Trash from "@/icons/Trash";
import { useEffect, useState } from "react";
import ChevronUp from "@/icons/ChevronUp";
import { useSettingsModalStore } from "@/store/SettingsModalStore";
import translation from "@/translations/global.json";

export default function ModalSolve() {
const [showOptions, setShowOptions] = useState<boolean>(false);
const [showScramble, setShowScramble] = useState<boolean>(false);
const { status, solve, setStatus } = useSolvesStore();
const { setCubes, setSelectedCube, selectedCube } = useTimerStore();
const { lang } = useSettingsModalStore();

useEffect(() => {
setShowOptions(false);
Expand Down Expand Up @@ -159,7 +162,11 @@ export default function ModalSolve() {
<div className="flex items-center justify-center gap-3">
<div
className="w-5 h-5 transition duration-200 hover:text-neutral-500 hover:cursor-pointer"
onClick={() => window.prompt("Enter a comment")}
onClick={() =>
window.prompt(
`${translation.solves["enter-a-comment"][lang]}`
)
}
>
<ChatBubble />
</div>
Expand All @@ -181,7 +188,7 @@ export default function ModalSolve() {
<div className="w-4 h-4">
<ArchiveBox />
</div>
<div>Archive</div>
<div>{translation.solves["archive"][lang]}</div>
</div>
<div
className="flex items-center gap-1 py-1 transition duration-200 ps-2 hover:text-neutral-500 hover:cursor-pointer"
Expand All @@ -194,7 +201,7 @@ export default function ModalSolve() {
<div className="w-4 h-4">
<DocumentDuplicate />
</div>
<div>Copy</div>
<div>{translation.solves["copy"][lang]}</div>
</div>
<div
className="flex items-center gap-1 py-1 transition duration-200 ps-2 hover:text-neutral-500 hover:cursor-pointer"
Expand All @@ -203,7 +210,7 @@ export default function ModalSolve() {
<div className="w-4 h-4">
<Trash />
</div>
<div>Remove</div>
<div>{translation.solves["remove"][lang]}</div>
</div>
</div>
)}
Expand Down
6 changes: 4 additions & 2 deletions src/components/timer/ManualMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useState } from "react";
import SolveOptions from "./SolveOptions";
import { useSettingsModalStore } from "@/store/SettingsModalStore";
import { Themes } from "@/interfaces/types/Themes";
import translation from "@/translations/global.json";

const variation: Record<Themes, string> = {
light:
Expand All @@ -27,7 +28,7 @@ export default function ManualMode() {
setCubes,
setSelectedCube,
} = useTimerStore();
const { settings } = useSettingsModalStore();
const { settings, lang } = useSettingsModalStore();

const isValidInput = (input: string) => {
if (/^[0-9]*$/.test(input) && parseInt(input) > 0) return true;
Expand Down Expand Up @@ -93,7 +94,8 @@ export default function ManualMode() {
/>
{value !== "" ? (
<div className="mt-1 text-center">
Preview: {formatTime(convertToMs(value))}{" "}
{translation.timer["preview"][lang]}:{" "}
{formatTime(convertToMs(value))}{" "}
</div>
) : null}
{lastSolve && settings.features.quickActionButtons.status ? (
Expand Down
165 changes: 165 additions & 0 deletions src/translations/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,39 @@
"fil": "I-press ang SPACE para simulan",
"et": "Vajutage ALUSTAMISEKS tühikut"
},
"preview": {
"en": "Preview",
"es": "Vista previa",
"fr": "Aperçu",
"de": "Vorschau",
"ja": "プレビュー",
"zh": "预览",
"ru": "Просмотр",
"hi": "पूर्वावलोकन",
"pt": "Pré-visualização",
"it": "Anteprima",
"ko": "미리보기",
"nl": "Voorbeeld",
"sv": "Förhandsgranska",
"tr": "Önizleme",
"pl": "Podgląd",
"vi": "Xem trước",
"th": "ตัวอย่าง",
"el": "Προεπισκόπηση",
"fi": "Esikatselu",
"uk": "Перегляд",
"cs": "Náhled",
"ro": "Previzualizare",
"no": "Forhåndsvisning",
"da": "Forhåndsvisning",
"ms": "Pratonton",
"hu": "Előnézet",
"id": "Pratinjau",
"bn": "পূর্বরূপ",
"sk": "Náhľad",
"fil": "Preview",
"et": "Eelvaade"
},
"empty-scramble": {
"en": "Choose a cube to load a scramble.",
"es": "Elige un cubo para cargar una mezcla.",
Expand Down Expand Up @@ -1303,6 +1336,138 @@
"et": "Lahendused"
},

"archive": {
"en": "Archive",
"es": "Archivo",
"fr": "Archiver",
"de": "Archivieren",
"ja": "アーカイブ",
"zh": "存档",
"ru": "Архив",
"hi": "संग्रह",
"pt": "Arquivo",
"it": "Archivio",
"ko": "아카이브",
"nl": "Archief",
"sv": "Arkiv",
"tr": "Arşivle",
"pl": "Archiwum",
"vi": "Lưu trữ",
"th": "เก็บถาวร",
"el": "Αρχείο",
"fi": "Arkisto",
"uk": "Архів",
"cs": "Archivovat",
"ro": "Arhivă",
"no": "Arkiv",
"da": "Arkiv",
"ms": "Arkib",
"hu": "Archiválás",
"id": "Arsip",
"bn": "আর্কাইভ",
"sk": "Archív",
"fil": "Akwaryo",
"et": "Arhiiv"
},
"copy": {
"en": "Copy",
"es": "Copiar",
"fr": "Copier",
"de": "Kopieren",
"ja": "コピー",
"zh": "复制",
"ru": "Копировать",
"hi": "कॉपी करें",
"pt": "Copiar",
"it": "Copia",
"ko": "복사",
"nl": "Kopiëren",
"sv": "Kopiera",
"tr": "Kopyala",
"pl": "Kopiuj",
"vi": "Sao chép",
"th": "คัดลอก",
"el": "Αντιγραφή",
"fi": "Kopioi",
"uk": "Копіювати",
"cs": "Kopírovat",
"ro": "Copiază",
"no": "Kopier",
"da": "Kopier",
"ms": "Salin",
"hu": "Másolás",
"id": "Salin",
"bn": "কপি",
"sk": "Kopírovať",
"fil": "Kopyahin",
"et": "Kopeeri"
},
"remove": {
"en": "Remove",
"es": "Eliminar",
"fr": "Supprimer",
"de": "Entfernen",
"ja": "削除",
"zh": "移除",
"ru": "Удалить",
"hi": "हटाएं",
"pt": "Remover",
"it": "Rimuovi",
"ko": "제거",
"nl": "Verwijderen",
"sv": "Ta bort",
"tr": "Kaldır",
"pl": "Usuń",
"vi": "Xóa",
"th": "ลบ",
"el": "Αφαίρεση",
"fi": "Poista",
"uk": "Видалити",
"cs": "Odstranit",
"ro": "Elimină",
"no": "Fjern",
"da": "Fjern",
"ms": "Padam",
"hu": "Eltávolítás",
"id": "Hapus",
"bn": "মুছে ফেলুন",
"sk": "Odstrániť",
"fil": "Alisin",
"et": "Eemalda"
},
"enter-a-comment": {
"en": "Enter a comment",
"es": "Ingresar un comentario",
"fr": "Entrer un commentaire",
"de": "Einen Kommentar eingeben",
"ja": "コメントを入力",
"zh": "输入评论",
"ru": "Введите комментарий",
"hi": "टिप्पणी दर्ज करें",
"pt": "Inserir um comentário",
"it": "Inserisci un commento",
"ko": "댓글 입력",
"nl": "Voer een opmerking in",
"sv": "Ange en kommentar",
"tr": "Bir yorum girin",
"pl": "Wprowadź komentarz",
"vi": "Nhập bình luận",
"th": "ป้อนความคิดเห็น",
"el": "Εισαγωγή σχολίου",
"fi": "Kirjoita kommentti",
"uk": "Введіть коментар",
"cs": "Zadejte komentář",
"ro": "Introduceți un comentariu",
"no": "Skriv en kommentar",
"da": "Indtast en kommentar",
"ms": "Masukkan komen",
"hu": "Írjon be egy megjegyzést",
"id": "Masukkan komentar",
"bn": "মন্তব্য করুন",
"sk": "Zadajte komentár",
"fil": "Maglagay ng komento",
"et": "Sisesta kommentaar"
},
"filter": {
"session": {
"en": "Session",
Expand Down

0 comments on commit 5873219

Please sign in to comment.