B4J Question How to Localize UI without Showing Ellipses

xulihang

Well-Known Member
Licensed User
Longtime User
The Chinese text is usually shorter than English. So if we directly replace the text with the translated version, there will not be enough space for the translation and ellipses will show.
1761532925586.png
1761532909829.png



Is there a good way to avoid this?
 

emexes

Expert
Licensed User
Longtime User
Two ways I've used (but not with ideographic languages, only with alphabetic languages) are:

A Sub that will measure and resize the text of a button to make it fit.

Button texts to have a double translation (I use a pipe symbol to separate them inside a single string):
-a short one to fit reasonably on the button, to act as a memory jogger
-a long one to be a tooltip, for if the memory is not jogged
 
Upvote 0

emexes

Expert
Licensed User
Longtime User
The Chinese text is usually shorter than English.

What's interesting is that the number of component strokes that make up those texts is very similar (22 english 21 chinese) so maybe there is a universal optimal information density when recording thoughts to writing, that written languages tend towards.

Optimal, including considerations such as clarity, aesthetics, and "error correction" redundancy.
 
Upvote 0
Top