This is a migrated thread and some comments may be shown as answers.

[Solved] Calendar localization cuses problems

9 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Obay
Top achievements
Rank 1
Obay asked on 02 Feb 2012, 12:14 PM
Salam all;

Q: Is there is any way to use single unified calender localization  in multilingual application?
Prob:I have multilingual site (English/Arabic), when i switch language to Arabic  "Telerik" localizes calendars in web page (Converts Gregorian to Hijri calender) which causes errors in pages and validation errors in grids editing.

Hints:
UI Version: v.2011.2.712.
.NET Framework 4
sorry for title misspelling :(

9 Answers, 1 is accepted

Sort by
0
Obay
Top achievements
Rank 1
answered on 07 Feb 2012, 08:26 AM
Did i miss something here? and is this is not an issue?, if not, am i the first one facing this, and there no fix for it yet?
or my problem is not clear?!
any help will be highly appreciated.
0
Atanas Korchev
Telerik team
answered on 07 Feb 2012, 09:30 AM
Hello,

Telerik Extensions for ASP.NET MVC use the current culture to perform globalization. It seems that you want to change the culture but you don't want anything to be globalized. Is this the case? How are you changing the language (in terms of code)? There are two settings which affect internationalization in .NET - CurrentCulture and CurrentUICulture. Date formats and names and number formats are controlled by the CurrentCulture setting and quite a lot depends on that - calendar rendering, number/number formatting and parsing etc.

Regards,
Atanas Korchev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Obay
Top achievements
Rank 1
answered on 07 Feb 2012, 10:24 AM
Yes i want to change the culture and it works fine (grids, uploaders, calenders, etc). but i don't want calenders to be globalized (specially in Cpanel).
i am changing language like this in global.asax using this approach:
CultureInfo ci = new CultureInfo(langName);//summarized
Thread.CurrentThread.CurrentUICulture = ci;
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(ci.Name);
Is there is any way to stop specific UI element (Calender) from being auto-globalized based on these settings.
What if i want global calender format for all cultures?any workaround?

Thanks in advance.
0
Atanas Korchev
Telerik team
answered on 07 Feb 2012, 11:22 AM
Hello,

 Currently there is no workaround because there hasn't been any request for such behavior so far. Of course modifying the source code of the calendar is an option.

Regards,
Atanas Korchev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Obay
Top achievements
Rank 1
answered on 08 Feb 2012, 08:59 AM
Let me give you an example for this issue:

I have a record X in grid containing a cell Y  with the value '12/21/2011', when the page is in English it displays the value '12/21/2011' correctly, and every thing work fine in editing (Edit>save).
When i change the language to Arabic it displays the value '01/26/1433' and it is OK, But when I hit Edit button -and i am using popup editing mode- it places '21/12/2011' in calender edit (Gregorian calender), if i hit save without modifying data, the value will be changed to '12/21/1411' (Hijri calender).
IF i changed the language back to English it displays the value '07/03/1991', So the value changed from '12/21/2011' to '07/03/1991' without my intention.

Prob:Grid places Unlocalized value in localized calender edit.
0
Atanas Korchev
Telerik team
answered on 10 Feb 2012, 03:55 PM
Hello,

 Our localization online demo seems to work as expected. If you change the culture and enter edit mode - the same culture will be used in the date picker. What is different in your grid configuration?

Regards,
Atanas Korchev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Obay
Top achievements
Rank 1
answered on 12 Feb 2012, 02:02 PM

It seems that all cultures in that demo uses the same calendar* (Gregorian), so it displays the same date '2012-02-12' for all cultures, But if the Arabic culture is there, it will display different date '03/20/1433' in grid cells (because it converts the Gregorian date to Hijri date), And in editing it will place the original date '2012-02-12' (Gregorian) in the localized calendar control (Hijri), so it will be considered '1412-02-12'.

and after clicking Save it will save the value '1412-02-12' NOT '2012-02-12' or '03/20/1433'.

so it is not an issue of how the calendar displays months and weekdays, it is about the wrong value (unconverted) that had been placed in the right calendar control, and that is why i want to stop the value conversion (calculation).

 *I mean by calendar 'how the days, months and years been calculated', Gregorian calendar uses the sun and today is '2012-02-12', the Arabic (Hijri) calendar uses the moon and today is '03/20/1433', and changing culture converts (calculation) between these calendars and not just do translation in UI control.


many many thanks.
Obay;

0
Atanas Korchev
Telerik team
answered on 13 Feb 2012, 10:18 AM
Hello,

 Is there a chance to send us a sample project which demonstrates the issue? 

Regards,
Atanas Korchev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Obay
Top achievements
Rank 1
answered on 14 Feb 2012, 12:42 PM
OK, But something interrupted me, and i will be back as soon as  i can.
Tags
Grid
Asked by
Obay
Top achievements
Rank 1
Answers by
Obay
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or