From 6c847292c7317fe834abe6d64ea8d37842efaa4d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 26 Dec 2016 14:38:18 -0500 Subject: [PATCH] simplified chinese used for all chinese languages for now --- src/Android/Services/LocalizeService.cs | 38 ++++++++++++++---------- src/iOS.Core/Services/LocalizeService.cs | 7 ++--- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/src/Android/Services/LocalizeService.cs b/src/Android/Services/LocalizeService.cs index 349fc3fb8..c7e961ba7 100644 --- a/src/Android/Services/LocalizeService.cs +++ b/src/Android/Services/LocalizeService.cs @@ -52,22 +52,30 @@ namespace Bit.Android.Services Console.WriteLine("Android Language:" + androidLanguage); var netLanguage = androidLanguage; - // certain languages need to be converted to CultureInfo equivalent - switch(androidLanguage) + if(netLanguage.StartsWith("zh")) { - case "ms-BN": // "Malaysian (Brunei)" not supported .NET culture - case "ms-MY": // "Malaysian (Malaysia)" not supported .NET culture - case "ms-SG": // "Malaysian (Singapore)" not supported .NET culture - netLanguage = "ms"; // closest supported - break; - case "in-ID": // "Indonesian (Indonesia)" has different code in .NET - netLanguage = "id-ID"; // correct code for .NET - break; - case "gsw-CH": // "Schwiizertüütsch (Swiss German)" not supported .NET culture - netLanguage = "de-CH"; // closest supported - break; - // add more application-specific cases here (if required) - // ONLY use cultures that have been tested and known to work + // simplified chinese used for all for now + netLanguage = "zh-Hans"; + } + else + { + // certain languages need to be converted to CultureInfo equivalent + switch(androidLanguage) + { + case "ms-BN": // "Malaysian (Brunei)" not supported .NET culture + case "ms-MY": // "Malaysian (Malaysia)" not supported .NET culture + case "ms-SG": // "Malaysian (Singapore)" not supported .NET culture + netLanguage = "ms"; // closest supported + break; + case "in-ID": // "Indonesian (Indonesia)" has different code in .NET + netLanguage = "id-ID"; // correct code for .NET + break; + case "gsw-CH": // "Schwiizertüütsch (Swiss German)" not supported .NET culture + netLanguage = "de-CH"; // closest supported + break; + // add more application-specific cases here (if required) + // ONLY use cultures that have been tested and known to work + } } Console.WriteLine(".NET Language/Locale:" + netLanguage); diff --git a/src/iOS.Core/Services/LocalizeService.cs b/src/iOS.Core/Services/LocalizeService.cs index 46a64824e..a45d6a437 100644 --- a/src/iOS.Core/Services/LocalizeService.cs +++ b/src/iOS.Core/Services/LocalizeService.cs @@ -58,14 +58,11 @@ namespace Bit.iOS.Core.Services Console.WriteLine("iOS Language:" + iOSLanguage); var netLanguage = iOSLanguage; - if(netLanguage.StartsWith("zh-Hans")) + if(netLanguage.StartsWith("zh")) { + // simplified chinese used for all for now netLanguage = "zh-Hans"; } - else if(netLanguage.StartsWith("zh-Hant")) - { - netLanguage = "zh-Hant"; - } else { //certain languages need to be converted to CultureInfo equivalent