Localizes ABP applications using framework-level localization resources, virtual JSON files, culture fallback, and typed IStringLocalizer. Covers validation, exceptions, and app services.
Ships in abp-module-development. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
ABP's localization builds on Microsoft.Extensions.Localization and is used across every layer — validation messages, exception messages, application services, and any C#/Razor code — not just the UI. This skill covers the framework mechanism; sibling skills own the UI-specific wiring.
LocalizationResource marker class and registering it with AbpLocalizationOptions.AddVirtualJson.AddBaseTypes / [InheritResource]).IStringLocalizer<TResource> or the L property on ABP base classes.BusinessException error codes and data-annotation validation messages.abpLocalization pipe or Blazor localization → angular-ui / blazor-ui.A resource is a plain marker class. Give it a short client-facing name with [LocalizationResourceName] (namespace Volo.Abp.Localization):
using Volo.Abp.Localization;
[LocalizationResourceName("MyProject")]
public class MyProjectResource
{
}
Register it in the module — by convention the Domain.Shared module. The json files are virtual (embedded) files, so also register the assembly with AbpVirtualFileSystemOptions:
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<MyProjectDomainSharedModule>("MyProject");
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<MyProjectResource>("en") // "en" is the default culture
.AddVirtualJson("/Localization/MyProject"); // folder holding the *.json files
});
Resources.Add<TResource>(string? defaultCultureName = null) registers the resource and returns a LocalizationResource for chaining. The string sets DefaultCultureName (the fallback culture — see below).AddVirtualJson(string virtualPath) and AddBaseTypes(params Type[] types) are extension methods on the resource; each returns the resource so you can keep chaining.One file per culture in the resource folder, e.g. Localization/MyProject/en.json:
{
"culture": "en",
"texts": {
"HelloWorld": "Hello World!",
"HelloMessage": "Hello {0}, welcome!"
}
}
"culture" — the loader keys the dictionary off the json's own "culture" value, not the filename. ABP skips a file whose "culture" is missing. Keep the value aligned with the filename as a convention."texts" is a flat key→value map (keys may contain spaces). Nested objects/arrays are supported and flattened with a double underscore: { "Hello": { "World": "..." } } resolves as L["Hello__World"].en.json, en_Books.json, …).Inherit shared keys (e.g. validation strings) without copying them. Two equivalent forms:
// Attribute form
[InheritResource(typeof(AbpValidationResource))] // Volo.Abp.Localization
public class MyProjectResource { }
// Fluent form
options.Resources
.Add<MyProjectResource>("en")
.AddVirtualJson("/Localization/MyProject")
.AddBaseTypes(typeof(AbpValidationResource)); // Volo.Abp.Validation.Localization.AbpValidationResource
A resource may inherit from multiple resources; a key defined in the derived resource overrides the inherited one. To add keys to an existing resource instead of creating a new one, use options.Resources.Get<TResource>().AddVirtualJson("/…/Extensions").
AbpLocalizationOptions.DefaultResourceType is used when no resource is specified. The layered startup template sets it to the application's resource:
Configure<AbpLocalizationOptions>(options =>
{
options.DefaultResourceType = typeof(MyProjectResource);
});
Inject IStringLocalizer<TResource> anywhere:
public class BookManager : ITransientDependency
{
private readonly IStringLocalizer<MyProjectResource> _localizer;
public BookManager(IStringLocalizer<MyProjectResource> localizer)
{
_localizer = localizer;
}
public string Greet(string name)
{
return _localizer["HelloMessage", name]; // format args follow the key
}
}
ABP base classes expose an L shortcut over the same localizer. ApplicationService (and AbpController, AbpPageModel) resolve L from their LocalizationResource:
public class BookAppService : ApplicationService
{
public BookAppService()
{
LocalizationResource = typeof(MyProjectResource);
}
public Task DoItAsync() => Task.FromResult(L["HelloWorld"]);
}
The startup templates set LocalizationResource on a shared base app-service class, so deriving services just use L["Key"]. In Razor views use IHtmlLocalizer<TResource>.
When a key is missing in the requested culture, AbpDictionaryBasedStringLocalizer falls back in order:
de-DE).de) — when AbpLocalizationOptions.TryToGetFromBaseCulture is true (default).DefaultCultureName (the "en" passed to Add<T>("en")) — when TryToGetFromDefaultCulture is true (default).If still not found, the localizer returns the key itself with ResourceNotFound = true (which is why a missing key renders as the raw key string).
Inherit AbpValidationResource so ABP's built-in [Required] / [StringLength] messages resolve through your resource, then add your own display-name keys (e.g. "DisplayName:Name": "Book name") to the same json — they flow into validation output for the current culture.
BusinessException (and anything implementing IHasErrorCode) carries a Code. Map its namespace (the part before :) to a resource with AbpExceptionLocalizationOptions.MapCodeNamespace:
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("MyProject", typeof(MyProjectResource));
});
throw new BusinessException("MyProject:010001")
.WithData("BookName", book.Name);
DefaultExceptionToErrorInfoConverter splits the code on :, takes MyProject as the namespace, resolves the mapped resource, then looks up the full code ("MyProject:010001") as the localization key. So the json key is the whole code:
{
"culture": "en",
"texts": {
"MyProject:010001": "The book '{BookName}' already exists."
}
}
{BookName} placeholders are replaced from the exception's Data (populated by WithData).
To pass "a string to be localized later" across layers (e.g. a display name resolved at render time), use LocalizableString / ILocalizableString (namespace Volo.Abp.Localization). Its Localize(IStringLocalizerFactory) method returns the resolved LocalizedString:
ILocalizableString title = LocalizableString.Create<MyProjectResource>("HelloWorld");
// later: title.Localize(stringLocalizerFactory).Value
en.json. Add it to every culture file in the folder with a real translation; a missing key silently falls back to en (or renders the raw key), which reads as a bug."culture" in a json file. The file is skipped entirely — the loader keys off the json's "culture", not the filename.AddVirtualJson to find files without the virtual file system. The json is embedded; register the assembly via AbpVirtualFileSystemOptions.FileSets.AddEmbedded<TModule>(...)."MyProject:010001"), not just the number after the colon — and the namespace must be mapped with MapCodeNamespace.L throws / returns the raw key in a service. ApplicationService needs its LocalizationResource set (directly or via a base class); otherwise it has no resource to resolve against.What SKILL.md sets; muted values are Claude Code's defaults
/abp-module-development:localize-applicationsfrom abp-module-development
npx claudepluginhub abpframework/abp-skills --plugin abp-module-development13 skills in this plugin
/application-servicesWrites or reviews an ABP application service — the DTO-taking, DTO-returning boundary between the domain and the presentation/API layer. USE FOR: implementing IApplicationService/ApplicationService for non-CRUD use cases, using AbstractKeyCrudAppService for composite or non-standard keys, and unit-of-work basics. DO NOT USE FOR: exposing application services as auto/conventional API controllers, routes, verbs or [RemoteService] (use expose-http-apis); a complete standard-key CrudAppService workflow (use build-crud-application-services); detailed object-to-DTO mapping mechanics/profiles (use map-objects-and-dtos); DTO validation attributes and business exceptions (use handle-validation-and-errors); permission definitions and authorization policy (use permissions-and-authorization); the overall layered project structure (use layered-architecture).
/build-crud-application-servicesBuilds or reviews a complete ABP CRUD application-service contract and implementation with the CrudAppService APIs. USE FOR: choosing ICrudAppService/CrudAppService generic overloads, separating get/list/create/update DTOs, wiring IRepository, object mappings and five policy properties, adding list filters without breaking count/sort/page order, and validating all five CRUD operations. DO NOT USE FOR: a non-CRUD use case or general ApplicationService orchestration (use application-services); composite or non-standard keys with AbstractKeyCrudAppService (use application-services); mapping-provider configuration details (use map-objects-and-dtos); permission definitions (use permissions-and-authorization); optimistic concurrency (use handle-optimistic-concurrency); HTTP endpoint conventions (use expose-http-apis); integration-test infrastructure (use test-abp-applications).
Other plugins' skills for the same job