-
Notifications
You must be signed in to change notification settings - Fork 191
Open
Description
Problems
-
Custom phrases append to defaults instead of replacing them. Any phrases entered in the settings UI are concatenated onto the 15 hardcoded built-in phrases rather than overriding them.
-
Built-in defaults are hardcoded in JS, not Python. The 15 default phrases live only inside a
PikaraokeConfigJavaScript object insplash.html. They are unreachable from Python and there is no single source of truth.preference_manager.pyhas empty strings as the defaults for all three phrase keys.
Solution
- Move the 15 built-in phrases into a Python helper function in
splash.py(where Flask-Babel translation has request context), replacing the hardcoded JS block. - Add a
GET /splash/score_phrasesJSON endpoint that returns translated built-ins when no custom phrases are configured, or the user's custom phrases otherwise (never translated). - Have
splash.jsfetch from this endpoint at startup instead of reading the baked-in config object — enabling future live updates without a page refresh. - Store custom phrases as
|-separated strings inconfig.ini(cleaner than multi-line configparser values). - Update the settings UI help text to make clear that filling the textboxes overrides the defaults; leaving them empty restores the defaults.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels