3

I have a multi-language website that has just recently added Hebrew. So far, I have managed to find a way to have the text display right-to-left in the front end with CSS, and a semi-working solution for the admin fields.

However, there are 2 issues with display right-to-left text in the fields in the admin view: What I have setup in _config.php does not seem to apply to the language tabs for the MicrositeWidget data object I have set up. What happens is, no matter which language tab you're on, the content displays right-to-left unless you reload the page.

For everything else, the right-to-left text doesn't display consistently in the admin. When I switch languages, text displays right-to-left for English, Japanese, Korean, etc--basically all languages that aren't Hebrew. If I fresh the page, then everything is back to normal unless I go to Hebrew.

Here is what I have regarding the custom Admin CSS file I created:

#Root_heIL input, #Root_heIL textarea, #Root_heIL select,
input, textarea, select{
    direction: rtl !important;
}

And here is what I have in the _config.php file:

if(stristr($_SERVER['REQUEST_URI'], 'he_IL') !== FALSE || stristr($_SERVER['REQUEST_URI'], 'he_')){
HtmlEditorConfig::get('cms')->setOption('directionality', 'rtl');

}

Here are some screenshots to illustrate the inconsistencies. I've tried running dev/build?flush=all followed by dev/build?flush=1 but no luck in fixing this: Hebrew text in WYSIWYG when Hebrew language is selected

Japanese text in WYSIWYG after switching from Hebrew to Japanese

Japanese text in WYSIWYG

Image 1: Hebrew text in WYSIWYG when Hebrew is selected. Image 2: Japanese text in WYSIWYG when switching to Japanese.

Image 3: Japanese text in WYSWIG when reloading the page.

Has anyone encountered issues with Hebrew in SilverStripe displaying right-to-left in the admin fields? If so, did you find a working solution? So far, I haven't had much luck finding a solid, consistent solution for the problem.

STF
  • 1,485
  • 3
  • 19
  • 36
Dejsa Cocan
  • 1,539
  • 3
  • 19
  • 56
  • have you looked REQUEST_URI that does the cms section updates when you change the pages id presume that those dont contain he_ any longer. maybe you should look that from the session data or solve it in the Page class getCMSFileds(), not globally in the config – Olli Tyynelä Nov 01 '17 at 11:54

0 Answers0