Skip to content

Add Language controller to Grand.Web.Store (SaaS per-store language management)#700

Merged
KrzysztofPajak merged 5 commits into
developfrom
copilot/add-languages-controller
May 24, 2026
Merged

Add Language controller to Grand.Web.Store (SaaS per-store language management)#700
KrzysztofPajak merged 5 commits into
developfrom
copilot/add-languages-controller

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 24, 2026

Summary

Implements a Language management controller in Grand.Web.Store for the SaaS scenario, mirroring the existing Currency controller pattern introduced in PR #698.

Store owners can:

  • View the full list of languages
  • Assign their store to a language (only for LimitedToStores = true languages)
  • Unassign their store from a language (only for LimitedToStores = true languages, not the primary language, not the store's default)
  • Set a language as the default language for their store
  • Unset the default language for their store

Store owners cannot:

  • Add, edit, or delete languages
  • Modify global languages (LimitedToStores = false)
  • Unassign the primary store language (LanguageSettings.PrimaryStoreLanguageId)
  • Unassign the current default language of their store

Changes

src/Web/Grand.Web.Store/Models/StoreLanguageModel.cs

  • New view model: Id, Name, LanguageCulture, FlagImageFileName, Published, DisplayOrder, LimitedToStores, IsAssignedToCurrentStore, IsPrimaryStoreLanguage, IsDefaultStoreLanguage, CanManage

src/Web/Grand.Web.Store/Controllers/LanguageController.cs

  • New controller with [PermissionAuthorize(PermissionSystemName.Languages)]
  • Actions: Index → redirect, List, ListData (POST), AssignStore (POST), UnassignStore (POST), SetDefaultLanguage (POST), UnsetDefaultLanguage (POST)

src/Web/Grand.Web.Store/Areas/Store/Views/Language/List.cshtml

  • Kendo grid showing all languages with assign/unassign actions and default language management

src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml

  • New language resource keys: assignstore, unassignstore, setdefaultlanguage, unsetdefaultlanguage, fields.isprimarystorelanguage, notfound, cannotmodifyglobal, cantdeleteprimary, cantunassigndefault, notpublished, notassignedtostore, notdefaultlanguage
  • Missing currency keys added: notfound, cannotmodifyglobal, cantunassigndefault, notpublished
  • Missing store key added: notfound

…LanguageId to LanguageSettings

Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/b443e663-c52e-4312-b91f-5e4b3151b411

Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Eliminated the `PrimaryStoreLanguageId` property and its usage
across the codebase, including `LanguageSettings`,
`InstallationService`, `LanguageController`, and UI templates.
Simplified language handling by removing related validations
and UI elements.
@KrzysztofPajak KrzysztofPajak marked this pull request as ready for review May 24, 2026 17:40
Copilot AI review requested due to automatic review settings May 24, 2026 17:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a store-area (SaaS) Language management surface in Grand.Web.Store, modeled after the existing per-store Currency management flow, enabling store managers to assign/unassign per-store languages and manage the store default language via a Kendo grid UI.

Changes:

  • Introduces StoreLanguageModel and a new LanguageController with list + assign/unassign + set/unset default endpoints.
  • Adds a new store-area Language list view (Areas/Store/Views/Language/List.cshtml) with Kendo grid actions.
  • Updates the store-area Currency list view to remove the Published column.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

File Description
src/Web/Grand.Web.Store/Models/StoreLanguageModel.cs Adds a view model for representing languages in the store-manager grid.
src/Web/Grand.Web.Store/Controllers/LanguageController.cs Adds store-manager endpoints for listing languages and managing store assignment/default language.
src/Web/Grand.Web.Store/Areas/Store/Views/Language/List.cshtml Adds the Kendo UI grid for per-store language assignment and default language management.
src/Web/Grand.Web.Store/Areas/Store/Views/Currency/List.cshtml Removes the Published column from the currencies grid.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Web/Grand.Web.Store/Controllers/LanguageController.cs
Comment thread src/Web/Grand.Web.Store/Controllers/LanguageController.cs
Comment thread src/Web/Grand.Web.Store/Controllers/LanguageController.cs
Comment thread src/Web/Grand.Web.Store/Areas/Store/Views/Language/List.cshtml
Replaced `Grand.Domain.Localization` with `Grand.Business.Core.Interfaces.Common.Localization`. Removed `LanguageSettings` from the constructor. Updated `CurrentStoreId` to use `contextAccessor.WorkContext.CurrentCustomer.StaffStoreId`.
…blished in grid

Agent-Logs-Url: https://github.com/grandnode/grandnode2/sessions/4e6c7dd0-22a1-407e-b725-feb4acd8d321

Co-authored-by: KrzysztofPajak <16772986+KrzysztofPajak@users.noreply.github.com>
Removed `AdminAreaSettings` injection and grid pagination
settings from `List.cshtml`. Updated `LanguageController`
to exclude hidden languages by setting `showHidden` to
`false` in `GetAllLanguages`.
@KrzysztofPajak KrzysztofPajak merged commit 14f2f77 into develop May 24, 2026
6 checks passed
@KrzysztofPajak KrzysztofPajak deleted the copilot/add-languages-controller branch May 24, 2026 18:56
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.

3 participants