title: ABP: Rebuilding Localization Sources from Custom Provider
body: <p>I am using ABP v4.9.0 (.NET CORE 2.2) with angular client</p>
  
  <p>I built some custom localization providers. These providers get translation dictionaries from an external API.
  I add localization sources on startup with these providers.</p>
  
  <pre><code>            var customProvider = new CustomLocalizationProvider(...);
  
  
              var localizationSource = new DictionaryBasedLocalizationSource("SOURCENAME", customProvider );
              config.Localization.Sources.Add(localizationSource );
  </code></pre>
  
  <p>On startup, the providers InitializeDictionaries() is called and localization dictionaries are built.
  So far, so good, working as intended.</p>
  
  <p><strong>Now i'd like to manually Reload these translations on demand, but I can't make this working.</strong></p>
  
  <p>Here is what I tried.</p>
  
  <p>Here I trigger the re-synchronize of the language ressources:</p>
  
  <pre><code>        foreach (var localizationSource in _localizationConfiguration.Sources)
          {
              try
              {
                  localizationSource.Initialize(_localizationConfiguration, _iocResolver);
              }
              catch (Exception e)
              {
                  Logger.Warn($"Could not get Localization Data for source '{localizationSource.Name}'", e);
              }
          }
  </code></pre>
  
  <p>In the custom provider, I first clear the Dictionaries</p>
  
  <pre><code>    public class CustomLocalizationProvider : LocalizationDictionaryProviderBase
      {
  
      protected int IterationNo = 0;
  
      protected override void InitializeDictionaries()
      {
          Dictionaries.Clear();
  
          IterationNo += 1;
  
          var deDict = new LocalizationDictionary(new CultureInfo("de-DE"));
          deDict["HelloWorld"] = $"Hallo Welt Nummer {IterationNo}";
          Dictionaries.Add("de-DE", deDict);
  
          var enDict = new LocalizationDictionary(new CultureInfo("en"));
          enDict["HelloWorld"] = $"Hello World number {IterationNo}";
          Dictionaries.Add("en", enDict);
      }
  
      }
  </code></pre>
  
  <p>The provider is executed again as expected.</p>
  
  <p>But when I eventually use the localization clientside (angular), <strong>I still get the original translations.</strong></p>
  
  <p>What am I missing?</p>
  
  <p>Thanks for the help.</p>