Support => NGUI 3 Support => Topic started by: zazery on May 27, 2012, 09:41:15 PM
Title: Updating localization key without changing language does not re-localize
Post by: zazery on May 27, 2012, 09:41:15 PM
I'm working on an interactive book with a GUI that persists between pages. Each page is a new scene and it updates the localization key of a UILabel when it is loaded. The text is not updated and calling OnLocalize won't work because mLanguage is set to the current language so it does nothing.
Here's what I've added to make it work. Each time I update NGUI I've got to re-apply my changes or remember not to import UILocalize. I think this feature might be a good addition to the official release, maybe not in this exact form.
publicvoid UpdateKey(string key)
{
mLanguage ="";
this.key= key;
OnLocalize(Localization.instance);
}
Title: Re: Updating localization key without changing language does not re-localize
Post by: joreldraw on July 17, 2012, 06:32:18 AM
+1 to add
I actually have a label that i need to change text depending of a Db conection and i use this method to change the msg with the Localization enabled.
Title: Re: Updating localization key without changing language does not re-localize
Post by: ArenMook on July 17, 2012, 10:36:56 AM
I've added a public "Localize" method.
Title: Re: Updating localization key without changing language does not re-localize
Post by: capitalj on July 18, 2012, 05:49:50 PM
How do we access the Localize method? Or is it not available yet?
-JJ
You'll have to wait for the next build.
Title: Re: Updating localization key without changing language does not re-localize
Post by: ArenMook on July 18, 2012, 07:10:06 PM
It's a part of 2.1.0, so just update. UILocalize.Localize.
Title: Re: Updating localization key without changing language does not re-localize
Post by: capitalj on July 18, 2012, 09:53:52 PM
Yes, I have already updated to this version but my UILocalize is from June 24th, so it didn't get updated. I tried to redownload and import, but the only a small portion of files show up in the import package window. Mostly just the example stuff, none of the UI scripts. Should I delete my NGUI folder and reinstall the package from scratch?
Title: Re: Updating localization key without changing language does not re-localize
Post by: dlewis on July 18, 2012, 11:17:43 PM
Deleting NGUI and reimporting may help, you could also try making a new blank project and importing it into that.
Title: Re: Updating localization key without changing language does not re-localize
Post by: ArenMook on July 19, 2012, 11:03:02 AM
NGUI upgrade instructions specifically ask you to delete the NGUI folder from a new scene. The process is described in the readme file. :P
Title: Re: Updating localization key without changing language does not re-localize
Post by: PoN on January 31, 2013, 02:34:11 AM
Where is UILocalize.Localize ?
Title: Re: Updating localization key without changing language does not re-localize
Post by: ArenMook on February 01, 2013, 01:10:13 AM
It was added in 2.3.0.
Title: Re: Updating localization key without changing language does not re-localize
Post by: PoN on February 01, 2013, 02:24:36 AM
I using 2.3.1 version, doesn't have static method Localize
Title: Re: Updating localization key without changing language does not re-localize
Post by: ArenMook on February 01, 2013, 09:31:44 AM