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());
            }
        }
Beispiel #2
0
 public TranslateExtension()
 {
     if (Device.OS == TargetPlatform.iOS || Device.OS == TargetPlatform.Android)
     {
         ILocale locale = DependencyService.Get <ILocale>();
         ci = locale.GetCurrentCultureInfo();
     }
 }
Beispiel #3
0
 public TranslateExtension(ILocale locale)
 {
     _ci = locale.GetCurrentCultureInfo();
 }