提交 e2cc6338 编写于 作者: C Carl de Billy

fix(ios_localization): The Windows.Globalization.ApplicationLanguages were not...

fix(ios_localization): The Windows.Globalization.ApplicationLanguages were not properly initialized on iOS with languages from the OS.
上级 680db20d
using System.Collections.Generic;
using System.Linq;
using Foundation;
namespace Windows.Globalization
{
public static partial class ApplicationLanguages
{
public static IReadOnlyList<string> ManifestLanguages { get; } = NSBundle.MainBundle.PreferredLocalizations.Concat(NSBundle.MainBundle.Localizations).Distinct().ToArray();
public static IReadOnlyList<string> ManifestLanguages { get; } = GetManifestLanguages();
private static string[] GetManifestLanguages()
{
var manifestLanguages = global::Foundation.NSLocale.PreferredLanguages
.Concat(global::Foundation.NSBundle.MainBundle.PreferredLocalizations)
.Concat(global::Foundation.NSBundle.MainBundle.Localizations)
.Distinct()
.ToArray();
return manifestLanguages;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册