0
z2lai created
- ABP Framework version: v5.0.1
- UI type: Blazor Server
- DB provider: EF Core
The docs show localization examples using json files, however, Telerik UI for Blazor provides localization in resx files. Is it recommended to manually convert these resx files to json to be used in ABP or can we also use resx files for localization in ABP?
1 Answer(s)
-
0
Hi,
ABP can load localized resources from anywhere, you can write localized contributors from resx files。
Example:
public class MyVirtualFileLocalizationResourceContributor : VirtualFileLocalizationResourceContributorBase { public MyVirtualFileLocalizationResourceContributor (string virtualPath) : base(virtualPath) { } protected override bool CanParseFile(IFileInfo file) { .... } protected override ILocalizationDictionary CreateDictionaryFromFileContent(string jsonString) { .... } } Configure<AbpLocalizationOptions>(options => { options .Resources .Add<DefaultResource>("en").Contributors.Add(new MyVirtualFileLocalizationResourceContributor(...)); });