Skip to content

Backfill missing 2.4 localization resources and bump nanoid - #835

Merged
KrzysztofPajak merged 2 commits into
developfrom
fix/missing-localization-resources
Sep 12, 2026
Merged

Backfill missing 2.4 localization resources and bump nanoid#835
KrzysztofPajak merged 2 commits into
developfrom
fix/missing-localization-resources

Conversation

@KrzysztofPajak

@KrzysztofPajak KrzysztofPajak commented Sep 12, 2026

Copy link
Copy Markdown
Member

Type: bugfix

Issue

No linked issue — found while checking why Store panel screens show raw resource keys.

New user-facing strings have to land in two files: App_Data/Resources/DefaultLanguage.xml, imported on a fresh install, and App_Data/Resources/Upgrade/en_240.xml, imported for existing installations by MigrationUpdateResourceString (src/Modules/Grand.Module.Migration/Migrations/2.4/MigrationUpdateResourceString.cs). During 2.4 development 81 resources were added to DefaultLanguage.xml and only 15 of them reached en_240.xml.

Result: an installation upgraded to 2.4 renders raw keys instead of labels on every new Store panel screen — Languages, Currencies, Shipping (delivery dates, methods, pickup points, warehouses), MessageTemplates, Pages/News, customer/address/catalog attributes — plus permission.AccessStorePanel and store.portal.

Admin.GiftVouchers.Permissions had the mirror-image problem: it exists only in en_240.xml, so fresh installs were the ones missing it, even though Grand.Web.Store/Controllers/GiftVoucherController.cs:39 uses it.

Reproduce: install 2.3, upgrade to 2.4, sign in to the Store panel and open Configuration → Languages. The grid header and action buttons show admin.configuration.languages.setdefaultlanguage and friends instead of text.

Solution

  • Upgrade/en_240.xml: added the 66 resources that were new since tag 2.3.0 and absent from the upgrade file (17 → 83 entries).
  • DefaultLanguage.xml: added admin.giftvouchers.permissions, which existed only in the upgrade file.
  • DefaultLanguage.xml: moved the 24 entries of the admin.common.*, admin.configuration.currencies.* and admin.configuration.languages.* families into their alphabetical position — they had been appended at the end of their section — and fixed four entries written without a leading tab.
  • Separate commit, unrelated to the above: bumped nanoid to 3.3.19 in vueapp/package-lock.json to clear GHSA-2v37-7h3g-55p8 (high). It is a transitive dependency of the Vite build chain; package.json is untouched.

Note that DefaultLanguage.xml is UTF-16, so GitHub renders its diff as binary. Verification was done by parsing both files and comparing the resource sets:

  • DefaultLanguage.xml 5958 → 5959 entries, zero content changes to existing keys (name → area + value compared against the base revision), UTF-16 LE BOM and CRLF preserved.
  • en_240.xml 83 entries, no duplicates, every row agreeing with DefaultLanguage.xml on area and value.
  • All 34 resource keys used by the Store Language/Currency screens now resolve.
  • Bundles rebuilt after the nanoid bump: app.runtime.bundle.js, libs.css, style.min.css and style.rtl.min.css are byte-identical to the committed ones, so no bundle changes are included.

Two pre-existing problems were left alone: DefaultLanguage.xml carries 24 duplicate keys (admin.plugins, permission.accessvendorpanel, vendors.list, …) and ~26 out-of-order entries in other sections, and en_110.xml/en_210.xml reference five keys that no longer exist in DefaultLanguage.xml (for example Stores.Fields.SecureUrl.WrongFormat, removed in #834).

Breaking changes

None. Resource-data only; no entity, view model, setting, permission or public interface changed. Existing resource values are untouched — the upgrade migration only inserts keys that fresh installs already have.

Testing

  1. Restore a database installed from 2.3 (or any installation whose Upgrade/en_240.xml migration has not run yet) and start GrandNode so the 2.4 migrations execute.
  2. Sign in as a store manager and open the Store panel → Configuration → Languages. The grid columns, the Actions column and the Assign to store / Set as default language buttons must all show English text, not admin.configuration.languages.* keys.
  3. Repeat on Configuration → Currencies: Set as default currency / Unset as default currency / Assign to store must be readable.
  4. Click Unassign from store on the store's default language. The error toast must read "The default store language can't be unassigned." rather than a key.
  5. On a fresh install (drop the database and run the installer), open the Store panel → Sales → Gift vouchers and edit a gift voucher shared across stores. The warning must read "You can't edit this gift voucher, because it can be used in many stores."
  6. Frontend, only if you want to confirm the dependency bump: cd src/Web/Grand.Web/vueapp && npm ci && npm audit reports 0 vulnerabilities, and npm run build leaves src/Web/Grand.Web/wwwroot/bundles/ unchanged in git status.

🤖 Generated with Claude Code

KrzysztofPajak and others added 2 commits September 12, 2026 13:42
Resources added during 2.4 development landed only in DefaultLanguage.xml,
which is imported on a fresh install. Existing installations upgraded by
MigrationUpdateResourceString read Upgrade/en_240.xml, which never received
them, so every new Store panel screen rendered raw resource keys instead of
labels. Admin.GiftVouchers.Permissions had the mirror-image problem: present
only in en_240.xml, so fresh installs were the ones missing it.

Also moves the 2.4 entries in the admin.common, admin.configuration.currencies
and admin.configuration.languages families into their alphabetical position and
fixes four entries indented without a leading tab; they had been appended at the
end of their section.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GrGY1NnCzdkn7wUxbyHzsX
Transitive dependency of the Vite build chain. npm audit reported one high
severity advisory; the bump clears it with no change to the produced bundles -
app.runtime.bundle.js, libs.css, style.min.css and style.rtl.min.css are
byte-identical before and after.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GrGY1NnCzdkn7wUxbyHzsX
Copilot AI lite review requested due to automatic review settings September 12, 2026 11:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@KrzysztofPajak
KrzysztofPajak merged commit 39db0d5 into develop Sep 12, 2026
6 checks passed
@KrzysztofPajak
KrzysztofPajak deleted the fix/missing-localization-resources branch September 12, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants