We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Localization of sfDateTimeRangeNavigator not working on iOS

Hello,
I want to translate the values, as said here:
https://www.syncfusion.com/forums/130097/sfdatetimerangenavigator-localization
but on iOS,since it does not take into account my device settings (Spanish), and it says week instead of semana.
Also I would want it to be configurable (e.g. the app language should be independent from the device settings language, as I have many users and depending on the user I select one or other language)

Sorry to create a new thread, but I really need this.

2 Replies

SP Saravana Pandian Murugan Syncfusion Team October 10, 2017 05:25 PM UTC

Hi David, 
  
1. Regarding the query, “I want to do the same on iOS since it does not take into account my device settings (Spanish), and it says week instead of semana” 
  
  • In application level, you need to keep the folder in Xamarin.Forms iOS project under Resources -> {localizationprefix}.lproj -> Localizable.strings.
  
                            Ex: In your case, Resources -> es.lproj->Localizable.strings 
  
  • In this Localizable.strings file, you need to add string with same key given in our source Localizable.strings file. For value, you should provide the equivalent localized string for the Spanish string which we keep in source Localizable.strings. 
  
Ex: In your case, add this string (“Week=”Semana;”) in Localizable.strings file. 
  
2. Regarding the query “Also I would want it to be configurable (e.g. the app language should be independent from the device settings language, as I have many users and depending on the user I select one or other language)” 
  
In Android, we can change CultureInfo/language in application level by using the below code in Xamarin.Forms Android project under MainActivity.cs.  
 
Code Example:  
  
  Resources res = this.ApplicationContext.Resources; 
  
  // Change locale settings in the app. 
  DisplayMetrics dm = res.DisplayMetrics; 
  
  Android.Content.Res.Configuration conf = res.Configuration; 
  
  conf.SetLocale(newLocale("es")); // Your language code 
  
  res.UpdateConfiguration(conf, dm); 
  
  
For iOS, we will update you with more details at the earliest. 
 
We have attached sample for these requirements which can be downloaded from the following location. 
  
  
Please check the attached sample and let us know if you have any concerns in this. 
  
Regards, 
Saravana Pandian M 



SP Saravana Pandian Murugan Syncfusion Team October 11, 2017 02:25 PM UTC

Hi David,

Regarding the query “Also I would want it to be configurable (e.g. the app language should be independent from the device settings language, as I have many users and depending on the user I select one or other language)”

In iOS, you can change the default CultureInfo/language in application level by following the below steps.

In application level, you need to keep the folder in Xamarin.Forms iOS project under Resources -> {localizationprefix}.lproj -> Localizable.strings.

Ex: In your case, Resources -> es.lproj->Localizable.strings

In this Localizable.strings file, you need to add string with same key given in our source Localizable.strings file. For value, you should provide the equivalent localized string for the Spanish string which we keep in source Localizable.strings.

Ex: In your case, add this string (“Week=”Semana;”) in Localizable.strings file.

Then, go to the Info.plist file -> Click Source tab -> Add new property Localization native development region and provide your culture name as key.

Ex: In your case, the key should be es string.

Please refer the below link for further details.

Link: https://stackoverflow.com/questions/21460202/set-default-localization-of-ios-app

We have modified the sample as per this requirement which can be downloaded from the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/130097/ze/LocalizationSample1751063095

Please check the attached sample and let us know if you need further assistance on this.

Regards,
Saravana Pandian M


Loader.
Live Chat Icon For mobile
Up arrow icon