Author Topic: Localization only works with CSV?  (Read 2211 times)

jmansa

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 11
    • View Profile
Localization only works with CSV?
« on: May 29, 2014, 05:55:12 AM »
I am trying to setup Localization in NGUI but am having some issues. I prefer to have my languages in separate files like "English.txt" and "Français.txt". I have taking the NGUI example 10 and tried to replace the CSV file with 2 separate files but with same content, but when doing so the localize component can't find the files?

My files look like this (english):
Language = English
Flag = Flag-US
Info = Localization example
Sound = Sound
Music = Music
Desc = English localization
Paragraph = "This example shows how to implement localization using NGUI. In order to localize a widget, simply attach [000000]UILocalize[-] script to it. The script will localize the sprite if it's a [000000]UISprite[-], or the text if it's a [000000]UILabel[-]. If you want to localize something else, just implement the [000000]OnLocalize[-] function. Either way, the actual data is defined via text assets specified on the [000000]Localization[-] script which must be present in the scene." 


In the comment inside the scripts it says that I just have to place these files inside the "resources" folder and it will be recognized?

Hoping for help in this matter and thanks in advance :-)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization only works with CSV?
« Reply #1 on: May 29, 2014, 08:09:07 AM »
Yes, this would be the old style of doing localization. Don't forget to delete the Localization.txt file, or its contents will be used instead.

Also note that this method won't let you see the list of possible languages anymore. It will only be possible via the new, CSV based approach.

jmansa

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Localization only works with CSV?
« Reply #2 on: May 29, 2014, 08:58:23 AM »
So if I understand your answer correct. It can't be done the old style way? Only with CSV?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization only works with CSV?
« Reply #3 on: May 30, 2014, 01:45:31 PM »
It's capable of loading the localization data from old-style txt files, but as I said there is nowhere to get the list of languages from anymore when using the old style of localization. So if you want it to work as before, don't use the LanguageSelection script on the language selection pop-up list. Use a custom script that already knows what languages are present.