Author Topic: Localizing UIInput default text  (Read 10228 times)

StridingDragon

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Localizing UIInput default text
« on: February 08, 2013, 08:53:57 PM »
I noticed that UIInput does not seem to work with the Localize script for the default label.

When I checkmark the "Use Label Text At Start" entry in the UIInput script, NGUI will display the actual text in the label but not the Localization Key that might be associated with the label. Is there a specific way to do this so that the default text can be displayed indifferent languages?
« Last Edit: February 08, 2013, 11:19:01 PM by StridingDragon »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localizing UIInput default text
« Reply #1 on: February 09, 2013, 08:06:02 AM »
Put the localization script on the label itself and it should work fine (at least with the latest version).

StridingDragon

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: Localizing UIInput default text
« Reply #2 on: February 09, 2013, 12:12:02 PM »
That's where I have it, and it didn't work for me. I need to check if I have the latest version, but I thought so.

StridingDragon

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: Localizing UIInput default text
« Reply #3 on: February 09, 2013, 01:01:51 PM »
Yeah, I just updated to NGUI 2.3.1 and it is still not working, I'm afraid. It displays the text typed in the Label's box, instead of the localized text drawn from the text file.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localizing UIInput default text
« Reply #4 on: February 09, 2013, 06:54:39 PM »
Text typed...? Of course it will display the typed text if you have something there. Localization on the label of the input field will only localize the default text shown when the label has no text value (ie: "Press ENTER to chat"). If you want it to localize the actual USER INPUT (BAD idea btw), you will need to write your own custom input validator.

StridingDragon

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: Localizing UIInput default text
« Reply #5 on: February 11, 2013, 09:11:09 PM »
Sorry, I may have been unclear. It prints the text that I have entered in the Inspector, instead of the localized default text I am providing through the Localize script key.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localizing UIInput default text
« Reply #6 on: February 12, 2013, 10:13:11 AM »
Well, perhaps it has changed since 2.3.1, but it certainly works properly with the latest version. I'll try to push it out sometime this weekend. Last two weekends proved to be bad for me due to the move.

kreso

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Localizing UIInput default text
« Reply #7 on: April 17, 2013, 12:46:32 PM »
I confirm this to still be the case.
Label on the input field doesn't react to localize (which is an awesome feature btw).
NGUI Version 2.5.1

I see that 2.1.6 says FIX: UIInput's "not selected" text can now be localized using UILocalize.
And I see a few other fixes in future versions but I don't see it working. I just started using NGUI yesterday.


UPDATE: I notice that it does work after I change the language for the first time. Until then input label field doesn't react to localization.
« Last Edit: April 17, 2013, 01:23:32 PM by kreso »

as.justis

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: Localizing UIInput default text
« Reply #8 on: November 22, 2013, 10:10:05 AM »
UPDATE: I notice that it does work after I change the language for the first time. Until then input label field doesn't react to localization.

It is an old issue, but I just bumped into it while using 2.7.0 version (can't switch to 3.0 for current project).
If somebody ever needs to fix this for any reasons, just call Init() on Awake() in UIInput.cs