La Mubi ships with complete English and Spanish translations for every string in the game, and a dark/light theme toggle that respects your operating system preference. Both preferences are stored in the browser’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/dlampatricio/lamubi/llms.txt
Use this file to discover all available pages before exploring further.
localStorage so they persist across sessions without any account or server state. Changes take effect immediately — no page reload required.
Switching Languages
The LanguageToggle component, rendered as a globe icon in the interface, switches the entire application between English and Spanish with a single tap. The selected language is written tolocalStorage under the key lamubi-lang.
| Value | Language |
|---|---|
'en' | English (default) |
'es' | Spanish |
translate="no" on document.documentElement whenever one of the two built-in languages ('en' or 'es') is active. This suppresses prompts such as Chrome’s “Translate this page?” banner. The attribute is removed if the active language is not one of the built-in ones.
Language Persistence
TheLangProvider component reads lamubi-lang from localStorage on mount and initialises the translation context before any game UI renders. The selected language survives page refreshes and browser restarts as long as the user does not clear site data.
The accepted values for the key are:
'en'.
Switching Themes
The ThemeToggle button switches between dark and light mode. The current theme is stored inlocalStorage under the key lamubi-theme.
| Stored value | Effect |
|---|---|
'dark' | Dark mode active |
'light' | Light mode active |
| (key absent) | Light mode active (first visit; system preference checked) |
prefers-color-scheme: dark media query and applies dark mode automatically if it matches. This detection runs via an inline script injected into <head> in layout.tsx, which executes before the browser paints any content, preventing a flash of incorrectly themed UI.
Theme Persistence
The inline script that runs in<head> before the first paint applies the correct class to <html> immediately, before React hydrates. The logic is:
ThemeToggle, the component updates both localStorage and the dark class on document.documentElement in sync, so the change is instant and durable.
Adding New Languages
The translation system is designed to be extended. To add a new language:- Open
useTranslation.tsx. - Add a new translations object containing every key present in the
'en'and'es'dictionaries. - Register the new object in the
allmap with its locale string as the key (e.g.,'fr'for French).
t() function used throughout the app supports string interpolation for dynamic values. Pass a params object as the second argument and reference keys inside the translation string with curly-brace placeholders:
t() function replaces {count}, {name}, and any other keys from the params object regardless of locale.