Length of translated Values
Posted: 21 Feb 2015, 17:14
I was trying around with the CMlLabel::ComputeWidth function after looking a bit through the _()-function* to access the built-in translations.
I still haven't quite figured out, how this works, it seems to be just a shortcut for TextLib::Compose (without overloading for multiple arguments or the need to include the TextLib) and the game then translates the first value of a string like
˽Cancel˽Cancel => translate(Cancel)
˽˽Cancel => translate()
The other way I have to access these built-in translations is with the translate="1" attribute on labels** (or the unicode hack viewtopic.php?f=464&t=19020#p162010).
However when I would like to adjust some elements to the text length, CMlLabel.ComputeWidth(CMlLabel.Value) computes the length of "˽Cancel" (*) or "Cancel" (**) - which differs from the displayed text.
Is there any workaround (except for using a custom dictionary)?
Edit: A similar problem of course comes for string modification (uppercase/lowercase/...)
I still haven't quite figured out, how this works, it seems to be just a shortcut for TextLib::Compose (without overloading for multiple arguments or the need to include the TextLib) and the game then translates the first value of a string like
˽Cancel˽Cancel => translate(Cancel)
˽˽Cancel => translate()
The other way I have to access these built-in translations is with the translate="1" attribute on labels** (or the unicode hack viewtopic.php?f=464&t=19020#p162010).
However when I would like to adjust some elements to the text length, CMlLabel.ComputeWidth(CMlLabel.Value) computes the length of "˽Cancel" (*) or "Cancel" (**) - which differs from the displayed text.
Is there any workaround (except for using a custom dictionary)?
Edit: A similar problem of course comes for string modification (uppercase/lowercase/...)