I am using a Spring MVC (Spring-Security) project, When the user changes the language from the given dropdown menu, the given text in a particular language should get displayed. I tried in the following way but I am getting ???????????
in the browser when Hindi or Marathi text is selected.
JSP PAGE
This is the dropdown when the user can change the language
<div class="dropdown">
<select id="languageId">
<option value="English">English</option>
<option value="Hindi">Hindi</option>
<option value="Marathi">Marathi</option>
</select>
</div>
This are the text box which gets displayed when selected the particular language :
<label id="english">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500.
</label>
<label id="hindi" class="KrutiDev_hindi_text">
खरिदने एकत्रित अपनि लक्षण गटको लक्ष्य मार्गदर्शन पहोच। सहायता और्४५० मुक्त काम संसाध गयेगया प्रौध्योगिकी आपको जैसे बाटते सभिसमज प्रव्रुति कीसे पहोचने वार्तालाप विचरविमर्श विवरण तरीके लचकनहि
</label>
<label id="marathi">
इनपुट साधने वेबवर कुठेही, आपण निवडलेल्या भाषेमध्ये टाइप करणे सोपे बनवतात.
</label>
Javascript code for on change of dropdown option :
$(function () {
$("#languageId").change(function () {
if($(this).val() == 'Hindi') {
var hindi = document.getElementById('hindi');
hindi.style.removeProperty("display");
$('#english').css('display','none');
$('#marathi').css('display','none');
}
if($(this).val() == 'English') {
var english = document.getElementById('english');
english.style.removeProperty("display");
$('#hindi').css('display','none');
$('#marathi').css('display','none');
}
if($(this).val() == 'Marathi') {
var marathi = document.getElementById('marathi');
marathi.style.removeProperty("display");
$('#hindi').css('display','none');
$('#english').css('display','none');
}
});
});
CSS
@font-face {
font-family: 'Kruti Dev';
src: url('fonts/Kruti-Dev.ttf') format('truetype')}
.KrutiDev_hindi_text {
font-family: Kruti Dev !important;
font-size: 12px !important;}
I have also added <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
and updated Text file encoding to UTF_8
from Properties -> Resources.
Can anyone please help me what I am missing so that I can get the other languages text.