Author Topic: Updating localization key without changing language does not re-localize  (Read 13532 times)

zazery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
    • View Profile
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.

  1.     public void UpdateKey(string key)
  2.     {
  3.         mLanguage = "";
  4.         this.key = key;
  5.         OnLocalize(Localization.instance);
  6.     }

joreldraw

  • Guest
+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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
I've added a public "Localize" method.

capitalj

  • Jr. Member
  • **
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 88
    • View Profile
I've added a public "Localize" method.

How do we access the Localize method? Or is it not available yet?

-JJ

dlewis

  • Guest
How do we access the Localize method? Or is it not available yet?

-JJ

You'll have to wait for the next build.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
It's a part of 2.1.0, so just update. UILocalize.Localize.

capitalj

  • Jr. Member
  • **
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 88
    • View Profile
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?

dlewis

  • Guest
Deleting NGUI and reimporting may help, you could also try making a new blank project and importing it into that.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
NGUI upgrade instructions specifically ask you to delete the NGUI folder from a new scene. The process is described in the readme file. :P

PoN

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 111
    • View Profile
Re: Updating localization key without changing language does not re-localize
« Reply #9 on: January 31, 2013, 02:34:11 AM »
Where is UILocalize.Localize ? 
Worked on Doc&DogAge Of Fury 3D. Actually working on WarMach.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Updating localization key without changing language does not re-localize
« Reply #10 on: February 01, 2013, 01:10:13 AM »
It was added in 2.3.0.

PoN

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 111
    • View Profile
Re: Updating localization key without changing language does not re-localize
« Reply #11 on: February 01, 2013, 02:24:36 AM »
I using 2.3.1 version, doesn't have static method Localize
Worked on Doc&DogAge Of Fury 3D. Actually working on WarMach.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile