From e8465fb2708bd79d533debcc91c4fc9b54516143 Mon Sep 17 00:00:00 2001 From: Zsolt Tasnadi Date: Sun, 10 May 2026 15:55:08 +0200 Subject: [PATCH] i18n --- apps/frontend/package-lock.json | 66 ++++++++ apps/frontend/package.json | 1 + apps/frontend/src/i18n/index.ts | 12 ++ apps/frontend/src/i18n/locales/en.ts | 157 ++++++++++++++++++ apps/frontend/src/i18n/locales/hu.ts | 157 ++++++++++++++++++ apps/frontend/src/layout/AppLayout.vue | 51 ++++-- apps/frontend/src/main.ts | 3 +- apps/frontend/src/page/blog/BlogIndexPage.vue | 19 ++- .../src/page/catalog/CatalogIndexPage.vue | 19 ++- .../src/page/catalog/CatalogShowPage.vue | 62 +++---- apps/frontend/src/page/code/CodeIndexPage.vue | 23 +-- .../frontend/src/page/contact/ContactPage.vue | 36 ++-- apps/frontend/src/page/home/HomePage.vue | 57 +++---- .../src/page/howtos/HowtosIndexPage.vue | 25 +-- apps/frontend/src/page/team/TeamIndexPage.vue | 9 +- 15 files changed, 559 insertions(+), 138 deletions(-) create mode 100644 apps/frontend/src/i18n/index.ts create mode 100644 apps/frontend/src/i18n/locales/en.ts create mode 100644 apps/frontend/src/i18n/locales/hu.ts diff --git a/apps/frontend/package-lock.json b/apps/frontend/package-lock.json index 2e0e0e9..2da7b73 100644 --- a/apps/frontend/package-lock.json +++ b/apps/frontend/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "pinia": "^2.2.0", "vue": "^3.5.0", + "vue-i18n": "^10.0.8", "vue-router": "^4.4.0" }, "devDependencies": { @@ -81,6 +82,50 @@ "node": ">=6.9.0" } }, + "node_modules/@intlify/core-base": { + "version": "10.0.8", + "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-10.0.8.tgz", + "integrity": "sha512-FoHslNWSoHjdUBLy35bpm9PV/0LVI/DSv9L6Km6J2ad8r/mm0VaGg06C40FqlE8u2ADcGUM60lyoU7Myo4WNZQ==", + "license": "MIT", + "dependencies": { + "@intlify/message-compiler": "10.0.8", + "@intlify/shared": "10.0.8" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, + "node_modules/@intlify/message-compiler": { + "version": "10.0.8", + "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-10.0.8.tgz", + "integrity": "sha512-DV+sYXIkHVd5yVb2mL7br/NEUwzUoLBsMkV3H0InefWgmYa34NLZUvMCGi5oWX+Hqr2Y2qUxnVrnOWF4aBlgWg==", + "license": "MIT", + "dependencies": { + "@intlify/shared": "10.0.8", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, + "node_modules/@intlify/shared": { + "version": "10.0.8", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-10.0.8.tgz", + "integrity": "sha512-BcmHpb5bQyeVNrptC3UhzpBZB/YHHDoEREOUERrmF2BRxsyOEuRrq+Z96C/D4+2KJb8kuHiouzAei7BXlG0YYw==", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.13", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", @@ -2535,6 +2580,27 @@ } } }, + "node_modules/vue-i18n": { + "version": "10.0.8", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-10.0.8.tgz", + "integrity": "sha512-mIjy4utxMz9lMMo6G9vYePv7gUFt4ztOMhY9/4czDJxZ26xPeJ49MAGa9wBAE3XuXbYCrtVPmPxNjej7JJJkZQ==", + "deprecated": "v9 and v10 no longer supported. please migrate to v11. about maintenance status, see https://vue-i18n.intlify.dev/guide/maintenance.html", + "license": "MIT", + "dependencies": { + "@intlify/core-base": "10.0.8", + "@intlify/shared": "10.0.8", + "@vue/devtools-api": "^6.5.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/kazupon" + }, + "peerDependencies": { + "vue": "^3.0.0" + } + }, "node_modules/vue-router": { "version": "4.6.4", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.6.4.tgz", diff --git a/apps/frontend/package.json b/apps/frontend/package.json index e24e444..79a24f6 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -10,6 +10,7 @@ "dependencies": { "pinia": "^2.2.0", "vue": "^3.5.0", + "vue-i18n": "^10.0.8", "vue-router": "^4.4.0" }, "devDependencies": { diff --git a/apps/frontend/src/i18n/index.ts b/apps/frontend/src/i18n/index.ts new file mode 100644 index 0000000..822c861 --- /dev/null +++ b/apps/frontend/src/i18n/index.ts @@ -0,0 +1,12 @@ +import { createI18n } from 'vue-i18n' +import en from './locales/en' +import hu from './locales/hu' + +const savedLocale = localStorage.getItem('locale') ?? 'en' + +export const i18n = createI18n({ + legacy: false, + locale: savedLocale, + fallbackLocale: 'en', + messages: { en, hu }, +}) diff --git a/apps/frontend/src/i18n/locales/en.ts b/apps/frontend/src/i18n/locales/en.ts new file mode 100644 index 0000000..5784e39 --- /dev/null +++ b/apps/frontend/src/i18n/locales/en.ts @@ -0,0 +1,157 @@ +export default { + nav: { + home: 'Home', + catalog: 'Catalog', + blog: 'Blog', + howtos: 'How-tos', + code: 'Code', + team: 'Team', + contact: 'Contact us', + retro: 'Retro Mode', + exitRetro: 'Exit Retro Mode', + }, + common: { + status: { + released: 'released', + demo: 'demo', + development: 'development', + archived: 'archived', + }, + error: 'Error!', + loading: 'Loading...', + missingApiConfig: 'Missing API Configuration', + failedToConnectWiki: 'Failed to connect to Wiki', + }, + home: { + welcomeTo: 'Welcome to', + subtitle: 'Teletype Games is an independent game development community built on creative freedom, equality, and an open-source mindset. Our goal is to create experimental and full-fledged games with short development cycles.', + startsOn: 'Starts on:', + upcomingEvents: 'Upcoming Events', + featuredGame: 'Featured Game', + playInBrowser: '▶ Play in Browser', + viewProjectDetails: 'View Project Details', + latestFromYoutube: 'Latest from YouTube', + visitChannel: 'Visit Channel ↗', + newRelease: 'New Release', + watchOnYoutube: 'Watch on YouTube', + note: 'Our HowTo-s and blog posts are written by AI with human supervision.', + catalog: { + title: 'Catalog', + desc: 'Here you can find our games. Discover our creations for TIC-80 and other platforms, many of which you can try directly in your browser.', + btn: 'Browse Games', + }, + wiki: { + title: 'Wiki', + desc: 'We gather our public interest development knowledge here. Read through technical descriptions and development logs.', + btn: 'Knowledge Base', + }, + git: { + title: 'Git Repos', + desc: 'All our projects are open source. Browse our code, study our solutions, or even participate in the development.', + btn: 'Gitea', + }, + youtube: { + title: 'YouTube', + desc: 'Watch our development vlogs, gameplay videos, and tutorials on our official YouTube channel.', + btn: 'Watch on YouTube', + }, + }, + contact: { + title: 'Contact Us', + subtitle: "Have questions, feedback, or just want to say hi? We'd love to hear from you!", + joinDiscord: 'Join our Discord', + emailUs: 'Email Us', + emailDesc: 'For business inquiries, support, or detailed feedback, feel free to drop us an email.', + community: 'Community', + communityDesc: 'Join our primarily Hungarian-speaking community (English speakers are also welcome!)', + discord: { + desc: 'We have a vibrant Discord server for real-time chat and support.', + link: 'Join Discord Server', + }, + youtube: { + desc: 'Watch our latest vlogs and development videos on our channel.', + link: 'Visit Channel', + }, + irc: { + desc: "If Discord is too modern, find us on IRC!", + }, + bbs: { + desc: 'Join us for some retro vibes on our BBS!', + }, + }, + blog: { + badge: 'Community Stories', + title: 'Developer Blog', + subtitle: 'News, updates, and behind-the-scenes stories from the Teletype Games community.', + errorTitle: 'Failed to connect to Wiki', + noPostsTitle: 'No blog posts found', + noPostsDesc: "We haven't published any blog posts yet. Check back soon!", + newPost: 'New Post', + readMore: 'Read more', + }, + catalog: { + title: 'Our Games', + subtitle: 'Discover games made for TIC-80 and other platforms, with versions playable directly in your browser!', + filter: { + all: 'All', + released: 'Released', + demo: 'Demo', + development: 'Development', + archived: 'Archived', + }, + author: 'Author:', + platform: 'Platform:', + play: '▶ Play', + moreInfo: 'ℹ More Info', + }, + catalogShow: { + back: '← Back to Catalog', + projectInfo: 'Project Info', + author: 'Author', + platform: 'Platform', + license: 'License', + about: 'About', + latestStable: 'Latest Stable', + released: 'Released:', + playNow: '▶ Play Now', + download: '💾 Download', + source: '📄 Source', + docs: '📖 Docs', + allReleases: 'All Releases', + version: 'Version', + releaseDate: 'Release Date', + devVersions: 'Development Versions', + notFound: 'Game not found', + failedToLoad: 'Failed to load:', + loading: 'Loading...', + play: '▶ Play', + }, + team: { + title: 'Our Team', + subtitle: 'Meet the brilliant minds behind Teletype Games.', + }, + howtos: { + badge: 'Knowledge Base', + title: 'Tech HowTo Center', + subtitle: 'The latest documentation, technical guides, and development logs from our knowledge base.', + knowledgeBase: 'Knowledge Base', + errorTitle: 'Failed to connect to Wiki', + noPagesTitle: 'No pages found', + noPagesDesc: "It seems like there aren't any public pages available on the wiki at the moment.", + noDesc: 'No description provided.', + browseWiki: 'Browse Wiki Home', + new: 'New', + read: 'Read', + }, + code: { + title: 'Codebase', + subtitle: 'Explore our collection of open-source projects, study our source code, and contribute to our independent game development tools.', + openGitea: 'Open Gitea', + noCommits: 'No recent commits found or accessible from public repositories.', + recentCommits: 'Recent Commits', + language: 'Language:', + updated: 'Updated:', + authoredBy: 'Authored by', + on: 'on', + }, +} diff --git a/apps/frontend/src/i18n/locales/hu.ts b/apps/frontend/src/i18n/locales/hu.ts new file mode 100644 index 0000000..4f9282e --- /dev/null +++ b/apps/frontend/src/i18n/locales/hu.ts @@ -0,0 +1,157 @@ +export default { + nav: { + home: 'Főoldal', + catalog: 'Katalógus', + blog: 'Blog', + howtos: 'Hogyan csináld', + code: 'Kód', + team: 'Csapat', + contact: 'Kapcsolat', + retro: 'Retró mód', + exitRetro: 'Retró mód kikapcsolása', + }, + common: { + status: { + released: 'kiadott', + demo: 'demó', + development: 'fejlesztés', + archived: 'archivált', + }, + error: 'Hiba!', + loading: 'Betöltés...', + missingApiConfig: 'Hiányzó API konfiguráció', + failedToConnectWiki: 'Nem sikerült csatlakozni a Wikihez', + }, + home: { + welcomeTo: 'Üdvözlünk a', + subtitle: 'A Teletype Games egy független játékfejlesztő közösség, amelyet a kreatív szabadság, az egyenlőség és a nyílt forráskódú szemlélet vezérel. Célunk rövid fejlesztési ciklusokkal kísérleti és teljes értékű játékokat létrehozni.', + startsOn: 'Kezdete:', + upcomingEvents: 'Közelgő események', + featuredGame: 'Kiemelt játék', + playInBrowser: '▶ Játék böngészőben', + viewProjectDetails: 'Projekt részletei', + latestFromYoutube: 'Legújabb YouTube-ról', + visitChannel: 'Csatorna megtekintése ↗', + newRelease: 'Új megjelenés', + watchOnYoutube: 'Nézd meg YouTube-on', + note: 'A HowTo-k és blogbejegyzések mesterséges intelligenciával íródtak, emberi felügyelet mellett.', + catalog: { + title: 'Katalógus', + desc: 'Itt megtalálod a játékainkat. Fedezd fel alkotásainkat TIC-80-ra és más platformokra, amelyek közül sokat közvetlenül a böngésződben is kipróbálhatsz.', + btn: 'Játékok böngészése', + }, + wiki: { + title: 'Wiki', + desc: 'Itt gyűjtjük össze a közérdekű fejlesztési tudásunkat. Olvasd át a technikai leírásokat és fejlesztési naplókat.', + btn: 'Tudásbázis', + }, + git: { + title: 'Git tárolók', + desc: 'Minden projektünk nyílt forráskódú. Böngészd a kódunkat, tanulmányozd a megoldásainkat, vagy akár részt is vehetsz a fejlesztésben.', + btn: 'Gitea', + }, + youtube: { + title: 'YouTube', + desc: 'Nézd meg fejlesztési vlogjainkat, gameplay videóinkat és tutorialainkat a hivatalos YouTube-csatornánkon.', + btn: 'Nézd meg YouTube-on', + }, + }, + contact: { + title: 'Kapcsolat', + subtitle: 'Kérdéseid vannak, visszajelzésed van, vagy csak szeretnél üdvözölni? Szívesen hallunk felőled!', + joinDiscord: 'Csatlakozz a Discordunkhoz', + emailUs: 'Írj emailt', + emailDesc: 'Üzleti megkeresésekhez, támogatáshoz vagy részletes visszajelzéshez nyugodtan írj nekünk emailt.', + community: 'Közösség', + communityDesc: 'Csatlakozz elsősorban magyar nyelvű közösségünkhöz (az angolul beszélők is szívesen látottak!)', + discord: { + desc: 'Élénk Discord szerverünk van valós idejű csevegéshez és támogatáshoz.', + link: 'Csatlakozz a Discord szerverhez', + }, + youtube: { + desc: 'Nézd meg legújabb vlogjainkat és fejlesztési videóinkat a csatornánkon.', + link: 'Csatorna megtekintése', + }, + irc: { + desc: 'Ha a Discord túl modern, találj minket az IRC-n!', + }, + bbs: { + desc: 'Csatlakozz hozzánk retró élményekért a BBS-ünkön!', + }, + }, + blog: { + badge: 'Közösségi történetek', + title: 'Fejlesztői Blog', + subtitle: 'Hírek, frissítések és kulisszák mögötti történetek a Teletype Games közösségből.', + errorTitle: 'Nem sikerült csatlakozni a Wikihez', + noPostsTitle: 'Nem találhatók blogbejegyzések', + noPostsDesc: 'Még nem tettünk közzé blogbejegyzéseket. Nézz vissza hamarosan!', + newPost: 'Új bejegyzés', + readMore: 'Tovább olvasom', + }, + catalog: { + title: 'Játékaink', + subtitle: 'Fedezd fel a TIC-80-ra és más platformokra készített játékainkat, amelyeknek közvetlenül a böngésződben is kipróbálhatsz verzióit!', + filter: { + all: 'Összes', + released: 'Kiadott', + demo: 'Demó', + development: 'Fejlesztés alatt', + archived: 'Archivált', + }, + author: 'Szerző:', + platform: 'Platform:', + play: '▶ Játék', + moreInfo: 'ℹ Részletek', + }, + catalogShow: { + back: '← Vissza a katalógushoz', + projectInfo: 'Projekt infó', + author: 'Szerző', + platform: 'Platform', + license: 'Licensz', + about: 'Leírás', + latestStable: 'Legújabb stabil', + released: 'Kiadva:', + playNow: '▶ Játék most', + download: '💾 Letöltés', + source: '📄 Forráskód', + docs: '📖 Dokumentáció', + allReleases: 'Összes kiadás', + version: 'Verzió', + releaseDate: 'Kiadás dátuma', + devVersions: 'Fejlesztői verziók', + notFound: 'A játék nem található', + failedToLoad: 'Nem sikerült betölteni:', + loading: 'Betöltés...', + play: '▶ Játék', + }, + team: { + title: 'Csapatunk', + subtitle: 'Ismerd meg a Teletype Games mögött álló zseniális elméket.', + }, + howtos: { + badge: 'Tudásbázis', + title: 'Tech HowTo Központ', + subtitle: 'A legfrissebb dokumentáció, technikai útmutatók és fejlesztési naplók a tudásbázisunkból.', + knowledgeBase: 'Tudásbázis', + errorTitle: 'Nem sikerült csatlakozni a Wikihez', + noPagesTitle: 'Nem találhatók oldalak', + noPagesDesc: 'Úgy tűnik, jelenleg nincsenek nyilvánosan elérhető oldalak a wikin.', + noDesc: 'Nincs megadva leírás.', + browseWiki: 'Wiki főoldal böngészése', + new: 'Új', + read: 'Olvasás', + }, + code: { + title: 'Kódbázis', + subtitle: 'Fedezd fel nyílt forráskódú projektek gyűjteményét, tanulmányozd forráskódunkat, és járulj hozzá független játékfejlesztő eszközeinkhez.', + openGitea: 'Gitea megnyitása', + noCommits: 'Nem találhatók közelmúltbeli commitok a nyilvános tárolókban.', + recentCommits: 'Legutóbbi commitok', + language: 'Nyelv:', + updated: 'Frissítve:', + authoredBy: 'Közreműködő:', + on: '·', + }, +} diff --git a/apps/frontend/src/layout/AppLayout.vue b/apps/frontend/src/layout/AppLayout.vue index a853467..1f23370 100644 --- a/apps/frontend/src/layout/AppLayout.vue +++ b/apps/frontend/src/layout/AppLayout.vue @@ -4,14 +4,20 @@ Teletype Games -