Move JS localization endpoint out of Media into a generic Localization feature - #19854
Open
Skrypt wants to merge 3 commits into
Open
Move JS localization endpoint out of Media into a generic Localization feature#19854Skrypt wants to merge 3 commits into
Skrypt wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…n feature
The anonymous api/media/localizations endpoint only served the "media-gallery"
IJSLocalizer group and only existed when Media was enabled. Replace it with a
generic GET api/localization/js/{group} endpoint (comma-separated groups
supported) hosted by a new, independently toggleable feature,
OrchardCore.Localization.Js, so any module's IJSLocalizer registrations can be
served without depending on Media or on the main Localization feature. A group
whose owning module isn't enabled simply contributes no keys, leaving the
caller's own base-language defaults in place.
The standalone Media Gallery recipes now enable OrchardCore.Localization.Js
and the standalone app calls the new route. The embedded admin gallery is
unaffected since it already renders localizations server-side via
Orchard.GetJSLocalizations. Regenerated the NSwag OpenAPI client and updated
the Media Gallery, JS localization, and 4.0.0 release docs accordingly.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
|
I will have a look after OC Harvest |
… localization endpoint
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.
Summary
The anonymous
api/media/localizationsendpoint only served the"media-gallery"IJSLocalizergroup, and only existed when Media was enabled — any other module wanting to expose JS localizations to a standalone/client-side app had no generic way to do so.Replaces it with a generic
GET api/localization/js/{group}endpoint (comma-separated groups supported), hosted by a new, independently toggleable featureOrchardCore.Localization.Js, so any module'sIJSLocalizerregistrations can be served without depending on Media or on the main Localization feature. A group whose owning module isn't enabled simply contributes no keys, leaving the caller's own base-language defaults in place.What changed
OrchardCore.Localization.Jsfeature:GetJavaScriptLocalizationsEndpoint.cs(OrchardCore.Localization), manifest/startup registration.GetLocalizationsEndpoint.cs(api/media/localizations).media-api-standalone.recipe.json,media-api-standalone-localhost.recipe.json) now enableOrchardCore.Localization.Js; the standalone app calls the new route.Orchard.GetJSLocalizations.OpenApiClient.cs/OpenApiClient.ts) to reflect the new endpoint.MediaGallery.md, and4.0.0.mdrelease notes.Testing
dotnet build -c Release -p:TreatWarningsAsErrors=true --warnaserror -p:RunAnalyzers=true— clean, 0 warnings/errors.🤖 Generated with Claude Code