Skip to content

Commit

Permalink
Using Resources.resx with InvariantCulture
Browse files Browse the repository at this point in the history
  • Loading branch information
diluculo committed May 23, 2018
1 parent fbddde7 commit 55fb0a1
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 55fb0a1

Please sign in to comment.