jquery find and replace multiple items
- by client
I have a monthly table that needs to be translated for each languages
Something like this (doesnt work obviously)
$('.lang-en #monthly th').each(function() {
var text = $(this).text();
$(this).text(text.replace('Tam', 'Jan'));
$(this).text(text.replace('Hel', 'Feb'));
$(this).text(text.replace('Maa', 'Mar'));
$(this).text(text.replace('Huh', 'Apr'));
$(this).text(text.replace('Tou', 'May'));
$(this).text(text.replace('Kes', 'Jun'));
$(this).text(text.replace('Hei', 'Jul'));
$(this).text(text.replace('Elo', 'Aug'));
$(this).text(text.replace('Syy', 'Sep'));
$(this).text(text.replace('Lok', 'Oct'));
$(this).text(text.replace('Mar', 'Nov'));
$(this).text(text.replace('Jou', 'Dec'));
$(this).text(text.replace('Yht', 'Total'));
});