beebs93/c5-where_is_my_block

Table headings not translatable

Remo opened this issue · 0 comments

Remo commented

The table headings are not translatable. They are set in JavaScript using this code:

for(var sHeading in aTblData[0]){
    var sHeadClass = $sortInput.val() == sHeading ? 'ccm-results-list-active-sort-' + $dirInput.val() : '',
        aHeadText = sHeading.toString().replace(/_/g, ' ').replace(/-/g, ' ').replace(/\//g, ' ').split(' '),
        sHeadText = '';

    for(var i = 0, ii = aHeadText.length; i < ii; i++){
        sHeadText += aHeadText[i].charAt(0).toUpperCase() + aHeadText[i].slice(1);
        if(i + 1 != ii) sHeadText += ' ';
    }

    sTable += '<th class="' + sHeadClass + '"><a href="javascript:{};" data-sort="' + sHeading + '">' + sHeadText + '</a></th>';
}

We have to create some JavaScript variables from PHP or write the table headings using PHP.