Search code examples
delphilocalizationfiremonkeydelphi-xe3firemonkey-fm2

How to prevent that a Firemonkey TLang translation is to long to fit in the element on my form


When I localize an application with the new TLang and a translated text is much longer than the original, wouldn't it break my layout for example because a button could be to small to fit the translated text? How do you handle this? Or is it possible to adapt the font size to the length of the translated string (I know that I could do this for every element on my form for example with Canvas.TextWidth() but this would be a pain).


Solution

  • Use autosize property, and align your Tlayout components to alContents of his parent.

    Example:

    Layou1.ALign:=alContents;
    Label1.Autosize:=True;