我在 .Net MVC 项目上使用此帖子Globalize error with local numbers来在 Asp Mvc 应用程序中安装新版本的 Globalize。
所以在 _Layout.cshtml 我添加了这段代码
<script>
(function () {
$(function () {
$.when(
$.getJSON("/Scripts/cldr/supplemental/likelySubtags.json"),
$.getJSON("/Scripts/cldr/main/fr/numbers.json"),
$.getJSON("/Scripts/cldr/supplemental/numberingSystems.json"),
$.getJSON("/Scripts/cldr/main/fr/ca-gregorian.json"),
$.getJSON("/Scripts/cldr/main/fr/timeZoneNames.json"),
$.getJSON("/Scripts/cldr/supplemental/timeData.json"),
$.getJSON("/Scripts/cldr/supplemental/weekData.json")
).then(function () {
// Normalize $.get results, we only need the JSON, not the request statuses.
return [].slice.apply(arguments, [0]).map(function (result) {
return result[0];
});
}).then(Globalize.load).then(function () {
var culture = "fr";
Globalize.locale(culture);
});
});
})();
</script>
但是当我在服务器中部署时它不起作用。
Ps:我在我的 web.config 中添加了这个
<system.webServer>
...
<staticContent>
<remove fileExtension=".json"/>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
请帮忙。