feat: onboarding i18n

This commit is contained in:
2025-04-27 07:35:38 +00:00
parent 6cc7a537b6
commit 6a32ad65a5
9 changed files with 84 additions and 42 deletions

View File

@ -1,3 +0,0 @@
If you're stuck on this screen, restart the game.
If the problem persists, <a href="https://gitea.tendokyu.moe/Dniel97/SEGAguide/wiki/FAQ#game-is-stuck-at-checking-distribution-server" target="_blank">check your network configuration</a>

View File

@ -1,8 +0,0 @@
You can access this page any time by right-clicking the START button.
Additional resources:
- <a href="https://gitea.tendokyu.moe/Dniel97/SEGAguide/wiki/FAQ" target="_blank">SEGAguide</a>
- <a href="https://two-torial.xyz/" target="_blank">two-torial</a>
## Have fun

View File

@ -1,3 +0,0 @@
You also have to calibrate the lever, or you may get the error 3301.
Go to lever settings (<span class="bg-black text-white">レバー設定</span>), move the lever to both edges, then press "end" (<span class="bg-black text-white">終了</span>) and "save" (<span class="bg-black text-white">保存する</span>).

View File

@ -1,3 +0,0 @@
You might get stuck on this screen for several minutes. _This is normal_. The game just takes a long time to load data.
If you install <code>7EVENDAYSHOLIDAYS/LoadBoost</code>, subsequent launches will be much faster.

View File

@ -1,7 +0,0 @@
You might get stuck on the following screen:
<div class="p-2 mt-1 mb-1 bg-black text-white">Aグループの基準機から設定を取得</div>
In which case, you should go to the test menu, and in game settings <span class="bg-black text-white">ゲーム設定</span> switch from "follow the standard machine" <span class="bg-black text-white">基準機に従う</span> to "standard machine" <span class="bg-black text-white">基準機</span>.
The test menu can be accessed with %TESTMENU%.

View File

