Fix copy foundry code localization #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The copy code button for the foundry code on the dragonroll frontend is not localized. Can you fix it?
Done. Here's what I found and fixed.
Root cause
CampaignSettingsWindow.vuerenders the pairing-code copy button as:but the key
campaigns.settings.copy-codedid not exist in any locale file. The onlycopy-codeentry wascampaigns.settings.errors.copy-code(the failure toast, "Unable to copy the pairing code."). Sinceapp/plugins/i18n.tsregisters vue-i18n without a missing-key handler, the button rendered the literal key textcampaigns.settings.copy-codein every language — which is exactly what the issue reports.Fix
Added the missing button-label key to the
settingsblock of thecampaignsnamespace in all three locales (en,es,ca), placed next to the relatedcode-copiedtoast, matching the imperative button style already used in each file (Unlink/Desvincular/Desenllaça):frontend/i18n/locales/en/campaigns.json→"copy-code": "Copy code"frontend/i18n/locales/es/campaigns.json→"copy-code": "Copiar código"frontend/i18n/locales/ca/campaigns.json→"copy-code": "Copia el codi"No component change was needed — the template already referenced the right key; it just had no translation.
Verification
There is no test suite or lint config in this repo, so I verified with a script that parses every
i18n/locales/**/*.json(all parse cleanly) and resolves every$t()key used inCampaignSettingsWindow.vueagainsten,esandca.campaigns.settings.copy-codenow resolves toCopy code | Copiar código | Copia el codi, and all previously-valid keys still resolve. I did not run the Nuxt dev server or build (frontend/node_modulesis not installed here), so the change is validated at the locale-data level only.One thing I deliberately left alone
The same window also calls
$t('errors.internal')at 3 sites, which does not resolve either — that string lives atgeneral.errors.internal, so the full key would need to begeneral.errors.internal. That is a pre-existing bug unrelated to the copy-code button and appears in other components too; fixing it is out of scope for this issue, so I flagged it rather than silently changing unrelated strings.Implementation is ready for review: #13