getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.31k stars 168 forks source link

[Panel] Writing direction of panel fields is based on user language not content language #6350

Closed mlthrk closed 7 months ago

mlthrk commented 8 months ago

Description

The content of panel fields (Text, Textarea, Writer) is not displayed in the writing direction of the selected content language. Instead, the writing direction of the selected user language is used, with the effect that 'rtl' lanugages are shown 'ltr' and vice versa, if the writing direction of the content language and of the user language do not match.

Expected behavior

Display correct writing direction for editing texts when switching content language in panel, independent of the selected user language.

To reproduce

  1. Set up languages with 'rtl' and 'ltr' writing directions.
  2. Add text content in Text, Textarea or Writer fields in both languages.
  3. Displayed writing direction does not change when switching content languages.
  4. Change user language in user account settings: writing direction of fields now matches user language writing direction.

Your setup

Kirby Version
4.1.2 (seems to have started in 3.6, though, see below)

Additional context
User vandelay decribes the problem with screenshots in the Kirby forum

afbora commented 7 months ago

Team summary

Actually this is a regression but we can accept a bug since exists in long while.

Issue

:dir="$panel.direction" is provided from direction() method: https://github.com/getkirby/kirby/blob/4.1.2/panel/src/panel/panel.js#L158-L160

And translation.direction is provided from user language: https://github.com/getkirby/kirby/blob/4.1.2/src/Panel/View.php#L299-L301

Seems $direction prop doesn't work/run: https://github.com/getkirby/kirby/blob/4.1.2/src/Panel/View.php#L149-L160