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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Localization of sfDateTimeRangeNavigator not working on iOS

Thread ID:

Created:

Updated:

Platform:

Replies:

133088 Oct 9,2017 08:13 AM UTC Oct 11,2017 02:25 PM UTC Xamarin.Forms 2
loading
Tags: SfDateTimeRangeNavigator
David Perera
Asked On October 9, 2017 08:13 AM UTC

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.

Saravana Pandian Murugan [Syncfusion]
Replied On 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 


Saravana Pandian Murugan [Syncfusion]
Replied On 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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;