Patch #6012
closedRTL layout
100%
Description
Hello,
Following #5972 I thought of a better way to implement RTL support.
Instead of using a theme, which affects all users (unless installing theme changer, see #5993), I moved the css file to the standard stylesheet directory, named rtl.css, and added a link tag if current language is Hebrew (suppose Arabic support will be added, it will need to be added to this patch as well).
Another downside that is handled with this method is the dependency between the language and the selected theme - the rtl theme uses 'alternate' as its base theme, so if the admin wants to use it, he must either use the alternate theme or manually edit the css file to include some other theme.
With this new method, this dependency is removed, and any theme should work with it.
rtl.css should be added to public/stylesheets, and the rtl theme may be removed
Files
Related issues
Updated by Orgad Shaneh over 14 years ago
- File rtl-layout.patch rtl-layout.patch added
- File he.yml he.yml added
This approach is similar to Qt translation. It requires no changes to base.rhtml when adding a new RTL language. All the translator needs to do is define direction: RTL in the yml file.
Updated by Ebrahim Mohammadi about 14 years ago
Find a patch against trunk in attachment that implements RTL support, and adds direction string to all locale files. I've used rtl.css of Orgad Shaneh.
Updated by Holger Just about 14 years ago
- Category set to Translations
- Assignee changed from Holger Just to Azamat Hackimov
The patch looks good to me. Looks like a clean approach. I haven't tried it though.
Could you please check and confirm that it works with all distributed themes? Once that's done, I vote for inclusion / replacement of the RTL theme.
Updated by Orgad Shaneh about 14 years ago
I wouldn't submit it without checking :)
I added another entry for <pre> in the css, and made a few changes in the translation file (can I have svn account for the translation, instead of posting it here with each change?)
Updated by Holger Just about 14 years ago
Orgad,
- Please keep this ticket for the RTL changes only, for updated of the Hebrew translation, please use a new ticket.
- Please post patches instead of whole files.
The question for further checking was not meant to insult you. Sorry if that may have sounded so. I just want to make sure that the patches are of the known good quality. As I am unable to check it myself due to my lack of RTL language knowledge, I just ask the community :)
Updated by Orgad Shaneh about 14 years ago
Regarding Mohammad's patch, the rtl stylesheet must be referenced after all other stylesheets (ses the difference between rtl-layout.patch and rtl.patch)
Updated by Holger Just about 14 years ago
This is a rather difficult question (with larger boundaries as only this patch).
The question is: which parts of the stylesheets should be evaluated last (and thus has the greatest power to overwrite stuff without having to resort to !important
.
- application style
- specific module and plugin styles
- themes
The RTL patch then should be inserted after the module styles.
Unfortunately the theme is currently loaded first which makes it very hard to overwrite default plugin styles. However, I think the RTL style provide defaults which should be easily overwritable by plugins. If this is a problem with current core styles, I think those should be changes instead. In this sense, I consider the rtl.css as a part of application.css which should be evaluated in the same context.
Updated by Orgad Shaneh about 14 years ago
It should at least appear after context menu (which it overrides)
Updated by Azamat Hackimov about 14 years ago
- File context_menu_rtl.patch context_menu_rtl.patch added
I commited RTL layout. For context menu I think better create own rtl css file, see patch for my idea (patch not good, need more work from ruby-guru).
Updated by Eric Davis about 14 years ago
- File rtl-error.png rtl-error.png added
- Status changed from New to 7
- Assignee changed from Azamat Hackimov to Eric Davis
- Target version set to 1.0.1
Azamat sent me a style bug for me to look at with the context menu before the 1.0.1 release. The context menu arrows are on the right instead of the left.
Updated by Orgad Shaneh about 14 years ago
See note 6 (Is there a normal way to reference a note?)
Updated by Eric Davis about 14 years ago
Holger Just and Orgad Shaneh:
I think it would be good to discuss the stylesheet load order in the forums. Based on Redmine's limited theme support, there are several edge cases that we would need to think about in order to support application, theme, rtl, and plugin styles.
Updated by Eric Davis about 14 years ago
- Category changed from Translations to UI
- Status changed from 7 to Resolved
- % Done changed from 0 to 100
Updated the context menu to support RTL using Azamat's patch. I also fixed the icon's css, the context menu added it's own styles that override the rtl.css. (r4014)
Updated by Eric Davis about 14 years ago
- Status changed from Resolved to Closed
Merged to 1.0-stable.