DatePicker culture translation still showing option in English

8 posts, 0 answers
  1. B1SHQP
    B1SHQP avatar
    11 posts
    Member since:
    Mar 2011

    Posted 30 Apr 2012 Link to this post

    WP7 DatePicker culture translation still showing options in English.

    When the phone language is set to French, the DatePicker  still shows the title 'SELECT DATE' in English, as well as 'Leap Year' on the year list and 'done' and 'cancel' on the buttons.

    How are these translated from English to French?
  2. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 01 May 2012 Link to this post

    Hi Andrew,

    Thanks for writing and for your question.

    Normally, to have your Windows Phone App localized, you will need to add the SupportedCultures tag in your Windows Phone app project by unloading it and editing the XML. 

    You can find some useful information about doing this here:

    http://forums.create.msdn.com/forums/t/89297.aspx 

    I hope this helps.

    Kind regards,
    Deyan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. B1SHQP
    B1SHQP avatar
    11 posts
    Member since:
    Mar 2011

    Posted 01 May 2012 Link to this post

    I have added 'fr' to my .csproj file and added a french RESX files etc etc., my parts of  my app are in French.

    Your date picker shows the days and month name in french,

    but the main title 'SELECT DATE', the 'done' and 'cancel' buttons are not translated.

    Also as this is a leap year I noticed that 'Leap Year' on the 2012 also stays in English.

    So how are these translated into the chosen language. 
  5. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 04 May 2012 Link to this post

    Hello Andrew,

    Could you please confirm that the global CultureInfo in your app is set to fr-FR?

    I have tested RadDatePicker on my side in an application where the UI culture of the current thread is set to be fr-FR and it works as expected:

    Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR");

    I look forward to your response.

    All the best,
    Deyan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Andras
    Andras avatar
    4 posts
    Member since:
    Aug 2011

    Posted 29 Aug 2012 Link to this post

    The solution partly works. I want to localize my application to hu-HU. The day and month names are in HU with the culture settings however "leap year" "done" and "cancel" is not. Is there a way localize all strings?
  7. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 30 Aug 2012 Link to this post

    Hi Andrew,

    Thanks for writing.

    Some of the DateTime names that come from the .NET framework classes are automatically localized. For strings that are part of our controls we have provided localization for German, French and Spanish. You will have to write your own localization provider if you wish to lozalice for other languages.

    We have a couple of useful articles on our website that will guide you through this process.

    Take a look at them here:

    http://www.telerik.com/help/windows-phone/localization-overview.html

    All the best,
    Deyan
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. Eugeniy
    Eugeniy avatar
    60 posts
    Member since:
    Feb 2011

    Posted 24 Sep 2012 Link to this post

    Hi.
    So where could i find documentation about localizing keys. What is the name for "done" and "cancel" buttons?
  9. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 25 Sep 2012 Link to this post

    Hi Eugeniy,

    Each one of our assemblies has a localization manager which name is built from the name of the assembly ending with LocalizationManager:

    - PrimitivesLocalizationManager
    - InputLocalizationManager etc.

    Since the RadDatePicker and RadTimePicker controls reside in the Input assembly, you will need to use the InputLocalizationManager:

    InputLocalizationManager.Instance.StringLoader = new MyStringLoader();
     
    public class MyStringLoader : IStringResourceLoader
    {
        public string GetString(string key)
        {
            if (key == InputLocalizationManager.OkButtonTextKey)
            {
                return "OK";
            }
     
            if (key == InputLocalizationManager.CancelButtonTextKey)
            {
                return "CANCEL";
            }
            return null;
        }
    }

    Each localization manager exposes string constans which represent the keys of the resources that are localized. They have readable names for your convenience.

    I hope this helps.

    Regards,
    Deyan
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Back to Top
DevCraft banner