GetTermTranslation behaving inconsistently
- The_A_Drain
- Topic Author
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 0
7 years 10 months ago - 7 years 10 months ago #2026
by The_A_Drain
GetTermTranslation behaving inconsistently was created by The_A_Drain
Hi,
I've been using I2 for a client project recently and I localized a big list of game strings but then was asked to change their names so as to avoid confusion to a different naming convention. Accessing via GetTermTranslation("game_congratulation_0") worked perfectly before, but now that entry has had it's name changed to "game_congratulation_goodjob" for example, it seems that if I write:
return I2.Loc.ScriptLocalization.Get("game_congratulation_goodjob");
I'll get the string I expect out of it.
Whereas if I write
return I2.Loc.ScriptLocalization.Get(key);
with a key being fetched from a list of strings, and even if I confirm that it's the same string as "game_congratulation_goodjob", it returns an empty string.
I'm pulling my hair out because of this one, I've even tried deleting some of those entries and re-creating them.
Objects that have been localized with the Localize script still function normally.
Any idea what might cause this behaviour?
edit:
Disregard! And delete if necessary. What was actually happening was quotation marks were being left in the strings when they were coming down from the server and being converted from JSON, I didn't spot it for hours... Sorry for the inconvenience!
I've been using I2 for a client project recently and I localized a big list of game strings but then was asked to change their names so as to avoid confusion to a different naming convention. Accessing via GetTermTranslation("game_congratulation_0") worked perfectly before, but now that entry has had it's name changed to "game_congratulation_goodjob" for example, it seems that if I write:
return I2.Loc.ScriptLocalization.Get("game_congratulation_goodjob");
I'll get the string I expect out of it.
Whereas if I write
return I2.Loc.ScriptLocalization.Get(key);
with a key being fetched from a list of strings, and even if I confirm that it's the same string as "game_congratulation_goodjob", it returns an empty string.
I'm pulling my hair out because of this one, I've even tried deleting some of those entries and re-creating them.
Objects that have been localized with the Localize script still function normally.
Any idea what might cause this behaviour?
edit:
Disregard! And delete if necessary. What was actually happening was quotation marks were being left in the strings when they were coming down from the server and being converted from JSON, I didn't spot it for hours... Sorry for the inconvenience!
Last edit: 7 years 10 months ago by The_A_Drain.
Please Log in or Create an account to join the conversation.
7 years 10 months ago #2028
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic GetTermTranslation behaving inconsistently
Great to know it was the quotation marks!!
I was pulling my hair as well!! haha
I was pulling my hair as well!! haha
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
To get the betas as soon as they are ready,
check this out
Please Log in or Create an account to join the conversation.
Time to create page: 0.167 seconds