@ -7,6 +7,9 @@ import { fromKeycode } from '../keyboard';
import { useClientStore, usePrfStore } from '../stores'; import { useClientStore, usePrfStore } from '../stores';
import { prettyPrint } from '../util'; import { prettyPrint } from '../util';
import { VueMarkdownIt } from '@f3ve/vue-markdown-it'; import { VueMarkdownIt } from '@f3ve/vue-markdown-it';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const prf = usePrfStore(); const prf = usePrfStore();
const client = useClientStore(); const client = useClientStore();
@ -25,6 +28,11 @@ interface Datum {
const game = computed(() => prf.current?.meta.game); const game = computed(() => prf.current?.meta.game);
const processText = (s: string) => { const processText = (s: string) => {
// Why do I have to do this
s = s
.split('\n')
.map((l) => l.trim())
.join('\n');
if (prf.current!.data.keyboard?.data.enabled) { if (prf.current!.data.keyboard?.data.enabled) {
const testKey = prf.current!.data.keyboard?.data.test; const testKey = prf.current!.data.keyboard?.data.test;
const readable = fromKeycode(testKey); const readable = fromKeycode(testKey);
@ -38,9 +46,14 @@ const processText = (s: string) => {
return s.replace('%TESTMENU%', 'a button on the back of the controller'); return s.replace('%TESTMENU%', 'a button on the back of the controller');
}; };
const loadPage = async (title: string) => { const loadPage = (title: string, messages?: object) => {
return { return {
text: await (await fetch(`/help-${title}.md`)).text(), text: t(`onboarding.${title}`, {
endlink: '</a>',
black: '<span class="bg-black text-white">',
end: '</span>',
...messages,
}),
image: `help-${title}.png`, image: `help-${title}.png`,
}; };
}; };
@ -75,14 +88,25 @@ const data: ComputedRef<Datum[]> = computed(() => {
return res; return res;
}); });
const counter = ref(0);
onMounted(async () => { onMounted(async () => {
[standardOngeki, systemProcessing, lever, server, finaleOngeki] = [standardOngeki, systemProcessing, lever, server, finaleOngeki] =
await Promise.all([ await Promise.all([
loadPage('standard'), loadPage('standard', {
bigblack: '<div class="p-2 mt-1 mb-1 bg-black text-white">',
endbig: '</div>',
}),
loadPage('ongeki-system-processing'), loadPage('ongeki-system-processing'),
loadPage('ongeki-lever'), loadPage('ongeki-lever'),
loadPage('chunithm-server'), loadPage('chunithm-server', {
loadPage('finale'), link: '<a href="https://gitea.tendokyu.moe/Dniel97/SEGAguide/wiki/FAQ#game-is-stuck-at-checking-distribution-server" target="_blank">',
}),
loadPage('finale', {
segaguide:
'<a href="https://gitea.tendokyu.moe/Dniel97/SEGAguide/wiki/FAQ" target="_blank">',
twotorial: '<a href="https://two-torial.xyz/" target="_blank">',
}),
]); ]);
standardOngeki = { standardOngeki = {
...standardOngeki, ...standardOngeki,
@ -102,8 +126,6 @@ onMounted(async () => {
}; };
}); });
const counter = ref(0);
const exitLabel = computed(() => { const exitLabel = computed(() => {
return props.firstTime === true && counter.value < data.value.length - 1 return props.firstTime === true && counter.value < data.value.length - 1
? 'Skip' ? 'Skip'

View File

@ -8,7 +8,7 @@ import { usePrfStore } from '../stores';
import { Patch } from '../types'; import { Patch } from '../types';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
const { t } = useI18n(); const { t, te } = useI18n();
const prf = usePrfStore(); const prf = usePrfStore();
@ -51,14 +51,14 @@ const hexModel = computed({
// Doesn't need to be reactive // Doesn't need to be reactive
const nameKey = `patch.${props.patch?.id}`; const nameKey = `patch.${props.patch?.id}`;
let name = t(nameKey); const name = te(nameKey) ? t(nameKey) : props.patch?.name;
if (name === nameKey) {
name = props.patch?.name ?? 'No name'; const tooltipKey = `patch.${props.patch?.id}-tooltip`;
} const tooltip = te(tooltipKey) ? t(tooltipKey) : props.patch?.tooltip;
</script> </script>
<template> <template>
<OptionRow :title="name" :tooltip="patch?.tooltip" :greytext="patch?.id"> <OptionRow :title="name" :tooltip="tooltip" :greytext="patch?.id">
<ToggleSwitch <ToggleSwitch
v-if="patch?.type === undefined" v-if="patch?.type === undefined"
:model-value="prf.current!.data.patches?.[patch!.id!] !== undefined" :model-value="prf.current!.data.patches?.[patch!.id!] !== undefined"

View File

@ -139,11 +139,10 @@ const checkSegatoolsIni = async (target: string) => {
</OptionRow> </OptionRow>
<OptionRow <OptionRow
:title="names?.io" :title="names?.io"
:tooltip=" :tooltip="`${t('cfg.segatools.ioModulesDesc')}
t('cfg.segatools.installTooltip', { ${t('cfg.segatools.installTooltip', {
thing: t('cfg.segatools.ioModules'), thing: t('cfg.segatools.ioModules'),
}) })}`"
"
> >
<Select <Select
v-model="prf.current!.data.sgt.io2" v-model="prf.current!.data.sgt.io2"

View File

@ -53,7 +53,11 @@ export default {
"No compatible patches found. Make sure you're using unpacked and unpatched files.", "No compatible patches found. Make sure you're using unpacked and unpatched files.",
forceLoad: 'Force load', forceLoad: 'Force load',
// Example patch name override // Example patch name override
'standard-no-encryption': 'No encryption', // 'standard-no-encryption': 'No encryption',
// 'standard-no-encryption-tooltip': 'Will also disable TLS',
// It is also possible to add a tooltip where there normally is none
// 'standard-maximum-tracks-tooltip': 'The number of tracks per credit',
// For more info check https://gitea.tendokyu.moe/akanyan/STARTLINER/wiki/Translation-%26-Localization
}, },
cfg: { cfg: {
afterRestart: 'Applied after a restart', afterRestart: 'Applied after a restart',
@ -65,6 +69,7 @@ export default {
'STARTLINER expects unpacked executables put into otherwise clean data.', 'STARTLINER expects unpacked executables put into otherwise clean data.',
hooks: 'Hooks', hooks: 'Hooks',
ioModules: 'IO modules', ioModules: 'IO modules',
ioModulesDesc: 'This should match your desired input method.',
installTooltip: '{thing} can be downloaded from the package store.', installTooltip: '{thing} can be downloaded from the package store.',
}, },
display: { display: {
@ -154,4 +159,44 @@ export default {
verbose: 'Detailed logs', verbose: 'Detailed logs',
}, },
}, },
onboarding: {
standard: `
You might get stuck on the following screen:
{bigblack}Aグループの基準機から設定を取得{endbig}
In which case, you should go to the test menu, and in game settings {black}ゲーム設定{end} switch from "follow the standard machine" {black}基準機に従う{end} to "standard machine" {black}基準機{end}.
The test menu can be accessed with %TESTMENU%.
`,
'ongeki-system-processing': `
You might get stuck on this screen for several minutes. _This is normal_. The game just takes a long time to load data.
If you install <code>7EVENDAYSHOLIDAYS/LoadBoost</code>, subsequent launches will be much faster.
`,
'ongeki-lever': `
You also have to calibrate the lever, or you may get the error 3301.
Go to lever settings ({black}レバー設定{end}), move the lever to both edges, then press "end" ({black}終了{end}) and "save" ({black}保存する{end}).
`,
'chunithm-server': `
If you're stuck on this screen, restart the game.
If the problem persists, {link}check your network configuration{endlink}
`,
finale: `
You can access this page any time by right-clicking the START button.
Additional resources:
- {segaguide}SEGAguide{endlink}
- {twotorial}two-torial{endlink}
## Have fun
`,
},
}; };