PEAK XOOPS - A request for RTL users in englishin japanese

A request for RTL users

List posts in the topic

question A request for RTL users

msg# 1
depth:
0
Previous post - Next post | Parent - Children.1 .2 .3 | Posted on 2008/12/15 21:20 | Last modified
stranger  上等兵   Posts: 22
Hi GIJOE,

I wanted to first thank you for your great modules, and your great supports :) and would like to do a request, on behalf of all RTL users.

As you may know, there are people who have a RTL language, like us the Persians, the Jewish (Israelis), Arabians, ... and it has always been a pain to hack & re-hack the core and modules to keep the compatibility for RTL users. In ImpressCMS I tried to make these process easier, so I added RTL support to the Core (1.1 and recenter versions), now all translators and local supporters have to do is to set a value in the core and use RTL features & benefits of it, it spares a lot of time for them, and they can give better supports to local users :)

Now I am requesting that you add this request to altsys and you other great modules.

There are not much things to do:

1-Adding this to main functions of the module:


if(!defined('_GLOBAL_LEFT')){
define('_GLOBAL_LEFT', (( defined('_ADM_USE_RTL') && _ADM_USE_RTL )?'right':'left'));} // echoes here right in rtl languages
if(!defined('_GLOBAL_RIGHT')){
define('_GLOBAL_RIGHT', (( defined('_ADM_USE_RTL') && _ADM_USE_RTL )?'left':'right'));} // echoes here left in rtl languages


Now in templates we can use "<{$smarty.const._GLOBAL_LEFT}>" instead of left and "<{$smarty.const._GLOBAL_RIGHT}>" instead of right, and system will dynamically understand if the current language is RTL or not.

In PHP files is easier, just replacing 'left' with _GLOBAL_LEFT (in case of echo and print functions "'._GLOBAL_LEFT.'" or '"._GLOBAL_LEF."') and for 'right' with _GLOBAL_RIGHT (in case of echo and print functions "'._GLOBAL_RIGHT.'" or '"._GLOBAL_RIGHT."').

Of course users of other systems can use it too by adding a constant in system_root/language/your_language/global.php like
// change 0 to 1 if this language is a RTL (right to left) language
define("_ADM_USE_RTL","1");

I have changed a copy of altsys 0.70 to this, and you can download it by clicking here.


Kind Regards,
Sina Asghari
Votes:8 Average:8.75

Posts tree

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!