Localize directly from scripts
10 years 7 months ago #80
by crash
Replied by crash on topic Localize directly from scripts
Thanks for quick reply.
I have to add namespace to make it work: I2.Loc.ScriptLocalization.Get(Term);
I have to add namespace to make it work: I2.Loc.ScriptLocalization.Get(Term);
Please Log in or Create an account to join the conversation.
- stupid_n00b
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
10 years 6 months ago - 10 years 6 months ago #93
by stupid_n00b
Replied by stupid_n00b on topic Localize directly from scripts
I'm having a tough time getting any strings to come back from the ScriptLocalization function. For example, I have these in my string table:
I have this in my ScriptLocalization function (generated via the editor tool):
But both of these return empty (null) strings when used in code:
I'm probably missing a setting somewhere? I have the I2 folder in the root of my Assets directory.
I have this in my ScriptLocalization function (generated via the editor tool):
public static class ScriptLocalization
{
public static string Get( string Term ) { return LocalizationManager.GetTermTranslation(Term); }
public static string kLang_Buttons_Buy { get{ return Get ("kLang_Buttons_Buy"); } }
public static string kLang_Buttons_Cancel { get{ return Get ("kLang_Buttons_Cancel"); } }
}
But both of these return empty (null) strings when used in code:
Debug.Log (ScriptLocalization.Get("kLang_Buttons_Buy"));
Debug.Log (ScriptLocalization.kLang_Buttons_Buy);
I'm probably missing a setting somewhere? I have the I2 folder in the root of my Assets directory.
Last edit: 10 years 6 months ago by stupid_n00b.
Please Log in or Create an account to join the conversation.
10 years 6 months ago #94
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic Localize directly from scripts
If those function return null it means that the term was not found in the loaded Language Sources.
Where are you storing your terms. Is it in a source inside the scene or in the I2Languages.prefab ?
Is the language set to any of the valid languages? (e.g. "English (United States)" and not just "English").
If you localize any other label/object using the Localize component and not changing the localization from the script, does it localize fine with those same terms?
Where are you storing your terms. Is it in a source inside the scene or in the I2Languages.prefab ?
Is the language set to any of the valid languages? (e.g. "English (United States)" and not just "English").
If you localize any other label/object using the Localize component and not changing the localization from the script, does it localize fine with those same terms?
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.
- stupid_n00b
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
10 years 6 months ago #95
by stupid_n00b
Replied by stupid_n00b on topic Localize directly from scripts
It looks like it works if I have a label with a Localize script attached to it active in the scene before I call it anywhere from code, so yes, it wasn't initializing the language. That's a fine workaround for what I needed. Thanks!
Please Log in or Create an account to join the conversation.
3 years 8 months ago #4267
by jiuer7845
Replied by jiuer7845 on topic Localize directly from scripts
Pandora Charms
Pandora Jewelry
Pandora Jordan Shoes
Pandora Air Jordan 4
Pandora Rings
Pandora Bracelets
Adidas Yeezy
Yeezy
Pandora Jewelry
Pandora Outlet
Nike Outlet
Adidas Yeezy
Air Max 720
Nike Air Max 270
Nike Air Force 1
Air Jordan 11
Air Force 1
ADIDAS NMD
Yeezy 700
Air Jordan 1
Nike Jordans
Jordan 1s
Nike Jordan 1
Nike Air VaporMax Flyknit 3
Nike Air Max 270 React
Jordan 1
Jordan 11
Nike Air VaporMax
Nike 270
Nike Vapormax
Nike Vapormax Flyknit
Air Jordan 1 Mid
Yeezy 350
Adidas yeezy
Yeezy Shoes
Yeezy 350
Pandora UK
Adidas Yeezy
Yeezy 350
Nike Shoes
Nike Outlet
NBA Jerseys
Yeezy
Pandora Charms
Pandora Sale
Pandora Jewelry Official Site
NFL Shop Official Online Store
Nike UK
Yeezy
Pandora Charms
Yeezy 350
bas2323
Pandora Jewelry
Pandora Jordan Shoes
Pandora Air Jordan 4
Pandora Rings
Pandora Bracelets
Adidas Yeezy
Yeezy
Pandora Jewelry
Pandora Outlet
Nike Outlet
Adidas Yeezy
Air Max 720
Nike Air Max 270
Nike Air Force 1
Air Jordan 11
Air Force 1
ADIDAS NMD
Yeezy 700
Air Jordan 1
Nike Jordans
Jordan 1s
Nike Jordan 1
Nike Air VaporMax Flyknit 3
Nike Air Max 270 React
Jordan 1
Jordan 11
Nike Air VaporMax
Nike 270
Nike Vapormax
Nike Vapormax Flyknit
Air Jordan 1 Mid
Yeezy 350
Adidas yeezy
Yeezy Shoes
Yeezy 350
Pandora UK
Adidas Yeezy
Yeezy 350
Nike Shoes
Nike Outlet
NBA Jerseys
Yeezy
Pandora Charms
Pandora Sale
Pandora Jewelry Official Site
NFL Shop Official Online Store
Nike UK
Yeezy
Pandora Charms
Yeezy 350
bas2323
Please Log in or Create an account to join the conversation.
Time to create page: 0.248 seconds