views:

30

answers:

2

Hello All

I have a multilanguage webiste English and Arabic. The javascript for the fontsizes is included in the theme not in the .css.

Both language have different fontsize 16 and 12. When switching from English to Arabic the English letters such as ( dates and stuff like that ) are shown way too big. And when switching from English to Arabic the arabic letters are too small. I would really like to make this javascrip fully language dependent so that the English letters being shown in the Arabic version keeps the same fontsize as in English version and vice versa for arabic.

<script type="text/javascript">
<!--
<{$xoops_js}>
//-->
function setstyle(tag){
    var elements = document.getElementsByTagName(tag);
    for (var i = 0; i < elements.length; i++) {
        var element = elements[i]
        element.style.fontWeight = 'bold';
        element.style.fontSize = '[en]12[/en][ar]16[/ar]px';
        if(element.className == "nochange"){
            element.style.direction = "ltr";
        }else{
            element.style.direction = "[en]ltr[/en][ar]rtl[/ar]";
        }   
    }   
}   
</script>

The following script is the current javascript included in the theme. I would really appreciate it if somebody out there could help me with this problem. My knowledge of javascript is to be honest zero.

Thanks

TOONOID

A: 

What happens here is, styling the page with different fontsizes via Javascript. You dont need Javascript to style different fonts! Normally you do this with Stylesheets. If you develop a web app and don't know Stylesheets nor JavaScript you are OOL - out of luck.

I suggest this: If you want the same font-size for both languages, just alter any integer of "16" in the given JS function to "12". Simple as that.

Stephan Kristyn
A: 

Hello Stephan

Thanks for your reply.

The fontsizes should be definitely different. Because size 16 in Arabic version is OK but in the English version it is way to big.

When you switch from English to arabic the whole website mirrors horizontally and there you still have some english characters or words within the arabic version. I know little about java but I van find my way in CSS. Of course i Have tried to make separate css files for both the langugaes but that gave me too many errors so the easiest option was to include this javascript in the theme. I hope I made my problem clear enough. Any suggestion or advice is appreciated.

Thanx