Skip to content

Commit

Permalink
Merge pull request #292 from diluculo/useInvariantCulture
Browse files Browse the repository at this point in the history
 Using Resources.resx with InvariantCulture
  • Loading branch information
tgjones committed May 31, 2018
2 parents fbddde7 + 55fb0a1 commit ac0b9da
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Gemini/AppBootstrapper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
Expand Down Expand Up @@ -39,6 +39,10 @@ protected virtual void PreInitialize()
if (!string.IsNullOrWhiteSpace(code))
{
var culture = CultureInfo.GetCultureInfo(code);
// If code == "en", force to use default resource (Resources.resx)
// See PO #243
if (!Translator.Cultures.Contains(culture))
culture = CultureInfo.InvariantCulture;
Translator.Culture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
Thread.CurrentThread.CurrentCulture = culture;
Expand Down Expand Up @@ -122,4 +126,4 @@ protected override IEnumerable<Assembly> SelectAssemblies()
return new[] { Assembly.GetEntryAssembly() };
}
}
}
}

0 comments on commit ac0b9da

Please sign in to comment.