Mosaic Poster: translate the settings page - #749
Merged
DogmaDragon merged 1 commit intoJul 29, 2026
Conversation
Stash draws plugin settings from the YAML as plain text, and offers no way for a plugin to register translations, so the labels stayed English while the rest of the plugin followed the UI language. Translate them at render time instead: - Patch Stash's PluginSettings component and hand this plugin's rows on with display_name/description swapped for the UI language. Rows belong to Stash as before; every other plugin's props are passed through. - Correct the plugin description above the rows, and the two task entries under Settings > Tasks, in the DOM -- neither is drawn from anything a plugin can reach. Task rows are matched on their English text. - Keep the strings in MosaicPoster.settings.json, fetched from the plugin's own assets only when a settings page is opened, so the ~40 languages of settings text cost nothing on every other page. Covers the same languages as the existing on-poster strings (English is the fallback for any locale without an entry; lookup tries the full code, then the base code, then English). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
suzuhiroruri
marked this pull request as ready for review
July 29, 2026 04:00
|
This pull request has been mentioned on Stash Forum. There might be relevant details there: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #743. The plugin's on-poster strings already follow the UI language, but its settings page stayed English: Stash serves plugin settings from the YAML as plain text, and there is no API for a plugin to register translations. This translates them at render time.
What it does
PluginSettingscomponent and hands this plugin's props on withdisplay_name/descriptionswapped for the UI language. The rows are still rendered by Stash itself; every other plugin's props are passed straight through (pluginIDguard), and the arity of the patch chain is preserved so a second plugin patching the same component keeps working.plugin-MosaicPoster-*) and matched on their English text.MosaicPoster.settings.json, served from the plugin's own assets and fetched only when a settings page is opened — settings text in ~40 languages is several times the size of the plugin JS, and no other page shows it.Same language coverage as the existing
STRINGStable (40 entries). Lookup tries the full code, then the base code, then English, so an unlisted locale simply stays English. Ifwindow.PluginApiis unavailable the patch is skipped and nothing changes.Verified
In a clean browser profile against Stash v0.31.1:
ja-JPde-DEpt-BRptentryen-GBOther plugins' settings rows (56 of them) are untouched in every language, another plugin that patches
PluginSettingsstill renders its own panel, and scene pages log no console errors.validatorpasses.Non-English strings are best-effort — corrections from native speakers are very welcome.