开发者

PHP multilanguage for front end

开发者 https://www.devze.com 2023-04-07 01:26 出处:网络
I need to support about 20 languages (some are right to left). The database is all fine and we have that done properly but probem is the front end for the languages that are right to left. My dev team

I need to support about 20 languages (some are right to left). The database is all fine and we have that done properly but probem is the front end for the languages that are right to left. My dev team gave me a combo of these options:

1) Create seperate php view files for right to left and left to right

2) Create seperate CSS styles for r开发者_开发问答ight to left and left to right

But i am not happy; I want to use only 1 view and CSS style set and be able to control these. Obiviously i need to change the text direction and also need to change the UI elements direction so flip the page for all page content/objects. How can this be achieved?

I was reading on the two CSS properties: direction and unicode-bidi. Can the two alone achieve both needs of text direction and UI flip or do i absolutely have to use their option or some other way?

Shoudn't make a diffrence but we are using codeignitor with hbase and mysql.


Depends a bit on how you have built the page, I am not that familiar with arabic layouts but here are some thoughts:

If you have made a proper html structure you should be able to flip the page with just a few css properties. In order to not having to maintain duplicate css documents I would recommend that you add a class to the body tag that indicates that it is a right to left design, and when that class is present new style rules are applied that adjust the page for a right to left direction layout.

Made a small example: http://jsfiddle.net/PVhfR/ (uses a div with id #body instead of a real body element in the sample)


For the structure, you should shape it using float: leftand float: right and margins; doing this, when you invert the directions in the right-to-left-CSS, the whole layout should flip.

direction: rtl should be used for writing areas, like all the input elements, to flip the writing direction.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号