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.
Unfortunately, activation email could not send to your email. Please try again.

SfDateTimeRangeNavigator localization

Thread ID:

Created:

Updated:

Platform:

Replies:

130097 Apr 21,2017 04:28 AM Oct 19,2017 11:24 PM Xamarin.Forms 10
loading
Tags: SfDateTimeRangeNavigator
Dario Senic
Asked On April 21, 2017 04:28 AM

Hi,

Is it possible to localize or somehow customaze labels for the control (tooltip, minor and majorscales)?

Thanks,
Dario

Divya Venkatesan [Syncfusion]
Replied On April 25, 2017 12:19 PM

Hi Dario,

By default, localised strings will be applied to Minor/Major scale labels and tooltip labels depends on the language chosen in the device’s settings.

In Xamarin.Forms Android alone, for Quarter and Week strings, values should be given in strings.xml in each language specific directory. The directory name should be suffixed with language code (eg. values-es for Spanish).

Example:

The Spanish directory values-es contains a file Strings.xml with following values:

values-es/Strings.xml :
  
<?xml version="1.0"encoding="utf-8" ?> 
<resources> 
  <string name="quarter">Trimestre</string> 
  <string name="q">Q</string> 
  <string name="week">Semana</string> 
  <string name="w">W</string> 
</resources> 
 
  
Please download the sample from following location.

Sample: http://www.syncfusion.com/downloads/support/forum/130097/ze/LocalizationSample-1297583118

Please let us know if your requirement is different from this.

Regards,
Divya Venkatesan 


Dario Senic
Replied On April 27, 2017 08:01 AM

That did help.

Much appreciated,
Dario

Saravana Pandian Murugan [Syncfusion]
Replied On April 28, 2017 02:53 AM

Hi Dario,

Thanks for the update. We are glad to know that the given solution worked. Please get back to us if you need further assistance.

Regards,
Saravana Pandian M. 


David Perera
Replied On October 5, 2017 03:37 AM

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. 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)


Divya Venkatesan [Syncfusion]
Replied On October 9, 2017 08:52 AM

Hi David,

Regarding "it says week instead of semana",
You can achieve this in application level by defining the respective string for Week in Spanish in application level similar to Android.

Regarding "language should be independent from the device settings language"
Currently we are trying to achieve this in application level and we are facing some issues in it.

We will update you the sample for both the requirements along with more details at the earliest.

Thanks for your patience.

Regards,
Divya Venkatesan

Saravana Pandian Murugan [Syncfusion]
Replied On October 10, 2017 01:21 PM

Hi David, 
  
Sorry for the delay. 
  
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 10:23 AM

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


David Perera
Replied On October 13, 2017 04:54 AM

It works, but is not a solution for me since having:

CFBundleDevelopmentRegion

es

Is just a static value and I need to change dinamically the language like we do on Android, and its working (I do the SetLocale dinamically, I did it even before your post).


Thank you.


David Perera
Replied On October 19, 2017 12:20 PM

Hello?

Can you provide a solution for changing the language dinamically on iOS?


Saravana Pandian Murugan [Syncfusion]
Replied On October 19, 2017 11:24 PM

Hi David,

We have created a new incident for the query related to Localization. Please follow incident #190410 for further updates.

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.

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.

;