So based on the sample project code and and Amadeus' wonderful "Idiot's Guide" I am starting to test out culture switching in an existing project of mine, basically:
{{ LocalizeDictionary.Instance.Culture = initialCultureInfo; }}
The rub being that in this project my resources are all neutral ones, like ("en") and ("es").
And it looks like your code will only actually change the culture through this method if the culture value is in the cache of specific cultures! Not horrible once you know that, but
Is there another method I haven't found yet that provides for using a neutral culture?
If not, is this a design choice based on some best practice that says to always use specific cultures??
Cheers,
Berryl
[Test]
public void Culture_OnEdit_IfCultureIsNotSpecific_NoChange()
{
Assert.That(LocalizeDictionary.Instance.Culture, Is.EqualTo(CultureInfo.InvariantCulture));
LocalizeDictionary.Instance.Culture = CultureInfo.GetCultureInfo("en");
Assert.That(LocalizeDictionary.Instance.Culture, Is.EqualTo(CultureInfo.InvariantCulture));
}
[Test]
public void Culture_OnEdit_IfCultureIsSpecific_ItIsChanged()
{
Assert.That(LocalizeDictionary.Instance.Culture, Is.EqualTo(CultureInfo.InvariantCulture));
var usCulture = CultureInfo.GetCultureInfo("en-US");
LocalizeDictionary.Instance.Culture = usCulture;
Assert.That(LocalizeDictionary.Instance.Culture, Is.EqualTo(usCulture));
}