RTL direction languages not working in the panel

Hi :wave:, I have updated an older project from Kirby 3.5 to 3.9 recently, mainly for the right-to-left support of the Blocks field in the panel, which was missing. But after updating, now all the fields in the panel donā€™t get the proper direction: rtl;, even though the language is properly set in my files and in the panel (it did work on 3.5 before updating). Itā€™s a multilang site with 2 RTL languages. Would really appreciate if anyone could be the problem here?

My config.php

<?php
return [
  'languages' => true,
  'smartypants' => true,
  'panel' => [
    'install' => true,
    'language' => 'he'
  ],

site/languages/ar.php

<?php
return [
  'code'      => 'ar',
  'name'      => 'Arabic',
  'default'   => false,
  'locale'    => [
    'LC_ALL'  => 'ar_IL'
  ],
  'direction' => 'rtl',
  'url'       => '/ar',
  'translations' => [
  ],
];

The panel:

But your Panel user language is set to English. If you change it to an RTL language, the direction should also change.

Hi @texnixe, not sure I understand what you mean? The panel is set to Hebrew (he) as default (in the config and also in the languages/he.php, default => true), and in the panel I switch to Arabic or Hebrew (as you can see highlighted in the screenshot I attached, I am on ā€˜Arabicā€™) and its still not changing to RTLā€¦ :pray:

Hm, doesnā€™t look like it, the interface looks pretty English to me? Note, Iā€™m talking about the user language, not your selected translation language.

Hereā€™s my config.php:

return [
  'debug' => true,
  'languages' => true,
  'smartypants' => true,
  'panel' => [
    'install' => true,
    'language' => 'he'
  ],

and site/languages/he.php:

<?php

return [
  'code'      => 'he',
  'name'      => 'Hebrew',
  'default'   => true,
  'locale'    => [
    'LC_ALL'  => 'he_IL'
  ],
  'direction' => 'rtl',
  'url'       => '/',
  'translations' => [
  ],
];

And when I login to the panel the default language is set to Hebrewā€¦ The panel always ā€œlookedā€ in English :blush: even on Hebrew (I guess because the panel isnā€™t translated), but all the fields appeared in the correct RTL direction. Same with Arabic. But since I upgraded, switching to Arabic or Hebrew doesnā€™t switch the writing direction which makes it really hard to write this wayā€¦
I think my setup is correct, no? Is there any tip I could maybe try or something I am doing wrong?

Hm, I donā€™t even see he as available Panel user languageā€¦ Setting to Arabic changes the direction as expected.

Yeah, the panel is not available in Hebrew, that I understand. But on 3.5 I did not need to change the entire UI language to get the fields to be in RTL. So I could use the panel in English, but still when changing the page translation to ā€˜Hebrewā€™, my fields (text, textarea, etc.) were in RTL, so I could write in the right direction. Trying to write in Hebrew in LTR is pretty hardā€¦ :slight_smile:

Here is how it worked on 3.5: user language: English; page translation: Hebrew; and fields work perfectly in RTL.

And this is 3.9: user language: English; page translation: Hebrew; And fields dont get the right settings as defined in the language php files.

My point is that when the UI is set to English (or any other LTR lang), the direction => 'rtl' as defined in the language php files, are not respected. Is that a bug?

(* when the user language is set to Arabic for example, the direction => 'ltr'as defined in the en.php, is respected, but thatā€™s not what Iā€™m looking for.)

There might have been some changes, but I canā€™t really tell when what changed.

Okā€¦ Bit of a bummer, cause it makes the panel basically almost unusable for RTL languagesā€¦ unless you change the entire panel interface to Arabic. So I would call it a bug or at least unwanted behavior.
btw, I also tried it with 3.6, 3.7, 3.8 and 3.9.
:frowning_face:

Thatā€™s definitely not intended.

Hi! :slight_smile:

I just opened a new issue on Github:
[Panel] Writing direction of panel fields is based on user language not content language #6350

1 Like