private static CultureInfo GetUserCulture(ILocale locale) { if (AppContext.Value.Configuration.Localization.CurrentCulture.Name == null) { return(locale.GetCurrentCultureInfo()); } try { return(new CultureInfo(AppContext.Value.Configuration.Localization.CurrentCulture.Name)); } catch (CultureNotFoundException) { return(locale.GetCurrentCultureInfo()); } }
public TranslateExtension() { if (Device.OS == TargetPlatform.iOS || Device.OS == TargetPlatform.Android) { ILocale locale = DependencyService.Get <ILocale>(); ci = locale.GetCurrentCultureInfo(); } }
public TranslateExtension(ILocale locale) { _ci = locale.GetCurrentCultureInfo(); }