{"action":"created","issue":{"url":"https://api.github.com/repos/nopSolutions/nopCommerce/issues/30","repository_url":"https://api.github.com/repos/nopSolutions/nopCommerce","labels_url":"https://api.github.com/repos/nopSolutions/nopCommerce/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/nopSolutions/nopCommerce/issues/30/comments","events_url":"https://api.github.com/repos/nopSolutions/nopCommerce/issues/30/events","html_url":"https://github.com/nopSolutions/nopCommerce/issues/30","id":126595268,"number":30,"title":"KendoUI localization and globalization","user":{"login":"mariannk","id":16681184,"avatar_url":"https://avatars.githubusercontent.com/u/16681184?v=3","gravatar_id":"","url":"https://api.github.com/users/mariannk","html_url":"https://github.com/mariannk","followers_url":"https://api.github.com/users/mariannk/followers","following_url":"https://api.github.com/users/mariannk/following{/other_user}","gists_url":"https://api.github.com/users/mariannk/gists{/gist_id}","starred_url":"https://api.github.com/users/mariannk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariannk/subscriptions","organizations_url":"https://api.github.com/users/mariannk/orgs","repos_url":"https://api.github.com/users/mariannk/repos","events_url":"https://api.github.com/users/mariannk/events{/privacy}","received_events_url":"https://api.github.com/users/mariannk/received_events","type":"User","site_admin":false},"labels":[{"id":414411880,"url":"https://api.github.com/repos/nopSolutions/nopCommerce/labels/discussion%20/%20investigation%20/%20rfc","name":"discussion / investigation / rfc","color":"d4c5f9","default":false},{"id":318504480,"url":"https://api.github.com/repos/nopSolutions/nopCommerce/labels/enhancement%20/%20feature","name":"enhancement / feature","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/nopSolutions/nopCommerce/milestones/2","html_url":"https://github.com/nopSolutions/nopCommerce/milestones/Version%203.90","labels_url":"https://api.github.com/repos/nopSolutions/nopCommerce/milestones/2/labels","id":1503910,"number":2,"title":"Version 3.90","description":"","creator":{"login":"AndreiMaz","id":5019111,"avatar_url":"https://avatars.githubusercontent.com/u/5019111?v=3","gravatar_id":"","url":"https://api.github.com/users/AndreiMaz","html_url":"https://github.com/AndreiMaz","followers_url":"https://api.github.com/users/AndreiMaz/followers","following_url":"https://api.github.com/users/AndreiMaz/following{/other_user}","gists_url":"https://api.github.com/users/AndreiMaz/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreiMaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreiMaz/subscriptions","organizations_url":"https://api.github.com/users/AndreiMaz/orgs","repos_url":"https://api.github.com/users/AndreiMaz/repos","events_url":"https://api.github.com/users/AndreiMaz/events{/privacy}","received_events_url":"https://api.github.com/users/AndreiMaz/received_events","type":"User","site_admin":false},"open_issues":210,"closed_issues":125,"state":"open","created_at":"2016-01-13T08:34:12Z","updated_at":"2016-11-14T16:36:58Z","due_on":"2017-01-31T21:00:00Z","closed_at":null},"comments":1,"created_at":"2016-01-14T07:10:57Z","updated_at":"2016-11-15T09:19:19Z","closed_at":null,"body":"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?\n\nPlease 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 \n\nalso 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 \n\nHow it can be done:\n1. Set server-side culture in Global.asax.cs. Always invoke the following code (not just \"not in admin area\"):\n    `\nCommonHelper.SetTelerikCulture();\n`\n2. Update CommonHelper.\nAdd:\n\n```\npublic static bool ForceEnUsCulture()\n    {\n        var forceEnUsCulture = !String.IsNullOrEmpty(ConfigurationManager.AppSettings[\"ForceEnUsCulture\"]) &&\n              Convert.ToBoolean(ConfigurationManager.AppSettings[\"ForceEnUsCulture\"]);\n\n        return forceEnUsCulture;\n    }\n```\n\nand replace \"SetTelerikCulture\" with\n\n```\n/// <summary>\n    /// Set Telerik (Kendo UI) culture\n    /// </summary>\n    public static void SetTelerikCulture()\n    {\n        if (ForceEnUsCulture())\n        {\n            //little hack here\n            //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\n\n            var culture = new CultureInfo(\"en-US\");\n            Thread.CurrentThread.CurrentCulture = culture;\n            Thread.CurrentThread.CurrentUICulture = culture;\n        }\n    }\n}\n```\n1. Update /Nop.Web/Administration/Views/Shared/_AdminLayout.cshtml\n\nAdd: \n\n```\nvar kendoVersion = \"2014.1.318\"; \nvar forceEnUsCulture = CommonHelper.ForceEnUsCulture(); \nvar currentKendoCulture = EngineContext.Current.Resolve<IWorkContext>().WorkingLanguage.LanguageCulture;\n```\n\nthen add (before registration of kendo.web.min.js:\n\n```\n//javascript resources\nif (!forceEnUsCulture)\n{\n    Html.AppendScriptParts(string.Format(\"~/Scripts/kendo/{0}/cultures/kendo.culture.{1}.min.js\", kendoVersion, currentKendoCulture));\n}\n```\n\nthen add (in HTML) \n\n```\n@if (!forceEnUsCulture)\n{\n            <script type=\"text/javascript\">\n                //set kendo UI culture\n                kendo.culture(\"@(currentKendoCulture)\");\n            </script>\n            }\n```\n1. Update import/export so it works in en-US only\n\nBut it still does not work properly when other cultures are used (e.g. ru-RU):\n1. Grids always send edited values in en-US culture (AJAX)\n2. Getting \"The field XXX must be a number\" validation errors on standard pages\n\n[AM] Also see comments below\n"},"comment":{"url":"https://api.github.com/repos/nopSolutions/nopCommerce/issues/comments/260588615","html_url":"https://github.com/nopSolutions/nopCommerce/issues/30#issuecomment-260588615","issue_url":"https://api.github.com/repos/nopSolutions/nopCommerce/issues/30","id":260588615,"user":{"login":"rudgr","id":751849,"avatar_url":"https://avatars.githubusercontent.com/u/751849?v=3","gravatar_id":"","url":"https://api.github.com/users/rudgr","html_url":"https://github.com/rudgr","followers_url":"https://api.github.com/users/rudgr/followers","following_url":"https://api.github.com/users/rudgr/following{/other_user}","gists_url":"https://api.github.com/users/rudgr/gists{/gist_id}","starred_url":"https://api.github.com/users/rudgr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rudgr/subscriptions","organizations_url":"https://api.github.com/users/rudgr/orgs","repos_url":"https://api.github.com/users/rudgr/repos","events_url":"https://api.github.com/users/rudgr/events{/privacy}","received_events_url":"https://api.github.com/users/rudgr/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T09:19:18Z","updated_at":"2016-11-15T09:19:18Z","body":"I think this a very important feature/fix that improves admin usability\r\nnop is also using a very old version of kendoui? had issues before when using newer kendoui features in custom plugins...\r\n\r\ntx! :)"}}
{"actor":{"display_login":"rudgr"}}