I need to extend localization sources. According to the descriptions in the documentation, I added the localization sources files in a folder named AbpWebXmlSource and marked embed. After that, I registered them in the PreInitialize() method of module.
Configuration.Localization.Sources.Extensions.Add(
new LocalizationSourceExtensionInfo("AbpWeb",
new XmlEmbeddedFileLocalizationDictionaryProvider(
Assembly.GetExecutingAssembly(),
"HMS.Core.Localization.AbpWebXmlSource"
)
)
);
But unfortunately it does not work when used. Can anyone help me with this?
after a series of test I find the answer.
first must to added AbpWeb-fr.xml to abp.core project in any folder you want.
then need to get proprties of AbpWeb-fr.xml and convert it to embeded resource.
then must add this code to [your]coremodule.cs
in preinitialize()
method.
Configuration.Localization.Sources.Extensions.Add(
new LocalizationSourceExtensionInfo("AbpWeb",
new XmlEmbeddedFileLocalizationDictionaryProvider(
Assembly.GetExecutingAssembly(),
"" //important - this line need to fill empty string
)
)
);