Jump to content
goldman

changing direction in middle east language

Recommended Posts

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

Share this post


Link to post
Share on other sites

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;
}

 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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; ?>

Share this post


Link to post
Share on other sites

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"?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...