Beyond translating your own game’s content, you can help translate Monogatari’s interface — the built-in buttons, labels and messages — into more languages. If you speak a language Monogatari doesn’t support yet, your help is more than welcome!
NOTE
This page is about contributing UI translations to the Monogatari engine itself. To translate the content of your own game, see Internationalization.
Where the translations live
Each language is a single TypeScript file under src/translations/ that exports a default object mapping string keys to their translated text:
// src/translations/English.ts
export default {
'AdvanceHelp': 'To advance through the game, left-click or tap anywhere on the game screen or press the space key',
'Audio': 'Audio',
'AutoPlay': 'Auto',
'Back': 'Back',
'Cancel': 'Cancel',
'Close': 'Close',
// ...one entry per interface string
};The keys are fixed identifiers used throughout the engine — keep them exactly as they are. Only translate the values.
Adding a new language
Copy
English.tsto a new file named after your language in its own script, e.g.src/translations/Italiano.ts. English is the most complete file, so it’s the best starting point.Translate every value, leaving the keys untouched:
// src/translations/Italiano.ts export default { 'AdvanceHelp': 'Per avanzare nel gioco, fai clic o tocca lo schermo, oppure premi la barra spaziatrice', 'Audio': 'Audio', 'AutoPlay': 'Auto', 'Back': 'Indietro', // ... };Register the language in
src/index.ts. Import your file, add it toMonogatari._translationskeyed by the language’s native name, and add its metadata — an ISO 639-1 code and a flag emoji — toMonogatari._languageMetadata:import italian from './translations/Italiano'; Monogatari._translations = { // ...existing languages 'Italiano': italian, }; Monogatari._languageMetadata = { // ...existing metadata 'Italiano': { code: 'it', icon: '🇮🇹', }, };Open a pull request with your new translation file and the registration changes.
TIP
If a string has no natural translation in your language, it's fine to keep the English value — a partial translation is still a great contribution, and others can fill in the gaps later.
See also
- Internationalization — Translate your own game’s content and offer a language-selection screen.
- Language Selection Screen — The screen players use to pick a language.