zomex Posted October 30, 2012 Share Posted October 30, 2012 Hello everyone, After trying myself and contacting WHMCS support I'm unable to find a reliable way to load specific code if a RTL (right to left) language is selected such as Arabic & Hebrew (in all circumstances). Using Arabic as as example he's my attempt and WHMCS's: My attempt: {if $language eq 'arabic'}<link rel="stylesheet" type="text/css" href="templates/{$template}/css/rtl.css" />{/if} WHMCS' attempt: {if $language eq 'english'} {else} <link rel="stylesheet" type="text/css" href="templates/{$template}/css/rtl.css" /> {/if} As you can see this code is being used to load a CSS file that aligns the text to the right and mirrors images. The code works perfectly in the following situations: - when English is the default language - when Arabic is selected using the language dropdown However it doesn't work when Arabic is set to the default language. Does anyone know a way around this? It'll be much appreciated. Thanks, Jack 0 Quote Link to comment Share on other sites More sharing options...
sdemidko Posted November 1, 2012 Share Posted November 1, 2012 can you debug smarty variables available? (just put {debug} tag into some template and load the page) there should be something pointing to default language value 0 Quote Link to comment Share on other sites More sharing options...
zomex Posted November 1, 2012 Author Share Posted November 1, 2012 Thanks for your reply. WHMCS have replied to my ticket with code which worked. Basically the key is to add the variable to the language files and load it that way instead of using the main language variable: {if $LANG.textdirection eq "rtl"}<link rel="stylesheet" type="text/css" href="templates/{$template}/css/rtl.css" />{/if} I did originally try this before but I must have had a typo in the variable name. Thanks, Jack 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.