Skill for configuring localization and multi-language support in Orchard Core. Covers culture settings, content localization, PO file translations, and localization configuration.
Use OrchardCore.Localization for UI localization and
OrchardCore.ContentLocalization for translated content items. Configure the
default and supported cultures in the site settings UI or with a root recipe:
{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Localization",
"OrchardCore.ContentLocalization",
"OrchardCore.Localization.AdminCulturePicker"
]
},
{
"name": "Settings",
"LocalizationSettings": {
"DefaultCulture": "en-US",
"SupportedCultures": ["en-US", "fr-FR"],
"FallBackToParentCulture": true
}
}
]
}
The localization module uses these settings to configure request
localization. Do not invent an OrchardCore_Localization_CultureProvider
configuration section.
In Orchard Core 3.0, ILocalizationService exposes culture lookup through
an instance service method. Do not call a static default implementation.
PoParser is static; use PoParser.Parse or PoParser.ParseAsync for PO
file parsing.
Use the localizer typed to the class that owns the string:
private readonly IStringLocalizer<MyController> _localizer;
public MyController(IStringLocalizer<MyController> localizer)
{
_localizer = localizer;
}
In Liquid, use the t filter:
{{ "Welcome to our site" | t }}
{{ "Hello {0}!" | t: User.Identity.Name }}
The PO msgctxt must exactly match the localizer scope:
{Namespace}.{Class} for IStringLocalizer<T>{Namespace}.{ViewPath} for a Razor viewmsgctxt "MyModule.Controllers.HomeController"
msgid "Welcome to our site"
msgstr "Bienvenue sur notre site"
msgctxt "MyModule.Views.Home.Index"
msgid "Read more"
msgstr "Lire la suite"
For fr-CA, the provider checks these locations in order:
{Extension}/Localization/fr-CA.po/Localization/fr-CA.poApp_Data/Sites/{tenant}/Localization/fr-CA.po/Localization/{ExtensionId}/fr-CA.po/Localization/{ExtensionId}-fr-CA.po/Localization/fr-CA/{ExtensionId}.po, then each .po in that culture folderLocalizationPart links translations with LocalizationSet and stores each
item's Culture. The content culture picker is a separate content-localization
feature. OrchardCore.Localization.AdminCulturePicker instead adds a navbar
shape in the admin area when more than one supported culture is configured; it
uses the admin culture cookie provider and does not render a front-end picker.
npx skills add CrestApps/orchardcore-localization下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer