| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 4456|Reply: 5
Collapse the left

RTL patch

[Copy link]
Post time: 2011-12-11 16:12
| Show all posts |Read mode
about one hour ago i download discuz!x multi lang, it's very good
one problem i found in it is rtl language that use default ltr stylesheet, i try to solved it, now it's ok


i change two functions, loadcsstemplate && writetocsscache , then past rtl stylesheet in template directory, all default style use ltr_ prefix like ltr common.css and so on, and rtl css prefiex with rtl_

i also attach rtl stylesheet in patch, for download click here: http://chindeka.com/download/patch.zip

 Russia

Post time: 2011-12-11 16:50
| Show all posts
Thanx!
Very interesting...
After some digging, I see that your solution is more universal than my similar solution.

Thinking now...

 Russia

Post time: 2011-12-11 16:54
| Show all posts
mr.alone wrote:

hi, this is fo  localized images problem for each language
chane is in _init_style() function, line: 682
  1. $langImgFolder = $this->var['style']['imgdir']."/".$_G['language'];
  2.                 if(is_dir($langImgFolder)) {
  3.                         define('IMGDIR', $langImgFolder);
  4.                 } else {
  5.                         define('IMGDIR', $this->var['style']['imgdir']);
  6.                 }
Copy the Code
and for rtl problem i make change csstemplate functions

functions: writetocsscache and loadcsstemplate()
rtl stylesheet also attached into zip archive

 Russia

Post time: 2011-12-11 17:11
| Show all posts
mr.alone  wrote 2011-12-11 17:59 :

and also rtl css must be prefixed with rtl_ like rtl_common.css and ltr css must be prefixed ltr_

    for any language, localized images must be put on current template image dir in a new directory with lang name like en,ru,fa an ...

    by default for fa language make a directory in static/image/common and rename it to fa and put all images into it

    and a small problem for localized images is task and stamp images that use STATICURL that can't be changed line IMGDIR,  and it must be use IMGDIR in template file, only few line in taemplate must be changed

 Russia

Post time: 2011-12-11 18:18
| Show all posts
The idea is clear.
I offers to slightly modify the file naming convention.
1) Do not add "ltr_" prefix for LTR languages, so all the files stay as is.
2) I want to see both files (ltr and rtl) one near other in a file list.
So, I prefer to replace "ltr_" prefix with the "_ltr" suffix:
common_css.css instead of rtl_common.css,
css_diy_rtl.css instead rtl_css_diyl.css,
etc.

And about the language-specific images.
It is not so good to place such images to the common folders.
It is more reasonable to place it inside the language pack folder,
i.e. /source/language/fa/image/


 Russia

Post time: 2011-12-11 18:53
| Show all posts
Yet another thanx for the idea!

Realized with slightly modified code.
Used RTL css files by Khalid Nahhal, because of his files is more completed.

http://code.google.com/p/discuzx-en/source/detail?r=244



You have to log in before you can reply Login | Register

Points Rules

Archive|Mobile|Dark room|CodersClub

Top.Mail.Ru
Top.Mail.Ru

2024-09-27 16:20 GMT+3 , Processed in 0.055370 sec., 8 queries .

Powered by Discuz! X3.4 Release 20230520

© 2001-2024 Discuz! Team.

MultiLingual version, Rev. 4301, © codersclub.org

Quick Reply To Top Return to the list