diff --git a/app/(core)/components/GitHubHeaderBadge.jsx b/app/(core)/components/GitHubHeaderBadge.jsx index 1c3018c..7c9174a 100644 --- a/app/(core)/components/GitHubHeaderBadge.jsx +++ b/app/(core)/components/GitHubHeaderBadge.jsx @@ -1,5 +1,6 @@ "use client"; +import useTranslation from "../hooks/useTranslation.ts"; import { useEffect, useMemo, useState } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faGithub } from "@fortawesome/free-brands-svg-icons"; @@ -11,6 +12,7 @@ const CONTRIBUTORS_API = `${REPO_API}/contributors?per_page=100`; export default function GitHubHeaderBadge({ mode }) { const [stats, setStats] = useState({ stars: null, contributors: null }); const [messageIndex, setMessageIndex] = useState(0); + const { t } = useTranslation(); useEffect(() => { let cancelled = false; @@ -52,13 +54,13 @@ export default function GitHubHeaderBadge({ mode }) { const messages = useMemo( () => [ - stats.stars != null ? `${stats.stars} stars` : "Open source", + stats.stars != null ? `${stats.stars} ${t("stars")}` : t("Open source"), stats.contributors != null - ? `${stats.contributors} contributors` - : "Built in public", - "Star the repo", + ? `${stats.contributors} ${t("contributors")}` + : t("Built in public"), + t("Star the repo"), ], - [stats] + [stats, t] ); useEffect(() => { diff --git a/app/(core)/components/LanguageSwitcher.jsx b/app/(core)/components/LanguageSwitcher.jsx index 807d55f..d2e7497 100644 --- a/app/(core)/components/LanguageSwitcher.jsx +++ b/app/(core)/components/LanguageSwitcher.jsx @@ -5,11 +5,11 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faLanguage, faChevronDown } from "@fortawesome/free-solid-svg-icons"; import useTranslation from "../hooks/useTranslation.ts"; import "../styles/translator.css"; +import meta from "../locales/meta.json"; -const LANGUAGES = { - en: "English", - ru: "Русский", -}; +const LANGUAGES = Object.fromEntries( + Object.entries(meta).map(([code, info]) => [code, info.name]) +); const getStoredLang = () => { if (typeof document === "undefined") return "en"; @@ -47,7 +47,7 @@ export default function LanguageSwitcher() { useEffect(() => { if (typeof document === "undefined") return; - document.documentElement.lang = currentLanguage === "ru" ? "ru" : "en"; + document.documentElement.lang = currentLanguage; }, [currentLanguage]); const changeLanguage = useCallback((languageCode) => { diff --git a/app/(core)/locales/en.json b/app/(core)/locales/en.json index 58b6726..c053a06 100644 --- a/app/(core)/locales/en.json +++ b/app/(core)/locales/en.json @@ -229,5 +229,12 @@ "Why we built this": "", "Write a caption...": "", "Write theory about simulations": "", - "Zero Paywalls:": "" + "Zero Paywalls:": "", + "Simulations": "", + "About": "", + "Open source": "", + "Built in public": "", + "Star the repo": "", + "stars": "", + "contributors": "" } diff --git a/app/(core)/locales/meta.json b/app/(core)/locales/meta.json index 6fed604..5d0679a 100644 --- a/app/(core)/locales/meta.json +++ b/app/(core)/locales/meta.json @@ -22,5 +22,9 @@ "ar": { "name": "Arabic", "completed": true + }, + "rw": { + "name": "Kinyarwanda", + "completed": true } } diff --git a/app/(core)/locales/rw.json b/app/(core)/locales/rw.json new file mode 100644 index 0000000..503cb7f --- /dev/null +++ b/app/(core)/locales/rw.json @@ -0,0 +1,240 @@ +{ + " uploaded successfully!": "Yashyizweho neza!", + "A small web application to help student understand physics with cool interactive simulations and easily understandable theory.": "Porogaramu ntoya yo kuri interineti ifasha abanyeshuri gusobanukirwa na fiziki binyuze mu bigeragezo bikorana kandi biteye akamaro n'inyigisho yoroshye gusobanukirwa.", + "Add Callout/Note": "Ongeraho Icyitonderwa/Inyandiko", + "Add Code Block": "Ongeraho Igice cya Kode", + "Add Column": "Ongeraho Inkingi", + "Add Example/Quote": "Ongeraho Urugero/Interuro", + "Add Formula (LaTeX)": "Ongeraho Ingano (LaTeX)", + "Add H3 Subheading": "Ongeraho Umutwe muto H3", + "Add H4/H5 Subtitle": "Ongeraho Umutwe muto H4/H5", + "Add Image": "Ongeraho Ishusho", + "Add Item": "Ongeraho Ikintu", + "Add List": "Ongeraho Urutonde", + "Add Paragraph": "Ongeraho Igika", + "Add Row": "Ongeraho Umurongo", + "Add Section Title": "Ongeraho Umutwe w'Igice", + "Add Table": "Ongeraho Imbonerahamwe", + "Add Toggle/Spoiler": "Ongeraho Guhisha/Kwerekana", + "All the blogs": "Inyandiko zose", + "and": "na", + "and talk with fans and contributors!": "kandi uganire n'abakunzi n'abaterankunga!", + "and the": "na", + "Anyone can contribute to this project, even if you aren't a programmer. We need people that want to write the theory part or just to give us some new ideas.": "Umuntu wese ashobora gufasha muri uyu mushinga, n'ubwo utari umuporogaramu. Dukeneye abantu bashaka kwandika igice cy'inyigisho cyangwa gutanga ibitekerezo bishya.", + "Are you sure?": "Uzi neza?", + "Author": "Uwanditse", + "Back": "Subira inyuma", + "Back to Blog List": "Subira ku rutonde rw'inyandiko", + "Back to home": "Subira ahabanza", + "Back to top": "Subira hejuru", + "Because we are open-source, you can inspect the code to see how gravity works, fork a repo to build your own experiment, or fix a bug in our optics engine.": "Kubera ko turi open-source, ushobora gusuzuma kode kugira ngo ubone uko imbaraga rukuruzi (gravity) ikora, gufatisha (fork) ububiko kugira ngo wubake igeragezwa ryawe bwite, cyangwa gukosora ikosa mu mashini yacu ya optique.", + "below": "hasi", + "Beyond the labs, this is a": "Hejuru y'ibizamini, iyi ni", + "Blog": "Inyandiko", + "Built by the people who use it.": "Yubatswe n'abantu bayikoresha.", + "Built for accuracy": "Yubatswe kugira ngo ibe nyayo", + "Card view": "Kureba mu makarita", + "Change simulation speed": "Hindura umuvuduko w'igeragezwa", + "Chapter": "Igice", + "chapters available.": "ibice biboneka.", + "Check out this simulation on PhysicsHub, it's": "Reba iri geragezwa kuri PhysicsHub, ni", + "Clean code structure for forking": "Imiterere isukuye ya kode yo gufatisha (fork)", + "Close": "Funga", + "Close modal": "Funga idirishya", + "collaborative space": "umwanya wo gukorana", + "commit": "commit", + "commits": "commits", + "Community Driven:": "Biyoborwa n'umuryango:", + "Compact view": "Kureba muto", + "completely free": "ku buntu burundu", + "Connect": "Huza", + "Contents": "Ibirimo", + "Contribute": "Fasha", + "Contribute to PhysicsHub": "Fasha PhysicsHub", + "Contributors": "Abaterankunga", + "Copied": "Byakoporowe", + "Copied!": "Byakoporowe!", + "Copy code": "Koporora kode", + "Copy embed code to clipboard": "Koporora kode yo kwinjiza mu clipboard", + "Copy formula": "Koporora ingano", + "Copy Link": "Koporora Umuyoboro", + "Copy shareable link to clipboard": "Koporora umuyoboro wo gusangira mu clipboard", + "Create a new blog": "Kora inyandiko nshya", + "Credits to": "Ishimwe kuri", + "Currently": "Ubu", + "Delete all blocks": "Siba ibice byose", + "Delete ALL blocks and section titles? This cannot be undone!": "Siba IBICE BYOSE n'imitwe y'ibice? Ibi ntibishobora gusubizwa inyuma!", + "Delete Block": "Siba Igice", + "Delete saved inputs from local memory": "Siba amakuru yabitswe mu bwiyunge bwaho", + "Details": "Ibisobanuro", + "Discord": "Discord", + "Discord special role": "Uruhare rwihariye rwa Discord", + "Discover more about us": "Menya byinshi kuri twe", + "Download": "Kuramo", + "Download inputs as JSON file": "Kuramo amakuru nka dosiye ya JSON", + "Download is starting...": "Gukurura biratangira...", + "Drag to move": "Kurura kugira ngo wimuke", + "Duplicate Block": "Kwigana Igice", + "Edit": "Hindura", + "Edit Code": "Hindura Kode", + "Embed code copied!": "Kode yo kwinjiza yakoporowe!", + "Empty Formula": "Ingano itariho ikintu", + "Error during publication. Please try again later.": "Ikosa ryabaye mu gutangaza. Ongera ugerageze nyuma.", + "Error parsing JS:": "Ikosa mu gusesengura JS:", + "Error: Invalid content structure.": "Ikosa: Imiterere y'ibirimo ntabwo ari yo.", + "Error: JS structure must contain 'sections'.": "Ikosa: Imiterere ya JS igomba kuba irimo 'sections'.", + "Error: JSON file is not valid.": "Ikosa: Dosiye ya JSON ntabwo ari yo.", + "Experience physics in real time, uncover the concepts behind the formulas, and instantly see how they apply to the real world.": "Menya fiziki mu gihe nyakuri, sobanukirwa n'ibitekerezo biri inyuma y'ingano, kandi ubone ako kanya uko bikoreshwa mu isi nyakuri.", + "Explore core physics concepts through real-time, interactive experiments": "Sesengura ibitekerezo by'ibanze bya fiziki binyuze mu bizamini bikorwa mu gihe nyakuri kandi bikorana", + "Explore simulations": "Sesengura ibigeragezo", + "Follow the instruction in the README.md": "Kurikira amabwiriza ari muri README.md", + "for some simulations concepts.": "ku bitekerezo bimwe by'ibigeragezo.", + "Full": "Byuzuye", + "GitHub": "GitHub", + "GitHub Stars": "Inyenyeri za GitHub", + "Go to blog": "Jya ku nyandiko", + "Go to simulation": "Jya ku igeragezwa", + "Go to Simulations": "Jya ku Bigeragezo", + "Hands-on experiments across physics topics.": "Ibizamini bikorwa mu ngingo zitandukanye za fiziki.", + "Hero": "Umukinnyi mukuru", + "Hide panel": "Hisha igice", + "Home": "Ahabanza", + "How to contribute": "Uburyo bwo gufasha", + "icon": "ikimenyetso", + "If the download does not start automatically, please click on 'Download'.": "Niba gukurura bitatangiye ubwabyo, kanda kuri 'Kuramo'.", + "Image URL": "URL y'Ishusho", + "Info": "Amakuru", + "Inputs for the simulation": "Amakuru y'igeragezwa", + "Inputs value saved in local memory for ": "Agaciro k'amakuru kabitswe mu bwiyunge bwaho ku ", + "Insert LaTeX code here...": "Injiza kode ya LaTeX hano...", + "Interactive Physics Simulations": "Ibigeragezo bya Fiziki Bikorana", + "Interactive Simulations": "Ibigeragezo Bikorana", + "Invalid JS syntax": "Imiterere ya JS ntabwo ari yo", + "Join": "Injira", + "Join other fans and contributors and talk with them!": "Injira mu bandi bakunzi n'abaterankunga uganire na bo!", + "Join our Discord": "Injira muri Discord yacu", + "Join the community on": "Injira mu muryango kuri", + "JS Editor": "Ihindurwa rya JS", + "language": "ururimi", + "Large": "Binini", + "Last update:": "Ivugururwa rya nyuma:", + "Leave Feedback": "Siga igitekerezo", + "Let's begin": "Reka dutangire", + "library that belongs to the community, not a corporation.": "isomero rya rusange, atari iry'isosiyete.", + "Light/Dark mode native support": "Ubufasha bw'imiterere ya urumuri/umwijima", + "Link Copied!": "Umuyoboro wakoporowe!", + "Link profile in the README.md": "Huza umwirondoro muri README.md", + "Link profile in the section": "Huza umwirondoro mu gice", + "List view": "Kureba mu rutonde", + "Live controls & theory side-by-side": "Ibigenzura biriho n'inyigisho hamwe", + "Loading Editor...": "Gutangiza Ihindurwa...", + "Loading simulation...": "Gutangiza igeragezwa...", + "Logo": "Ikirango", + "Loved by the open-source community.": "Yakunzwe n'umuryango wa open-source.", + "Math-accurate physics engines": "Imashini za fiziki zifite ukuri kwa matematika", + "Medium": "Hagati", + "min": "umunota", + "MIT License": "Uruhushya rwa MIT", + "Modify the source code": "Hindura kode y'ibanze", + "Most high-quality physics software is locked behind paywalls or stuck in old interfaces. PhysicsHub exists to deliver a modern, performant, and": "Porogaramu nyinshi za fiziki z'ubwiza bwo hejuru zigaragara zihishwe inyuma y'kwishyura cyangwa zigumana mu miterere ya kera. PhysicsHub ihari kugira ngo itange ikintu gishya, gikora neza, kandi", + "New Blog": "Inyandiko Nshya", + "New Blog Title": "Umutwe w'Inyandiko Nshya", + "New Column": "Inkingi Nshya", + "New Data": "Amakuru Mashya", + "New Item": "Ikintu Gishya", + "Next": "Ibikurikira", + "Next Article": "Ingingo Ikurikira", + "No subscriptions, no ads, just code.": "Nta kwiyandikisha, nta matangazo, kode gusa.", + "Nothing found for": "Nta kintu cyabonetse kuri", + "Now In VC:": "Ubu muri VC:", + "on GitHub": "kuri GitHub", + "Online:": "Kuri interineti:", + "Oops! The page you are looking for does not exist. Please return to the main page and try again.": "Yego! Urupapuro urimo gushakisha ntirubaho. Subira ku rupapuro rw'ibanze wongere ugerageze.", + "Open the repository on": "Fungura ububiko kuri", + "Open/close menu": "Fungura/Funga menu", + "Other ways to help": "Uburyo bundi bwo gufasha", + "PhysicsHub": "PhysicsHub", + "PhysicsHub - Open-source physics playground": "PhysicsHub - Umwanya wa fiziki wa open-source", + "PhysicsHub – Best website to learn physics easily.": "PhysicsHub – Urubuga rwiza rwo kwiga fiziki mu buryo bworoshye.", + "PhysicsHub community": "Umuryango wa PhysicsHub", + "PhysicsHub is an open-source project: anyone can help make it better by adding simulations, improving the code, or creating new educational resources.": "PhysicsHub ni umushinga wa open-source: umuntu wese ashobora gufasha kuwutera imbere binyuze mu kongeramo ibigeragezo, kunoza kode, cyangwa gukora ibikoresho bishya byo kwigisha.", + "Pinned Blogs": "Inyandiko Zafatanywe", + "Play/Pause simulation": "Tangiza/Hagarika igeragezwa", + "Preview": "Reba mbere", + "Preview Code": "Reba Kode mbere", + "Previous": "Ibibanziriza", + "Previous Article": "Ingingo Ibanziriza", + "Project Contributors": "Abaterankunga b'Umushinga", + "Project created and maintained by": "Umushinga washinzwe kandi ukagenzurwa na", + "Public Channels:": "Imiyoboro rusange:", + "pull request": "pull request", + "Quick Links": "Imiyoboro Yihuse", + "Read more": "Soma byinshi", + "Read the rules in CONTRIBUTING.md": "Soma amategeko ari muri CONTRIBUTING.md", + "Related Articles": "Ingingo Zisa", + "Released under the": "Yasohotse hakurikijwe", + "Remove filter": "Kuraho akayunguruzo", + "Report bugs or errors": "Menyesha amakosa", + "Request sent successfully! The blog will be online after review.": "Icyifuzo cyoherejwe neza! Inyandiko izaba kuri interineti nyuma yo kuyisuzuma.", + "Reset simulation": "Subiza igeragezwa aho ryari", + "Save": "Bika", + "Save inputs to local memory": "Bika amakuru mu bwiyunge bwaho", + "Scroll to explore": "Kwimura hasi kugira ngo usesengure", + "SCROLL TO EXPLORE": "KWIMURA HASI KUGIRA NGO USESENGURE", + "Search": "Shakisha", + "Search Results": "Ibisubizo by'Ishakiro", + "Search...": "Gushakisha...", + "See how to contribute": "Reba uko wagira uruhare", + "Select a theme": "Hitamo insanganyamatsiko", + "Select Theme:": "Hitamo Insanganyamatsiko:", + "Share on LinkedIn": "Sangira kuri LinkedIn", + "Share on Twitter": "Sangira kuri Twitter", + "Share on WhatsApp": "Sangira kuri WhatsApp", + "Share:": "Sangira:", + "Show panel": "Erekana igice", + "Simple Test Key": "Urufunguzo Rworoshye rwo Kugerageza", + "Simulation Inputs deleted for ": "Amakuru y'igeragezwa yasibywe kuri ", + "Small": "Bito", + "Start visualizing them.": "Tangira kubireba.", + "Stats": "Imibare", + "Stop memorizing formulas.": "Hagarika kwibuka amahame ku mutwe.", + "Students, devs and physics lovers worldwide.": "Abanyeshuri, abaporogaramu n'abakunda fiziki ku isi hose.", + "Submit a": "Ohereza", + "Success": "Byagenze neza", + "Thank you for joining us!": "Murakoze kwifatanya natwe!", + "the community": "umuryango", + "The shareable link has been copied to your clipboard.\n Share it now on Social Media:": "Umuyoboro wo gusangira wakoporowe muri clipboard yawe.\n Usangire ubu kuri Social Media:", + "Time to read": "Igihe cyo gusoma", + "Tip": "Inama", + "Title for your blog...": "Umutwe w'inyandiko yawe...", + "Title:": "Umutwe:", + "Toggle controls": "Hindura ibigenzura", + "Toggle filters menu": "Hindura menu y'akayunguruzo", + "Toggle show/hide mode": "Hindura uko byerekanwa/bihishwa", + "Translate the site into other languages": "Hindura urubuga mu ndimi zindi", + "turns abstract equations into reactive simulations. We are an open-source sandbox where students pull levers, change variables, and immediately see how the math behaves.": "ihindura ingano zidasobanutse zikaba ibigeragezo bikorana. Turi umwanya wa open-source aho abanyeshuri bakoresha uduce, bahindura impinduka, maze bakabona ako kanya uko imibare ikora.", + "Unknown block type": "Ubwoko bw'igice butazwi", + "Untitled Blog": "Inyandiko Idafite Umutwe", + "Upload simulation settings (JSON)": "Shyiraho igenamiterere ry'igeragezwa (JSON)", + "View mode": "Uburyo bwo Kureba", + "Visual Editor": "Ihindurwa Rigaragara", + "Visuals over Formulas:": "Ibishushanyo hejuru y'Amahame:", + "Wait it to be accepted": "Tegereza ko byemerwa", + "Warning": "Iburira", + "We are excited to have you in our Discord community. Feel free to explore the channels, ask questions, and connect with other fans or contributors.": "Turishimiye kugira uri mu muryango wacu wa Discord. Wumve wisanzuye gusuzuma imiyoboro, kubaza ibibazo, no guhuza n'abandi bakunzi cyangwa abaterankunga.", + "We don't just draw animations; we simulate the math. Every lab runs on a real-time physics engine to ensure that what you see on screen matches the reality of the equation.": "Ntabwo dushushanya gusa animasiyo; dukora ibigeragezo by'imibare. Buri kizamini gikorera ku mashini ya fiziki y'igihe nyakuri kugira ngo hemezwe ko ibyo ubona ku mwanya bihuye n'ukuri kw'ingano.", + "We prioritize interactive canvases.": "Duha agaciro ku mbuga zikorana.", + "What contributors get": "Ibyo abaterankunga bahabwa", + "Who can contribute": "Ninde ushobora gufasha", + "Why we built this": "Impamvu twubatse iki", + "Write a caption...": "Andika inyandiko ngufi...", + "Write theory about simulations": "Andika inyigisho ku bigeragezo", + "Zero Paywalls:": "Nta Kwishyura:", + "Simulations": "Ibigeragezo", + "About": "Ibijyanye natwe", + "Open source": "Umushinga ufunguye", + "Built in public": "Yubatswe mu mucyo", + "Star the repo": "Shyiraho inyenyeri ku bubiko", + "stars": "inyenyeri", + "contributors": "abaterankunga" +}