Quantcast
Channel: Customized Commerce 13 and earlier versions
Viewing all articles
Browse latest Browse all 9642

Custom Localization Provider

$
0
0

Migration from CMS 11 to 12 #again

I have such entry in web config:

<localization><providers><add virtualPath="~/lang" name="languageFiles"
          type="EPiServer.Framework.Localization.XmlResources.FileXmlLocalizationProvider, EPiServer.Framework.AspNet"/><add name="inriverTranslations" type="Etac.Business.Localization.InRiverLocalizationProvider, Sth"/></providers></localization>

and given the documentation there: https://docs.developers.optimizely.com/content-management-system/docs/configuring-a-custom-localization-provider  I've created a startup code:

services.AddLocalizationProvider<InRiverLocalizationProvider, NameValueCollection>(
                o =>
                {
                    o[FileXmlLocalizationProvider.VirtualPathKey] = @"~/lang";
                })

but I can't make it work with any different variations of that code above. The app go throug that config (checked on debug) and later doesn't start running :/ 


The custom localizer relevant code:

 public class InRiverLocalizationProvider : LocalizationProvider
    {
        public override IEnumerable<ResourceItem> GetAllStrings(string originalKey, string[] normalizedKey, CultureInfo culture)
        {
            //DO STH
            return LOCALIZED STRING
        }
        public override string GetString(string originalKey, string[] normalizedKey, CultureInfo culture)
        {
           //DO STH
            return LOCALIZED STRING
        }
    }


That localizer obv works in the CMS11 solution, but I am struggling to configure that on CMS12, hence the question.


Viewing all articles
Browse latest Browse all 9642

Trending Articles