Author Topic: localization not loading  (Read 7038 times)

wouter

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 39
    • View Profile
localization not loading
« on: May 14, 2014, 09:55:57 AM »
When loading my main menu (first scene that loads), the language selection drop down is not working.

However if I go to a different scene and them come back to the main menu it is.
Also when I add the code (that is normally under Start) to OnClick, it works when I click on it.

Otherwise knownLanguages is null for some odd reason, how can I fix this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: localization not loading
« Reply #1 on: May 14, 2014, 11:06:50 PM »
Use the Localization.csv approach. I'm guessing you have multiple TXT files instead?

wouter

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 39
    • View Profile
Re: localization not loading
« Reply #2 on: May 15, 2014, 02:55:48 AM »
Use the Localization.csv approach. I'm guessing you have multiple TXT files instead?

no I am using .csv??

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: localization not loading
« Reply #3 on: May 15, 2014, 11:51:48 AM »
Hmm... that's odd then. Can you put some Debug.Logs statements into the Localization.cs file? In the knownLanguages property, for example? It would help to know what's set to what and why the languages are not being loaded. It's static, so it should technically still be there after the scene changes.

wouter

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 39
    • View Profile
Re: localization not loading
« Reply #4 on: May 16, 2014, 01:29:02 PM »
Hmm... that's odd then. Can you put some Debug.Logs statements into the Localization.cs file? In the knownLanguages property, for example? It would help to know what's set to what and why the languages are not being loaded. It's static, so it should technically still be there after the scene changes.

when i put in this -> Debug.Log(knownLanguages)
I only get a lot of "Null" ..

It seems a problem with the popuplist though, I get not errors regarding translation (i.e. key "blah" not found").
But the drop down selection only works after going to a different scene and coming back, or by adding the code to onClick and clicking on the pop up list.






ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: localization not loading
« Reply #5 on: May 16, 2014, 02:55:15 PM »
Accessing knownLanguages is when the localization content gets loaded if it's not already present. Having null would mean it be loaded, so my question is why isn't it being loaded?

wouter

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 39
    • View Profile
Re: localization not loading
« Reply #6 on: May 19, 2014, 03:42:25 AM »
Well I think this is an error in Ngui.

When I put a yield in the LanguagesSelection script, it does work. It appears it grabs the languages before Localization actually has them..


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: localization not loading
« Reply #7 on: May 19, 2014, 01:13:25 PM »
That's the odd part. The languages are loaded immediately as soon as you access knownLanguages.