goldman Posted May 22, 2018 Share Posted May 22, 2018 hi firends, i need help . how i can make my site with 2 language .on english and one persian.in persian language alphabet is right to left but in english is left to right how i can make this change in my site ( in my template) thanks Link to comment Share on other sites More sharing options...
louisstephens Posted May 22, 2018 Share Posted May 22, 2018 Hey goldman, I believe you could add a class (for when using the Persian language) like .persian (or whatever is better for you). In your css, add the following: .persian { direction: rtl; } Link to comment Share on other sites More sharing options...
goldman Posted May 23, 2018 Author Share Posted May 23, 2018 Thanks my friend but thats not working? Link to comment Share on other sites More sharing options...
Autofahrn Posted May 23, 2018 Share Posted May 23, 2018 If thats not global enough, why not send an additional CSS file to the client whenever rtl is required, which globally adds direction:rtl; to all necessary tags? Link to comment Share on other sites More sharing options...
goldman Posted May 23, 2018 Author Share Posted May 23, 2018 hi my firend. i need to know how i can make an if code for this.for example when using persian language template loading main-fa.css. i wrote this code but thats not working <?php if($language == 'fa') : ?> <link rel="stylesheet" href="<?php echo $config->urls->templates?>css/main-fa.css?v=2.5" type='text/css'> <?php endif; ?> Link to comment Share on other sites More sharing options...
Autofahrn Posted May 23, 2018 Share Posted May 23, 2018 I'm used to retrieve the current language from $user->language. I'd personally prefer to write such conditional code like this, but that probably doesn't make a difference: <?php if($user-language == 'fa') echo "<link rel='stylesheet' href='{$config->urls->templates}css/main-fa.css?v=2.5' type='text/css'>"; ?> Did you verify that your $language is actually set to "fa"? Link to comment Share on other sites More sharing options...
goldman Posted May 25, 2018 Author Share Posted May 25, 2018 hi my friend i verify my language to fa but your code not working , i was test that i need a code when visitor choose persian language , site template wtich to rtl Link to comment Share on other sites More sharing options...
dragan Posted June 3, 2018 Share Posted June 3, 2018 You should also add dir to the html tag: https://www.w3.org/International/questions/qa-html-dir And of course the lang attribute too. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now