Namespace: DeltaEngine.Content.Xml
Assembly: DeltaEngine.Content.Xml (in DeltaEngine.Content.Xml.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Content.Xml.Tests.LocalizationTests
1 unit tests call DeltaEngine.Content.Xml.Localization.GetText(System.String)
Assembly: DeltaEngine.Content.Xml (in DeltaEngine.Content.Xml.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- languageKey
- Type: System String
Return Value
Type: StringRemarks
Examples
[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