Hello every one,
This is my first article this this forum hope it will be much helpful for me and other also.
I'm gonna build a wordpress site with two languages English and Arabic. My Cliend doesn't want to be used some sort of plugins like qTranslate, Multilingual ets, to translate. because these plugins only replace text on same position, infact arabic start from right side and all the contents should be flipped to right..
If any body has an idea please share . Thanks in advance

Recommended Answers

All 10 Replies

to flip string in PHP, there is a PHP function called strrev . You can search it on google..

It should print the mirror image of any particular string..

something like this

Daniweb bewinaD

For the language characters, I believe wordpress is capable of storing characters of any language..

commented: You can't use strrev for language translation +0

This function flips text on same postion but my need is to flip whole page when selecting arabic language because Arabic starts from right . And offcourse wordpress is capable of storing multilanguage characters, but i didn't work upon this multi-language functionalty last time have used qtranslate plugin but now translate plugins are not allowed........

Have you tried WP translate? I am using this plugin for my website and to me it's quite good.

In addition to previous notes, the direction of the text depends on the HTML dir attribute, an example of multilanguage page:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>sample arabic language</title>
</head>
<body>
    <p lang="ar" dir="rtl">مرحبا</p>
    <p>hello</p>
</body>
</html>

If your page is not mixed and you have only Arabic, then change it to:

<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
    <meta charset="utf-8">
    <title>sample arabic language</title>
</head>
<body>
    <p>مرحبا</p>
</body>
</html>

The rtl value stands for right-to-left. I don't know Wordpress, plus I don't know if you're using an uri segment to define the language in use, but it should be easy to set lang and dir attributes on the fly.

wow.. thanks dear it will be much helpfull. but i need to make language switcher and how can i place double text one in english and other in Arabic is it possible ?? .... will it noe be too much lengthy process

Member Avatar for diafol

but i need to make language switcher and how can i place double text one in english and other in Arabic is it possible ??

Yes, you can do this in WP.

dear diafol can u please explain how can i do ?

thanks let me check if it works properly get back to you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.