Right to Left text support for UMG and Slate

I’m trying to make a game that supports Hebrew as a selectable language (currently using 4.8.1). I’m using Localization macros (LOCTEXT) and the Localization Dashboard, but in the “Add new cultures” menu it doesn’t display Hebrew as an option. I even manually modified DefaultEditor.ini to have

SupportedCulturesStatistics=((CultureName=“en”),(CultureName=“he_IL”))

It doesn’t display the culture name properly but it does add the appropriate folders/files when gathering text/counting translations/compiling. However when I switch the current culture to he_IL it doesn’t work, stays in English. I also see when packaging you have to select what to cook, and once again Hebrew isn’t an option.

If I understand the Engine’s code properly, it uses a 3rd party tool called icu4c, correct? Their website indicates it natively supports Hebrew (and other right-to-left- languages). Why doesn’t Unreal support it? Is there something I can fiddle with so that it does?

Work in progress: I managed to get Hebrew to be a recognized culture by adding all of the “he.res” references from Engine\Content\Internationalization\All\ to Engine\Content\Internationalization\icudt53l. It now correctly displays “Hebrew” in the Localization Dashboard as one of the cultures I’m translating, and the translation editor works fine. However I still can’t

  1. Pick Hebrew from the list of available cultures in the Localization Dashboard or Packaging Settings menu
  2. Most importantly, display hebrew text. All characters appear as the same image (see screenshot below). This is true in the Editor and in the game itself.

Thanks

UE4 overall supports unicode so it can display anything that unicode supports as long as there font that will display it and considering you getting those blocks there no Hebraic font in engine. You need to import your own, here you have docs:

In Font Editor section you can see you can set up font to specific unicode range. Remember if you gonna import font, it needs to be unicode font, not some local encoding or else you might have problem to set it up.

As for right to left text support, i’m not sure, i dont see it in breaf look, so maybe that is worthy of suggestion, but maybe ICU fix this seamlessly if you use this kind of text script, first set up the font.

EDIT: I just checked Google Fonts and indeed Roboto (the default engine font) does not support Hebrew

Thank you for your reply, I tried a font with Hebrew support and it works. However, like you suggested, right to left isn’t working. Any suggestions on how to fix it?

In textblocks you can fix it’s postion of based on how many characters it has, setting justification to right might help out too, but it won’t fix the editor, . Right to Left is something that needs to build from ground up and it’s a challenge for UI design to support both, thats why lot of software avoid that looking that most languages writes from left to right. I will rename this thread to feature request and “Right to Left support for UMG and Slate” so somebody from Epic might notice it and add it to bug tracker. Until then you need to code workaround support for by yourself.

I’m sorry I’m not sure I understand. The text in Hebrew is coming out backwards. For example:

שלום

Appears in the game as
םולש

I’m not so worried about it being right justified or left justified…just the order of the letters. How would I code a workaround? I’m using a UMG Widget that contains a TextBlock which loads a FText variable…which of those do I need to work with?

Convert from text to string then you could use the “Reverse” node which reverses the order of the characters.

Indeed. Keep in mind that in a true right-to-left UI, the vertical scrollbars would also have to be on the left side…

In my game I’m hoping to make the user able to switch the current locale. You’re suggesting I listen for a locale change and update all of my Hebrew strings to be reversed? I feel that defeats the purpose of using the localization framework…it would make more sense to write all of the strings backwards in the first place (which I don’t want to do). Maybe I should write the localization files as normal and make some python script to reverse them all for me…if manually reversing is the only solution

Hi, What did you end up doing ?

Yes please tell me what you ended up doing.

In UE5 printing Hebrew (which is Right to Left language) worked out of the box for me with the Localization system. You just need a font that is truly Unicode and can support your language.

@devDoer Which font did you use?

Cyberbit . Note that it is free for NOT commercial projects.