Author Topic: Localization key not found  (Read 5095 times)

exiin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Localization key not found
« on: June 10, 2014, 03:38:45 PM »
Hello All,

I keep on having theses errors all the time :

  1. Localization key not found: '.........'
  2. UnityEngine.Debug:LogWarning(Object)
  3. Localization:Get(String) (at Assets/NGUI/Scripts/Internal/Localization.cs:308)
  4. UILocalize:OnLocalize() (at Assets/NGUI/Scripts/UI/UILocalize.cs:100)
  5. UILocalize:Start() (at Assets/NGUI/Scripts/UI/UILocalize.cs:83)

I don't really know why, because the language selector work correctly and change correctly to other language, it even works in Russian and Chinese...


Also when I try to get the list of languages in another script, the output that I get is :
using :
  1. Debug.Log ("languages : " + Localization.knownLanguages.ToString ());
I get that :
  1. languages : System.String[]
  2. UnityEngine.Debug:Log(Object)
  3. GameControl:NewPayer() (at Assets/Scripts/Player/GameControl.cs:40)
  4. GameControl:Awake() (at Assets/Scripts/Player/GameControl.cs:19)

BTW, I'm using NGUI 3.6.6

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization key not found
« Reply #1 on: June 11, 2014, 05:03:30 AM »
There is no such version "3.6.6". The latest is 3.6.3, so I'm going to assume you are on 3.5.6. Please update.

exiin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Localization key not found
« Reply #2 on: June 11, 2014, 05:06:05 AM »
My bad, I'm on the 3.6.3. I just didn't write it well in my previous post

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization key not found
« Reply #3 on: June 11, 2014, 05:57:47 AM »
Well, regarding your code:
  1. Debug.Log ("languages : " + Localization.knownLanguages.ToString ());
You are getting exactly what you're asking. KnownLanguages is an array. Using ToString() on it is not going to give you any meaningful info.

As for the rest... Awake() is the wrong place to do anything other than initialize local script values. Never use Awake() unless you know exactly what it's for. Use Start() instead.

UILocalize should work however. Assuming the chosen language is valid and the Localization.csv is present in the resources folder. Note that if you have your own Localization.csv, you must make sure that you delete NGUI's.

exiin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Localization key not found
« Reply #4 on: June 11, 2014, 03:22:50 PM »
For the "Localization key not found" error when, it's when I add a UILocalize to any labels, it's working correctly but i Still have that error.

I'll try with I2 Localization, to see if i stil have the issue

Thx for the "knownLanguages".