Javascript toLocaleDateString()不适用于哈萨克斯坦语言

Javascript toLocaleDateString()不适用于哈萨克斯坦语言,javascript,Javascript,我试图将我的日期格式转换为哈萨克语,但它没有按预期工作。它仍然显示英语月 window.settings={ 朗:“kk” } const dateOptions={month:'long',day:'numeric',year:'numeric'}; const time24hourformations={hour:'2位',minute:'2位',hour12:false}; 常量time12hourformations={hour:'2位',minute:'2位'}; 调试器; cons

我试图将我的日期格式转换为哈萨克语,但它没有按预期工作。它仍然显示英语月

window.settings={
朗:“kk”
}
const dateOptions={month:'long',day:'numeric',year:'numeric'};
const time24hourformations={hour:'2位',minute:'2位',hour12:false};
常量time12hourformations={hour:'2位',minute:'2位'};
调试器;
const langToLocale={en:'en-GB',sv:'sv-SE',ar:'ar',zh:'zh-CN',kk:'kk',ru:'ru',de:'de',pt:'pt:'pt',pt-BR';
函数toLocaleBasedDate(日期){
var日期=新日期(日期);
调试器;
返回日期.toLocaleDateString(langToLocale[settings.lang],dateOptions);
}

console.log(TolocalBasedDate(“04/26/2021”)
试着这样写:
kk:'kkkz'
你能不能展示一个更简单的例子,它不依赖于我们看不到的一些插值…?@poPaTheGuru它不起作用。@deceze我添加了一些图像。希望它能让你更清楚。我给你写了一个片段。请删除所有服务器代码并将settings.lang替换为
@(string.IsNullOrWhiteSpace(ViewBag.CurrentCulture)?Model.Layout.CurrentCultureCode.Trim():ViewBag.CurrentCulture.Trim()