I'm working with panels on a arabic site. On rtl direction, rows must be reversed as shown
on the attached image (exemple.png).
exemple
The attached patch is fixing this on the flexible layout.

Comments

Letharion’s picture

Title: Rows reverse on rtl languages » Automatically reverse pane order on rtl languages
Category: bug » feature

Does it really make sense to hard-code this behaviour? While I have little experience with RTL websites, I find it hard to believe that it's a universal rule to reverse order of all content.

tarekdj’s picture

hi Letharion,
I don't agree with you because all rtl laguages are supposed to be displayed from right to left.
An other thing that confirm it : the bartik core theme is automatically reversing on any rtl language
you can test this by adding a custom language with rtl direction.
thanks for your reply

merlinofchaos’s picture

Status: Needs review » Needs work

The patch fails several code style tests:

Indentation is wrong
Missing braces on an if/else clause
(very very minor) missing a . at the end of the comment.

You may need to read about the Drupal coding style guidelines if you intend to continue contributing patches. The patch seems perfectly reasonable to me, if it can be improved to match code style, so I think the community would be well-served if you did this.

merlinofchaos’s picture

Title: Automatically reverse pane order on rtl languages » Automatically reverse region order in rows on rtl languages

Also, retitling for clarity. The original title does not reflect what this patch accurately does, and created a misperception that skewed Letharion's review.

Letharion’s picture

Status: Needs work » Needs review
StatusFileSize
new1.5 KB

If you two say so :)
My in-experience in the RTL area probably made me confused.

merlinofchaos’s picture

+ if ($language->direction == 1) {

Is there a constant or something we can use so we don't compare this to the number 1? It looks like it should be LANGUAGE_RTL -- and that's much better than comparing against a number.

Letharion’s picture

Compare with RTL constant instead of 1.

Should code that uses the $language global at some point be converted to use the page manager language context in the future?

merlinofchaos’s picture

I don't think there is a way to feed the layout a language context meaningfully. The global language is probably just fine.

It occurs to me that this probably should be optional (on by default for new layouts, off for existing layouts) in the canvas settings. It is entirely possible that there are people who have already set up their sites for RTL languages that would suddenly have their layouts flip on them. That would be unfortunate for them!

Letharion’s picture

Status: Needs review » Needs work

@merlin The language functionality I refer to is this one #1301908: Language support for Page Manager.

tarekdj’s picture

StatusFileSize
new1.48 KB

Changed 1 by LANGUAGE_RTL.

tarekdj’s picture

Status: Needs work » Needs review

forgot to change the status in my last comment :-)

Letharion’s picture

Status: Needs review » Needs work

#10 does not adress the concerns in #8, and as far as I can tell looks no different from #5, so I set this back to needs work.

tarekdj’s picture

I think, in that case, we can add another flexible layout with rtl support. Then the user has the choice to use with or within reverse. This will not affect the existant layouts.

japerry’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.