Author Topic: Localization errors?  (Read 4908 times)

wouter

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 39
    • View Profile
Localization errors?
« on: April 30, 2014, 08:29:38 AM »
Hi Aren,

Love the new updates!
But the localization seems to work differently. I use a cvs file and although it is recognized in unity(auto fill) and it works when I start the scene and use a drop down to do a language selection.
However I get 2 errors (plus 100 warnings localization is not found), this only happens on start:

ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[System.String,System.String[]].Add (System.String key, System.String[] value) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
Localization.AddCSV (.BetterList`1 values) (at Assets/Plugins/Internal/Localization.cs:355)
Localization.LoadCSV (UnityEngine.TextAsset asset) (at Assets/Plugins/Internal/Localization.cs:310)
Localization.set_language (System.String value) (at Assets/Plugins/Internal/Localization.cs:220)
Localization.Awake () (at Assets/Plugins/Internal/Localization.cs:121)

I have a Localization script attached to a gameObject in my scene, I have a UILocalize attached to labels, and a language selection on a drop down box.
The .cvs file is location in the Resources (but I could not add to the Localization script, like I previously did with .txt files?)

What am i doing wrong?? (btw the Localization script is in the Plugins folder..)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization errors?
« Reply #1 on: April 30, 2014, 05:41:08 PM »
Localization script no longer needs to be on any game object. In fact, it's now static, and is no longer a MonoBehaviour.

By CVS I assume you mean CSV. CVS is a versioning system.

Check which key it complains about. Perhaps you have it listed in your localization file twice?

wouter

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 39
    • View Profile
Re: Localization errors?
« Reply #2 on: May 01, 2014, 04:49:07 AM »
Localization script no longer needs to be on any game object. In fact, it's now static, and is no longer a MonoBehaviour.

By CVS I assume you mean CSV. CVS is a versioning system.

Check which key it complains about. Perhaps you have it listed in your localization file twice?

allright, there were indeed double keys, after removing everything works fine.

However, when I save from excel (an .cvs file) I get a null errror from ngui. When I import it into google drive and then export back, this does not happen?
Why is this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization errors?
« Reply #3 on: May 02, 2014, 07:44:01 AM »
Compare the contents of the file -- it's all just plain text, and you will likely see what's different about them.