locale string comparer for i18n service

This commit is contained in:
Kyle Spearrin 2019-04-16 11:08:05 -04:00
parent d1c696bad5
commit 803527f585

View file

@ -17,6 +17,7 @@ namespace Bit.App.Services
private readonly CultureInfo _defaultCulture = new CultureInfo("en-US"); private readonly CultureInfo _defaultCulture = new CultureInfo("en-US");
private bool _inited; private bool _inited;
private StringComparer _stringComparer;
public MobileI18nService(CultureInfo systemCulture) public MobileI18nService(CultureInfo systemCulture)
{ {
@ -24,6 +25,17 @@ namespace Bit.App.Services
} }
public CultureInfo Culture { get; set; } public CultureInfo Culture { get; set; }
public StringComparer StringComparer
{
get
{
if(_stringComparer == null)
{
_stringComparer = StringComparer.Create(Culture, false);
}
return _stringComparer;
}
}
public void Init(CultureInfo culture = null) public void Init(CultureInfo culture = null)
{ {