Skip to content

Commit

Permalink
feat: add translations for delete modal text
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanlundberg committed Nov 28, 2023
1 parent 604d8a7 commit dce9188
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 9 deletions.
29 changes: 20 additions & 9 deletions src/components/cubes/DeleteModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { DeleteCubeDetails } from "@/interfaces/DeleteCubeDetails";
import { useSettingsModalStore } from "@/store/SettingsModalStore";
import translation from "@/translations/global.json";

export default function DeleteModal({
confirmDelete,
cancelDelete,
Expand All @@ -8,13 +11,14 @@ export default function DeleteModal({
cancelDelete: () => void;
cubeData: DeleteCubeDetails | null;
}) {
const { lang } = useSettingsModalStore();
if (!cubeData) return;
return (
<>
<div className="fixed top-0 left-0 z-50 flex items-center justify-center w-full h-screen text-black bg-opacity-80 bg-neutral-900">
<div className="flex flex-col w-full h-auto gap-3 p-3 m-8 bg-white rounded-lg shadow-lg sm:w-96">
<div className="text-lg font-medium text-center">
Are you sure you want to delete?
{translation.cubes.modal["question-delete"][lang]}
</div>

<div className="px-2 mx-auto font-mono text-center text-black bg-yellow-300 w-fit text-md ">
Expand All @@ -23,10 +27,18 @@ export default function DeleteModal({

<div className="flex justify-center gap-2 ">
<div className="flex flex-col text-end">
<div className="text-black">Category: </div>
<div className="text-black">Best time: </div>
<div className="text-black">Best Ao5: </div>
<div className="text-black">Count: </div>
<div className="text-black">
{translation.cubes.table["category"][lang]}:{" "}
</div>
<div className="text-black">
{translation.settings["best-time"][lang]}:{" "}
</div>
<div className="text-black">
{translation.timer["best"][lang]} Ao5:{" "}
</div>
<div className="text-black">
{translation.timer["counter"][lang]}:{" "}
</div>
</div>

<div className="flex flex-col text-start">
Expand All @@ -46,23 +58,22 @@ export default function DeleteModal({
</div>

<div className="w-11/12 mx-auto text-xs text-center">
This irreversible action will delete all solve history for this cube
and may impact your statistics.
{translation.cubes.modal["warning-delete"][lang]}
</div>

<div className="flex justify-center w-full h-10 gap-3">
<button
onClick={cancelDelete}
className="px-4 py-2 transition duration-200 rounded-lg bg-neutral-200 text-neutral-900 hover:bg-neutral-300"
>
Cancel
{translation.inputs["cancel"][lang]}
</button>

<button
onClick={confirmDelete}
className="px-4 py-2 text-white transition duration-200 bg-red-600 rounded-lg hover:bg-red-700"
>
Confirm
{translation.inputs["confirm"][lang]}
</button>
</div>
</div>
Expand Down
102 changes: 102 additions & 0 deletions src/translations/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -2469,6 +2469,74 @@
"sk": "Aktuálny výber:",
"fil": "Kasalukuyang Piling:",
"et": "Praegune valik:"
},

"question-delete": {
"en": "Are you sure you want to delete?",
"es": "¿Estás seguro/a de que quieres eliminar?",
"fr": "Êtes-vous sûr(e) de vouloir supprimer ?",
"de": "Möchten Sie wirklich löschen?",
"ja": "削除してもよろしいですか?",
"zh": "您确定要删除吗?",
"ru": "Вы уверены, что хотите удалить?",
"hi": "क्या आप सुनिश्चित हैं कि आपको हटाना है?",
"pt": "Tem certeza de que deseja excluir?",
"it": "Sei sicuro/a di voler eliminare?",
"ko": "정말 삭제하시겠습니까?",
"nl": "Weet u zeker dat u wilt verwijderen?",
"sv": "Är du säker på att du vill ta bort?",
"tr": "Silmek istediğinizden emin misiniz?",
"pl": "Czy na pewno chcesz usunąć?",
"vi": "Bạn có chắc chắn muốn xóa không?",
"th": "คุณแน่ใจหรือไม่ว่าต้องการลบ?",
"el": "Είστε σίγουρος/η ότι θέλετε να διαγράψετε;",
"fi": "Oletko varma, että haluat poistaa?",
"uk": "Ви впевнені, що хочете видалити?",
"cs": "Jste si jisti, že chcete smazat?",
"ro": "Sigur doriți să ștergeți?",
"no": "Er du sikker på at du vil slette?",
"da": "Er du sikker på, at du vil slette?",
"ms": "Adakah anda pasti ingin memadam?",
"hu": "Biztosan törölni szeretné?",
"id": "Apakah Anda yakin ingin menghapus?",
"bn": "আপনি কি নিশ্চিত যে আপনি মুছতে চান?",
"sk": "Ste si istý/á, že chcete vymazať?",
"fil": "Sigurado ka bang nais mong burahin?",
"et": "Kas soovite kindlasti kustutada?"
},

"warning-delete": {
"en": "This irreversible action will delete all solve history for this cube and may impact your statistics.",
"es": "Esta acción irreversible eliminará todo el historial de resolución para este cubo y puede afectar tus estadísticas.",
"fr": "Cette action irréversible supprimera tout l'historique de résolution pour ce cube et pourrait avoir un impact sur vos statistiques.",
"de": "Diese nicht umkehrbare Aktion wird den gesamten Lösungsverlauf für diesen Würfel löschen und kann sich auf Ihre Statistiken auswirken.",
"ja": "この取り消しできないアクションは、このキューブのすべての解決履歴を削除し、統計に影響を与える可能性があります。",
"zh": "这个不可逆的操作将删除此魔方的所有解决历史,可能影响您的统计数据。",
"ru": "Это необратимое действие удалит всю историю решения для этого куба и может повлиять на ваши статистические данные.",
"hi": "यह पराक्रमशील क्रिया इस क्यूब के लिए सभी हल करने का इतिहास मिटा देगी और आपके आंकड़ों पर असर डाल सकती है।",
"pt": "Esta ação irreversível excluirá todo o histórico de resolução para este cubo e pode impactar suas estatísticas.",
"it": "Questa azione irreversibile cancellerà tutto lo storico delle soluzioni per questo cubo e potrebbe influire sulle tue statistiche.",
"ko": "이 불가역적인 조치는 이 큐브에 대한 모든 해결 이력을 삭제하고 통계에 영향을 줄 수 있습니다.",
"nl": "Deze onomkeerbare actie zal alle oplossingsgeschiedenis voor deze kubus verwijderen en kan invloed hebben op uw statistieken.",
"sv": "Denna oåterkalleliga åtgärd kommer att ta bort all lösningshistorik för denna kub och kan påverka dina statistik.",
"tr": "Bu geri alınamaz eylem, bu küp için tüm çözüm geçmişini silecek ve istatistiklerinizi etkileyebilir.",
"pl": "To nieodwracalne działanie spowoduje usunięcie całej historii rozwiązania dla tego sześcianu i może wpłynąć na twoje statystyki.",
"vi": "Hành động không thể đảo ngược này sẽ xóa tất cả lịch sử giải cho chiếc kệt này và có thể ảnh hưởng đến thống kê của bạn.",
"th": "การกระทำที่ไม่สามารถย้อนกลับนี้จะลบประวัติการแก้ปัญหาทั้งหมดสำหรับคิวบ์นี้และอาจมีผลต่อสถิติของคุณ",
"el": "Αυτή η αναίρεση δράση θα διαγράψει όλο το ιστορικό επίλυσης για αυτό το κύβο και ενδέχεται να επηρεάσει τα στατιστικά σας.",
"fi": "Tämä peruuttamaton toimenpide poistaa kaiken ratkaisuhistorian tältä kuutiolta ja voi vaikuttaa tilastoihisi.",
"uk": "Ця необоротна дія видалить всю історію вирішення для цього куба та може вплинути на вашу статистику.",
"cs": "Tato nevratná akce smaže veškerou historii řešení pro tento kostky a může ovlivnit vaši statistiku.",
"ro": "Această acțiune ireversibilă va șterge întreaga istorie a rezolvării pentru acest cub și ar putea afecta statistica ta.",
"no": "Denne uopprettelige handlingen vil slette all løsninghistorikk for denne kuben og kan påvirke statistikken din.",
"da": "Denne uoprettelige handling vil slette al løsningshistorik for denne kube og kan påvirke dine statistikker.",
"ms": "Tindakan ini yang tidak boleh dibatalkan akan memadamkan semua sejarah penyelesaian untuk kubus ini dan mungkin memberi kesan kepada statistik anda.",
"hu": "Ez a nem visszafordítható cselekvés törölni fogja a kocka összes megoldási történetét, és befolyásolhatja a statisztikáit.",
"id": "Tindakan ini yang tidak dapat diurungkan akan menghapus semua riwayat penyelesaian untuk kubus ini dan dapat mempengaruhi statistik Anda.",
"bn": "এই অবনিবৃত্ত ক্রিয়াটি এই কিউবের সম্পূর্ণ সমাধান ইতিহাসটি মুছে ফেলবে এবং আপনার পরিস্থিতিতে প্রভাব ফেলতে পারে।",
"sk": "Táto nevratná akcia vymaže celú históriu riešenia pre túto kocku a môže ovplyvniť vašu štatistiku.",
"fil": "Ang hindi mababawiang aksyon na ito ay maglilinis ng buong kasaysayan ng paglutas para sa kahong ito at maaaring makaapekto sa iyong estadistika.",
"et": "See pöördumatu toiming kustutab selle kuubi jaoks kogu lahendusajaloo ja võib mõjutada teie statistikat."
}
}
},
Expand Down Expand Up @@ -2711,6 +2779,40 @@
"et": "Loo"
},

"confirm": {
"en": "Confirm",
"es": "Confirmar",
"fr": "Confirmer",
"de": "Bestätigen",
"ja": "確認",
"zh": "确认",
"ru": "Подтвердить",
"hi": "पुष्टि करें",
"pt": "Confirmar",
"it": "Conferma",
"ko": "확인",
"nl": "Bevestigen",
"sv": "Bekräfta",
"tr": "Onayla",
"pl": "Potwierdź",
"vi": "Xác nhận",
"th": "ยืนยัน",
"el": "Επιβεβαίωση",
"fi": "Vahvista",
"uk": "Підтвердити",
"cs": "Potvrdit",
"ro": "Confirma",
"no": "Bekreft",
"da": "Bekræft",
"ms": "Sahkan",
"hu": "Megerősít",
"id": "Konfirmasi",
"bn": "অনুমোদন করুন",
"sk": "Potvrdiť",
"fil": "Kumpirmahin",
"et": "Kinnita"
},

"cancel": {
"en": "Cancel",
"es": "Cancelar",
Expand Down

0 comments on commit dce9188

Please sign in to comment.