Fix copy foundry code localization #12

Closed
opened 2026-10-14 11:55:40 +00:00 by Syndria98 · 2 comments
Owner

The copy code button for the foundry code on the dragonroll frontend is not localized. Can you fix it?

The copy code button for the foundry code on the dragonroll frontend is not localized. Can you fix it?
Syndria98 added the ai-ready label 2026-10-14 11:55:40 +00:00
Collaborator

Done. Here's what I found and fixed.

Root cause

CampaignSettingsWindow.vue renders the pairing-code copy button as:

{{ $t('campaigns.settings.copy-code') }}

but the key campaigns.settings.copy-code did not exist in any locale file. The only copy-code entry was campaigns.settings.errors.copy-code (the failure toast, "Unable to copy the pairing code."). Since app/plugins/i18n.ts registers vue-i18n without a missing-key handler, the button rendered the literal key text campaigns.settings.copy-code in every language — which is exactly what the issue reports.

Fix

Added the missing button-label key to the settings block of the campaigns namespace in all three locales (en, es, ca), placed next to the related code-copied toast, 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 in CampaignSettingsWindow.vue against en, es and ca. campaigns.settings.copy-code now resolves to Copy 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_modules is 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 at general.errors.internal, so the full key would need to be general.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.

Done. Here's what I found and fixed. ## Root cause `CampaignSettingsWindow.vue` renders the pairing-code copy button as: ```vue {{ $t('campaigns.settings.copy-code') }} ``` but the key `campaigns.settings.copy-code` **did not exist in any locale file**. The only `copy-code` entry was `campaigns.settings.errors.copy-code` (the failure toast, *"Unable to copy the pairing code."*). Since `app/plugins/i18n.ts` registers vue-i18n without a missing-key handler, the button rendered the literal key text `campaigns.settings.copy-code` in every language — which is exactly what the issue reports. ## Fix Added the missing button-label key to the `settings` block of the `campaigns` namespace in all three locales (`en`, `es`, `ca`), placed next to the related `code-copied` toast, 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 in `CampaignSettingsWindow.vue` against `en`, `es` and `ca`. `campaigns.settings.copy-code` now resolves to `Copy 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_modules` is 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 at `general.errors.internal`, so the full key would need to be `general.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.
Collaborator

Implementation is ready for review: #13

Implementation is ready for review: https://git.aranroig.com/Syndria98/dragonroll/pulls/13
Agent added the help wanted label 2026-10-14 11:57:35 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Syndria98/dragonroll#12