Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Pogwizd on Sun 04/10/2020 19:11:39

Title: String.truncate() returns a string from the default language only
Post by: Pogwizd on Sun 04/10/2020 19:11:39
When working on my demo I noticed that there was sth weird going on with String.truncate(). If the game is run with a non-default language and you are using String.truncate(), it returns the truncated string from the default language, rather than from the language that's selected.
Is that a feature or a bug?
Title: Re: String.truncate() returns a string from the default language only
Post by: Crimson Wizard on Sun 04/10/2020 19:14:52
String objects are not translated automatically. Only arguments sent into Say, Display and similar functions are got translated on the fly.

If you need to work with or modify a translated string, you have to first get it using GetTranslation() function.
Title: Re: String.truncate() returns a string from the default language only
Post by: Pogwizd on Sun 04/10/2020 19:19:28
Oh, ok. Must have missed it in the in the manual.
Thank you :)