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
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]
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
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' ) ;
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)
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
Thanks
Oh it's OK, I understand, you too have a busy life
Kind Regards,
stranger