[jQuery] Replacing text based on language selection
I think what I need to do will work... I just ran into a road block.
One of my co-workers has filled out an XML sheet for me, with REAL
japanese values i.e.
<subAboutLoc>USロケーション</subAboutLoc>
<subAboutWW>グローバルロケーション</subAboutWW>
<subAboutProductOverview>製品概要</subAboutProductOverview>
<subAboutTradeShows>展示会</subAboutTradeShows>
<subAboutEduTraining>セミナー& トレーニング</subAboutEduTraining>
<subAboutCareerOpps>就職案内</subAboutCareerOpps>
<subAboutFinancial>財政情報</subAboutFinancial>
<subAboutSMCHistory>会社沿革 History</subAboutSMCHistory>
<subAboutOrderTrack>オーダートラッキング</subAboutOrderTrack>
My Jquery worked on a test I did for a German Sheet where I just
changed it to read German Locations if the language_sheet_de.xml had
been loaded because that was the value in the <subAboutLoc> tag.
But it is NOT working and displaying it for the Japanese style sheet.
My web page still says US Locations in that menu spot. The JQuery is:
// Load XML document based on language
var langSheet = "language_sheet_" + country + ".xml"
$.ajax({
type: "GET",
url: langSheet,
dataType: "xml", // specify the return type as xml
success: function(xmlDoc){
$(xmlDoc).find('subAboutLoc').each(function(){
var item_text = $(this).text();
$('#subAboutLoc').text(item_text);
});
}
});
And at the top of the XML file is:
<?xml version="1.0" encoding="utf-8" ?>