我希望我的页面在选择的语言为印地语时以印地语显示某些文本。
我的代码:
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
var expires = "expires=" + d.toGMTString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
if ((currentUiCluture != null) && (currentUiCluture != undefined) && (currentUiCluture != "")) {
if (currentUiCluture == 'hi-IN') {
$('#AmtFYyear').text(yr + "वित्त वर्ष के लिए जिलावार अर्जित राशि " + "(करोड़ रुपये में)");
}
if (currentUiCluture == 'en-US') {
$('#AmtFYyear').text("District wise Accrued Amount for FY " + yr + " (Rs in Cr.)");
}
}
else
{
$('#AmtFYyear').text("District wise Accrued Amount for FY " + yr + " (Rs in Cr.)");
}
但是वि््ववर्षेलिएजिला्ाजिअर्जि्राशि被转换为ड
起初我以为是由于空白,但这也无法解决问题。
答案 0 :(得分:1)
您近在咫尺只需使用
decodeURI(row)
如下:
source: ["first","second",decodeURI("वित्त वर्ष के लिए")]