Skip to content

Commit

Permalink
[dotnet] Globalization works for Mac Catalyst now. Fixes xamarin#11392.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed Jul 27, 2021
1 parent edc088a commit ce008e3
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 22 deletions.
3 changes: 1 addition & 2 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
<!-- native bits for ICU are not ready for Catalyst - https:/xamarin/xamarin-macios/issues/11392 -->
<InvariantGlobalization Condition="'$(_PlatformName)' == 'MacCatalyst' And '$(InvariantGlobalization)' == ''">true</InvariantGlobalization>
<InvariantGlobalization Condition="'$(InvariantGlobalization)' == ''">false</InvariantGlobalization>
<StartupHookSupport Condition="'$(StartupHookSupport)' == ''">false</StartupHookSupport>
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">true</UseSystemResourceKeys>
<UseNativeHttpHandler Condition="'$(_PlatformName)' != 'macOS' And '$(UseNativeHttpHandler)' == ''">true</UseNativeHttpHandler>
Expand Down
2 changes: 0 additions & 2 deletions tests/EmbeddedResources/ResourcesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ public void Embedded ()
var manager = new ResourceManager ("EmbeddedResources.Welcome", typeof(ResourcesTest).Assembly);
#endif

#if !(NET && __MACCATALYST__) // https:/xamarin/xamarin-macios/issues/11392
Assert.AreEqual ("Welcome", manager.GetString ("String1", new CultureInfo ("en")), "en");
Assert.AreEqual ("G'day", manager.GetString ("String1", new CultureInfo ("en-AU")), "en-AU");
Assert.AreEqual ("Willkommen", manager.GetString ("String1", new CultureInfo ("de")), "de");
Assert.AreEqual ("Willkommen", manager.GetString ("String1", new CultureInfo ("de-DE")), "de-DE");
Assert.AreEqual ("Bienvenido", manager.GetString ("String1", new CultureInfo ("es")), "es");
Assert.AreEqual ("Bienvenido", manager.GetString ("String1", new CultureInfo ("es-AR")), "es-AR");
Assert.AreEqual ("Bienvenido", manager.GetString ("String1", new CultureInfo ("es-ES")), "es-ES");
#endif
}
}
}
3 changes: 0 additions & 3 deletions tests/linker/ios/link all/CalendarTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ namespace LinkAll.Calendars {
[TestFixture]
// we want the tests to be available because we use the linker
[Preserve (AllMembers = true)]
#if NET && __MACCATALYST__
[Ignore ("No globalization data yet for Mac Catalyst - https:/xamarin/xamarin-macios/issues/11392")]
#endif
public class CalendarTest {

// application *MUST* be build with I18N.MidEast and I18N.Other (Thai)
Expand Down
3 changes: 0 additions & 3 deletions tests/linker/ios/link sdk/CalendarTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ namespace LinkSdk.Calendars {
[TestFixture]
// we want the tests to be available because we use the linker
[Preserve (AllMembers = true)]
#if NET && __MACCATALYST__
[Ignore ("No globalization data yet for Mac Catalyst - https:/xamarin/xamarin-macios/issues/11392")]
#endif
public class CalendarTest {

// application must *NOT* be build with I18N.MidEast and I18N.Other (Thai)
Expand Down
3 changes: 0 additions & 3 deletions tests/linker/ios/link sdk/LinkSdkRegressionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,6 @@ public void OpenTk_Preserved ()
#endif // !__WATCHOS__ && !__MACCATALYST__

[Test]
#if NET && __MACCATALYST__
[Ignore ("No globalization data yet for Mac Catalyst - https:/xamarin/xamarin-macios/issues/11392")]
#endif
public void XElement_3137 ()
{
CultureInfo current = Thread.CurrentThread.CurrentCulture;
Expand Down
6 changes: 0 additions & 6 deletions tests/linker/ios/link sdk/LocaleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,13 @@ public class LocaleTest {

[Test]
[SetCulture ("cs-CZ")]
#if NET && __MACCATALYST__
[Ignore ("No globalization data yet for Mac Catalyst - https:/xamarin/xamarin-macios/issues/11392")]
#endif
public void CzechDictComparer ()
{
DictComparer ();
}

[Test]
[SetCulture ("en-US")]
#if NET && __MACCATALYST__
[Ignore ("No globalization data yet for Mac Catalyst - https:/xamarin/xamarin-macios/issues/11392")]
#endif
public void EnglishDictComparer ()
{
DictComparer ();
Expand Down
3 changes: 0 additions & 3 deletions tests/monotouch-test/Foundation/LocaleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ public void FromLocaleIdentifier ()
Assert.That (NSLocale.FromLocaleIdentifier (ident).Identifier, Is.EqualTo (ident), "FromLocaleIdentifier");
}

#if NET && __MACCATALYST__
[Ignore ("No globalization for Mac Catalyst yet - https:/xamarin/xamarin-macios/issues/11392")]
#endif
[Test]
public void InitRegionInfo ()
{
Expand Down

0 comments on commit ce008e3

Please sign in to comment.