Individual skill

orchardcore-localization-source

Skill for deferred localization with LocalizationSource in Orchard Core 4.0. Covers Create(value, type), Create of T, Value and Type, the IStringLocalizerFactory and IHtmlLocalizerFactory Localize and Plural extensions with format arguments, why deferred sources exist (PO context kept until display time, static readonly labels, extractor discovery), PO entries with msgctxt, the Orchard Core APIs that use it (Permission Description, DeploymentStep Category and Title, data source, file format, pipeline step and shared link descriptors), the Data Localization interaction, and migrating 3.x code. Use this skill when requests mention Orchard Core LocalizationSource, deferring localization, localizing static labels, translating permission descriptions or deployment step titles, or upgrading such code to Orchard Core 4. Strong matches include OrchardCore.Localization, LocalizationSource, StringLocalizerFactoryExtensions, Permission.Description, and DeploymentStep.Title.

plugins/orchardcore/skills/orchardcore-localization-source/SKILL.md

Read pinned source

Source commit d86d04f234b1b2bd8145368a2544490f9d557596

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
Yes
Repository scan complete
No
Skill scan complete
No
Observed behavior
Instructions only
Last checked
Nov 6, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
13
Repository last updated
Oct 21, 2026
License
MIT

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# Orchard Core Deferred Localization with LocalizationSource - Prompt Templates

## Declare Now, Translate at Display Time

You are an Orchard Core expert. Generate code that declares translatable text where no localizer or culture is available and translates it when it is shown.

### Guidelines

- `LocalizationSource` (namespace `OrchardCore.Localization`, package `OrchardCore.Abstractions`) is an immutable `sealed record` holding an untranslated `Value` and an optional source `Type`. It never translates, formats, or encodes anything.
- Declare sources with `LocalizationSource.Create<T>(value)` when `T` can be a generic argument, and `LocalizationSource.Create(value, typeof(T))` for static classes or runtime types. Prefer these factories over `new LocalizationSource(...)` or target-typed `new(...)`, so source-extraction tools can find them.
- `Value` is the PO `msgid`. `Type.FullName` is the PO `msgctxt` (an inner class `+` becomes `.`), exactly like `IStringLocalizer<T>`.
- Keep the value a literal. Never build it with string interpolation or concatenation; pass dynamic parts as format arguments at display time.
- Store sources in `static readonly` fields (or static get-only properties). They are safe to share across instances, tenants, and cultures.
- Translate with `IStringLocalizerFactory.Localize()` for text and attributes, and `IHtmlLocalizerFactory.Localize()` only for trusted translation markup. The display call site picks the encoding, not the declaration.