From ABP Sensei
ABP Framework localization resource setup and usage: JSON files, culture fallback, L[] helper, IStringLocalizer, nested keys.
How this skill is triggered — by the user, by Claude, or both
Slash command
/abp-sensei:abp-localizationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
User asks about localization, internationalization, i18n, localization resources, JSON localization files, culture, L[] helper, multi-language support, or text translation in ABP Framework.
User asks about localization, internationalization, i18n, localization resources, JSON localization files, culture, L[] helper, multi-language support, or text translation in ABP Framework.
ABP's localization system extends Microsoft.Extensions.Localization with:
public class BookStoreResource
{
}
Plain class — no base class needed.
[DependsOn(typeof(AbpLocalizationModule))]
public class MyModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
// Add embedded JSON files from assembly
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<MyModule>("YourRootNamespace");
});
// Register localization resource
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<BookStoreResource>("en") // Default culture
.AddVirtualJson("/Localization/Resources/BookStore");
});
}
}
/Localization/Resources/BookStore/en.json:
{
"culture": "en",
"texts": {
"HelloWorld": "Hello World!",
"Menu:Home": "Home",
"Menu:BookStore": "Book Store",
"Permission:BookStore_Author_Create": "Creating a new author"
}
}
/Localization/Resources/BookStore/tr.json:
{
"culture": "tr",
"texts": {
"HelloWorld": "Merhaba Dünya!",
"Menu:Home": "Ana Sayfa",
"Menu:BookStore": "Kitap Mağazası",
"Permission:BookStore_Author_Create": "Yeni yazar oluşturma"
}
}
Important:
culture code — ABP ignores files without ittexts section contains key-value pairs{
"culture": "en",
"texts": {
"Hello": {
"World": "Hello World!"
}
}
}
Access: L["Hello__World"] (double underscore separates parent from child)
{
"culture": "en",
"texts": {
"Hi": [
{ "Bye": "Bye World!" },
{ "Hello": "Hello World!" }
]
}
}
Access: L["Hi__0"] → "Bye World!", L["Hi__1"] → "Hello World!"
Split large modules into multiple files:
Localization/
└── MyResource/
├── en.json ← base / shared strings
├── en_Authors.json ← Author feature strings
├── en_Books.json ← Book feature strings
└── en_Users.json ← User feature strings
Files are automatically merged. Useful for large modules where splitting by feature keeps files manageable.
public class BookAppService : ApplicationService
{
public BookAppService()
{
LocalizationResource = typeof(BookStoreResource);
}
public void DoWork()
{
var text = L["HelloWorld"];
var localized = L["Menu:BookStore"];
}
}
public class MyService : ITransientDependency
{
private readonly IStringLocalizer<BookStoreResource> _localizer;
public MyService(IStringLocalizer<BookStoreResource> localizer)
{
_localizer = localizer;
}
public void DoWork()
{
var text = _localizer["HelloWorld"];
}
}
public class BookController : AbpController
{
public BookController()
{
LocalizationResource = typeof(BookStoreResource);
}
public IActionResult Index()
{
ViewData["Title"] = L["Menu:BookStore"];
return View();
}
}
@using Volo.Abp.Localization
@inject IStringLocalizer<BookStoreResource> L
<h1>@L["HelloWorld"]</h1>
<p>@L["Menu:BookStore"]</p>
Configure<AbpLocalizationOptions>(options =>
{
options.Languages.Add(new LanguageInfo("en", "en", "English"));
options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe"));
options.DefaultResourceType = typeof(BookStoreResource);
});
If a key doesn't exist in the current culture, ABP falls back to:
ABP supports culture in URL path:
/en/Home → English/tr/Home → TurkishConfigure in appsettings.json:
{
"App": {
"SupportedCultures": ["en", "tr", "de"]
}
}
Menu:, Permission:, Error: for organizationculture fieldModule:Feature:Key patternpublic abstract class BookStoreAppService : ApplicationService
{
protected BookStoreAppService()
{
LocalizationResource = typeof(BookStoreResource);
}
}
myGroup.AddPermission(
"BookStore_Author_Create",
LocalizableString.Create<BookStoreResource>("Permission:BookStore_Author_Create")
);
throw new UserFriendlyException(L["Error:InsufficientStock"]);
npx claudepluginhub burakdmir/abp-skills --plugin abp-senseiProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.