UPDATE: postponed after https://github.com/nopSolutions/nopCommerce/issues/75
It causes some issues. So let's make it configurable (allow a store owner to disable it).Also note that we're going to move away from KendoUI. So should we do it?
Please see http://docs.telerik.com/kendo-ui/getting-started/framework/globalization/overview and http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/globalization
also see http://www.nopcommerce.com/boards/t/19235/latest-telerik-version-incorrectly-shows-decimals-in-different-locales.aspx and http://www.nopcommerce.com/boards/t/2653/how-to-change-date-format-for-admin-interface.aspx and http://www.nopcommerce.com/boards/t/24688/languagedecimal-formatting-bug.aspx
How it can be done:
CommonHelper.SetTelerikCulture();
public static bool ForceEnUsCulture()
{
var forceEnUsCulture = !String.IsNullOrEmpty(ConfigurationManager.AppSettings["ForceEnUsCulture"]) &&
Convert.ToBoolean(ConfigurationManager.AppSettings["ForceEnUsCulture"]);
return forceEnUsCulture;
}
and replace "SetTelerikCulture" with
/// <summary>
/// Set Telerik (Kendo UI) culture
/// </summary>
public static void SetTelerikCulture()
{
if (ForceEnUsCulture())
{
//little hack here
//always set culture to 'en-US' (Kendo UI has a bug related to editing decimal values in other cultures). Like currently it's done for admin area in Global.asax.cs
var culture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
}
}
}
Add:
var kendoVersion = "2014.1.318";
var forceEnUsCulture = CommonHelper.ForceEnUsCulture();
var currentKendoCulture = EngineContext.Current.Resolve<IWorkContext>().WorkingLanguage.LanguageCulture;
then add (before registration of kendo.web.min.js:
//javascript resources
if (!forceEnUsCulture)
{
Html.AppendScriptParts(string.Format("~/Scripts/kendo/{0}/cultures/kendo.culture.{1}.min.js", kendoVersion, currentKendoCulture));
}
then add (in HTML)
@if (!forceEnUsCulture)
{
<script type="text/javascript">
//set kendo UI culture
kendo.culture("@(currentKendoCulture)");
</script>
}
But it still does not work properly when other cultures are used (e.g. ru-RU):
[AM] Also see comments below
I think this a very important feature/fix that improves admin usability
nop is also using a very old version of kendoui? had issues before when using newer kendoui features in custom plugins...
tx! :)
How far away is this? We have a few issues with our invoices being in US format for the date which has confused some of our customers.
@AndreiMaz
Will Nop still using Kendo UI?
As per my knowledge, Kendo UI is replaced by DataTable.
Closed #30
Must be solved in this task - #5016
Most helpful comment
I think this a very important feature/fix that improves admin usability
nop is also using a very old version of kendoui? had issues before when using newer kendoui features in custom plugins...
tx! :)