masoud noursaid
masoud noursaid

Reputation: 65

Problem to Extending Localization Sources in abp v 6.3.0

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?

Upvotes: 0

Views: 646

Answers (1)

masoud noursaid
masoud noursaid

Reputation: 65

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 
               )
            )
        );

Upvotes: 1

Related Questions