Failed ScriptLocalization.Get Function

More
8 years 9 months ago #1329 by Sandman
Hi there!

This is my first day with your localization plugin. It is well documented and everything worked fine till trying to translate a runtime editted string:
string text = I2.Loc.ScriptLocalization.Get(chainType.ToString());
Debug.Log(chainType.ToString() +  " : " + text);

the Get method returns an empty string so this call returns this output:
ThreeOfKind :

On my I2Source prefab there is a Term with ThreeOfKind key assigned. Here is the screenshot:


I guess i am doing something wrong. Can you assist me?
Attachments:

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago #1330 by Frank
Hi,
From your LanguageSource I see that the term "ThreeOfKind" belongs to the "ChainTypes" category.
So, the actual term is "ChainTypes/ThreeOfKind" instead of just "ThreeOfKind"

try:
string text = I2.Loc.ScriptLocalization.Get("ChainTypes/"+chainType.ToString());
Debug.Log(chainType.ToString() +  " : " + text);

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
The following user(s) said Thank You: Sandman

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago #1331 by Sandman
Hi Frank,

Thanks for uber-fast response! Your answer worked like a charm.

I knew it was so simple and i was missing something. Can you add this information to FAQ forum section ?

Thanks and Thumbs Up!.

Please Log in or Create an account to join the conversation.

More
8 years 9 months ago #1332 by Frank

Your answer worked like a charm.

Glad to help! :-)

Can you add this information to FAQ forum section?

Will do!

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.226 seconds
Template by JoomlaShine