PEAK XOOPS - A request for RTL users in englishin japanese

A request for RTL users

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
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
Previous post - Next post | Parent - No child | Posted on 2008/12/21 5:48 | Last modified
GIJOE  ÀèǤ·³Áâ   Posts: 4110
hi stranger.

I've just released altsys-0.71 and it supports _GLOBAL_LEFT/RIGHT.

Thank you for the suggestion.
If you have RTL hacked templates/phps for my modules, tell me please.

I'll modify my modules one by one.

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

It can be a simpler code
	@define( '_GLOBAL_LEFT' , @_ADM_USE_RTL ? 'right' : 'left' ) ;
	@define( '_GLOBAL_RIGHT' , @_ADM_USE_RTL ? 'left' : 'right' ) ;
Note: check [1.2.1]
Votes:11 Average:10.00
Previous post - Next post | Parent - Children.1 | Posted on 2008/12/21 6:39
stranger  ¾åÅùʼ   Posts: 22
Hi GIJOE,

Thank you very much :)

I'll try to collect all the hacked templates and php files and will upload them somewhere & share it with you.

Quote:
It can be a simpler code

Sure, I'll modify it like this in ImpressCMS too, thank you
Votes:11 Average:9.09
Previous post - Next post | Parent - Children.1 | Posted on 2008/12/22 11:05
GIJOE  ÀèǤ·³Áâ   Posts: 4110
The previous code is troublesome for environments without _ADM_USE_RTL

The code should be ...
// for RTL users
@define( '_GLOBAL_LEFT' , @_ADM_USE_RTL == 1 ? 'right' : 'left' ) ;
@define( '_GLOBAL_RIGHT' , @_ADM_USE_RTL == 1 ? 'left' : 'right' ) ;
Votes:11 Average:9.09
Previous post - Next post | Parent - Children.1 | Posted on 2009/1/17 19:34
stranger  ¾åÅùʼ   Posts: 22
Hi Gijoe,

Thank you for the updates.

I have changed a couple of your other modules to be compatible with RTL.

the following are added in a package for you

-avaman
-bulletinHD
-d3forum
-d3pipe
-minihaku
-myalbum-p
-protector
-sitemap
You can Download it here (as a package)

Kind Regards,
Sina Asghari (aka stranger)
Votes:9 Average:8.89
Previous post - Next post | Parent - No child | Posted on 2009/1/20 12:53
GIJOE  ÀèǤ·³Áâ   Posts: 4110
hi stranger.

Thank you for creating RTL hacked version.

I'll merge them one by one.
Though the speed might look too slow, don't be impatience with it, please
Votes:9 Average:10.00
Previous post - Next post | Parent - No child | Posted on 2009/1/21 2:21
stranger  ¾åÅùʼ   Posts: 22
Thanks

Oh it's OK, I understand, you too have a busy life

Kind Regards,
stranger
Votes:7 Average:8.57

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!