Jump to content

Recommended Posts

 

Hey everyone, I'm working on an Arabic localization mod for DST and running into a problem with how the game handles text wrapping.

Arabic is a right-to-left language, but DST's UI is built for left-to-right text. I've managed to get Arabic text displaying correctly by reversing the strings and aligning everything to the right, which works great for short text that fits on one line.

The problem happens when text is too long and the game needs to wrap it to multiple lines. Since the game assumes all text is left-to-right, it breaks the lines at the wrong positions. So a sentence that should read "Advanced settings for game interface" ends up wrapped as "For game interface / Advanced settings" which is completely backwards and confusing to read.

I've tried using Unicode directional marks but they don't render properly in DST. I also tried manually inserting line breaks, but the game just ignores them and re-wraps the text anyway based on the container width. Adjusting the widget width helps a bit but doesn't actually change which direction the text wraps.

I'm currently hooking into TextWidget.SetString to process the Arabic text, but I can't find any way to tell the game to wrap text from left to right instead of right to left. Does anyone know if there's a way to control the text wrapping direction, or maybe disable automatic wrapping completely so I can handle it manually?

Would really appreciate any suggestions or pointers to parts of the API I might have missed.

Thanks!

Maybe @Kova_ has some advice about this.

I remember there was a problem with displaying arabic names in the widget with player names.
But you(kova) had solved that i think? So maybe this issue is related.


(I think it was inside a discord widget through a bot written with python, so might be tad different than this)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...