mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-05-07 14:54:56 +02:00
feat(i18n): per-session language preference and !lang command
Phase A plumbing for #188. Adds a users.language column (migration 0022), UserRepo.GetLanguage/SetLanguage, and Session.Lang()/SetLang accessors so future phases can resolve localized content per session instead of falling back to the server-wide config.Language. The preference is loaded from the DB on login and persisted via a new !lang <en|jp|fr|es> chat command that shows the current language when called without an argument, validates the code (case-insensitive), and replies in the newly selected language so the switch is visible immediately. An empty stored value falls back to config.Language. sys_language.go exposes getLangStringsFor(code) as the new dispatch primitive; getLangStrings(server) is now a thin wrapper so existing callers keep working unchanged. isSupportedLang + supportedLangs keep the !lang validator in sync with the dispatcher. Localized quest/scenario content and per-session i18n lookups in existing handlers are deliberately out of scope for phase A — this commit ships only the plumbing so it can be reviewed and deployed independently.
This commit is contained in:
@@ -39,6 +39,11 @@ func langFrench() i18n {
|
||||
i.commands.timer.enabled = "Minuteur de quête activé"
|
||||
i.commands.timer.disabled = "Minuteur de quête désactivé"
|
||||
|
||||
i.commands.lang.usage = "Utilisation : %s <en|jp|fr|es>"
|
||||
i.commands.lang.invalid = "Langue inconnue %q. Prises en charge : en, jp, fr, es"
|
||||
i.commands.lang.success = "Langue définie sur %s"
|
||||
i.commands.lang.current = "Langue actuelle : %s"
|
||||
|
||||
i.commands.ravi.noCommand = "Aucune commande Raviente spécifiée !"
|
||||
i.commands.ravi.start.success = "La Grande Chasse va commencer dans un instant"
|
||||
i.commands.ravi.start.error = "La Grande Chasse a déjà commencé !"
|
||||
|
||||
Reference in New Issue
Block a user