Author Topic: Localization and UInput  (Read 5050 times)

magnatua

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Localization and UInput
« on: January 17, 2014, 06:51:03 AM »
Hello everyone!
How can I use Localization with "default text" in UInput?


My NGUI version is 3.07

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization and UInput
« Reply #1 on: January 17, 2014, 09:30:29 PM »
Put UILocalize on the UIInput. And update your NGUI. I don't know if it's possible in 3.0.7.

vip_prizrak_3

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
    • View Profile
Re: Localization and UInput
« Reply #2 on: January 20, 2014, 04:00:47 AM »
I tried it v3.07. It does not work.
When I put UILocalize on the UIInput background picture disappeared, but localization key or srating value not translated.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization and UInput
« Reply #3 on: January 20, 2014, 07:15:41 AM »
As I said, I don't know if it's possible in 3.0.7. Please update first.

vip_prizrak_3

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
    • View Profile
Re: Localization and UInput
« Reply #4 on: January 20, 2014, 10:02:42 AM »
I updated to version 3.0.9(f2), but it did not help.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization and UInput
« Reply #5 on: January 21, 2014, 02:08:35 AM »
Ok, I just double-checked the code. You should attach UILocalize to the UILabel of the input field, not the input field itself.

P.S. You may also need to change UIInput.defaultText to this:
  1.         public string defaultText
  2.         {
  3.                 get
  4.                 {
  5.                         return mDefaultText;
  6.                 }
  7.                 set
  8.                 {
  9.                         if (mDoInit) Init();
  10.                         mDefaultText = value;
  11.                         UpdateLabel();
  12.                 }
  13.         }
« Last Edit: January 21, 2014, 02:17:47 AM by ArenMook »

vip_prizrak_3

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
    • View Profile
Re: Localization and UInput
« Reply #6 on: January 21, 2014, 04:13:13 AM »
Thanks!