Localization TwoLetterLanguageName Property Delta Engine Documentation

Namespace: DeltaEngine.Content.Xml
Assembly: DeltaEngine.Content.Xml (in DeltaEngine.Content.Xml.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public string TwoLetterLanguageName { get; set; }

Property Value

Type: String
Remarks

Tests: DeltaEngine.Content.Xml.Tests.LocalizationTests
Examples

1 unit tests call DeltaEngine.Content.Xml.Localization.TwoLetterLanguageName
[Test]
public void GetLocalizedString()
{
    ContentLoader.Use<MockContentLoader>();
    var localization = ContentLoader.Load<Localization>("Texts");
    localization.TwoLetterLanguageName = "en";
    Assert.AreEqual(localization.GetText("Go"), "Go");
    localization.TwoLetterLanguageName = "de";
    Assert.AreEqual(localization.GetText("Go"), "Los");
    localization.TwoLetterLanguageName = "es";
    Assert.AreEqual(localization.GetText("Go"), "¡vamos!");
    Assert.Throws<KeyNotFoundException>(
        () => localization.GetText("ThatIsATestExampleToThrowOneException"));
    ContentLoader.DisposeIfInitialized();
}
See Also