From 1963fdd9d5fa27463ce4ad6cb8ddde6576997ed6 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Mon, 12 Jan 2026 16:24:01 +0100 Subject: [PATCH] feat(intro): use i18n --- app/components/Intro/BottomScreen/BottomScreen.vue | 11 ++++------- i18n/locales/en.json | 5 +++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/components/Intro/BottomScreen/BottomScreen.vue b/app/components/Intro/BottomScreen/BottomScreen.vue index 85db1c5..6802066 100644 --- a/app/components/Intro/BottomScreen/BottomScreen.vue +++ b/app/components/Intro/BottomScreen/BottomScreen.vue @@ -36,8 +36,7 @@ onRender((ctx) => { ctx.font = "12px NDS12 Bold"; ctx.letterSpacing = "1px"; - const TEXT = "WARNING - COPYRIGHT"; - const { actualBoundingBoxRight: width } = ctx.measureText(TEXT); + const { actualBoundingBoxRight: width } = ctx.measureText($t("intro.copyright")); const logoWidth = assets.images.intro.warning.rect.width; const logoX = Math.floor(LOGICAL_WIDTH / 2 - (width + logoWidth + 3) / 2); @@ -49,15 +48,13 @@ onRender((ctx) => { : 1; assets.images.intro.warning.draw(ctx, logoX, TITLE_Y - 1); - ctx.fillText(TEXT, logoX + logoWidth + 3, TITLE_Y); + ctx.fillText($t("intro.copyright"), logoX + logoWidth + 3, TITLE_Y); ctx.letterSpacing = "0px"; // text ctx.font = "10px NDS10"; - const TEXT2 = - "THIS IS A NON-COMMERCIAL FAN-MADE\nRECREATION. NOT AFFILIATED WITH\nOR ENDORSED BY NINTENDO.\nNINTENDO DS IS A TRADEMARK OF\nNINTENDO CO., LTD."; - const lines = TEXT2.split("\n"); + const lines = $t("intro.text").split("\n"); for (let i = 0, y = TEXT_Y; i < lines.length; i += 1, y += 18) fillTextHCentered(ctx, lines[i]!, 0, y, LOGICAL_WIDTH); @@ -70,7 +67,7 @@ onRender((ctx) => { : hintTextOpacity.value; fillTextHCentered( ctx, - "Touch the Touch Screen to continue.", + $t("intro.hint"), 0, HINT_Y, LOGICAL_WIDTH, diff --git a/i18n/locales/en.json b/i18n/locales/en.json index a0475a1..d5b5d6e 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -1,4 +1,9 @@ { + "intro": { + "copyright": "WARNING - COPYRIGHT", + "text": "THIS IS A NON-COMMERCIAL FAN-MADE\nRECREATION. NOT AFFILIATED WITH\nOR ENDORSED BY NINTENDO.\nNINTENDO DS IS A TRADEMARK OF\nNINTENDO CO., LTD.", + "hint": "Touch the Touch Screen to continue." + }, "home": { "projectsAndExperiences": "Projects and\nExperiences", "greeting": "Welcome to my website!",