Author Topic: Localization system  (Read 91833 times)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization system
« Reply #30 on: May 06, 2014, 12:04:31 AM »
What does the contents of your localization file look like?

AniOSGeek

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: Localization system
« Reply #31 on: May 07, 2014, 05:47:34 AM »
I have developed a simulation game with all menus done on NGUI(2.3.3). Now i want to localize my game in Turkish language. I have use location Object on my scene and loading string values(label text) from strings file(Turkish.txt).
Its loading right words but few words are missing on text for example Coin Alýn is showing like Coin Aln and Çöl Sürüþü is showing just lSr. So its missing every character with some symbols on it.
Can someone help me how can i get it working fine.
I am using dynamic fonts(BebasNeueregualr).   
Thanks

vallcrist

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 49
    • View Profile
Re: Localization system
« Reply #32 on: May 07, 2014, 08:36:23 AM »
Hello Michael,

Is there a way to load the localization file dynamically, e.g. from the internet at runtime? We would like to be able to change the localization values and add some dynamic content to them withuot having to make a new build everytime. :T

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization system
« Reply #33 on: May 08, 2014, 03:22:29 AM »
@AniOSGeek: I can't help you much with such an old version of NGUI, and NGUI 2 is no longer supported at all. However there are two causes of that. First -- your file is not saved as UTF-8. Second -- your font doesn't have the necessary glyphs to render those special characters.

@vallcrist: Of course. Localization.LoadCSV(textAsset) for a CSV dictionary or Localization.Load(textAsset) for a single file.

Spirit117

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Localization system
« Reply #34 on: June 03, 2014, 07:48:42 AM »
Hello!

I've been at this for a few hours, and I need a hand.

I've made the csv (see attached), and I've created a folder in assets called resources, and I've put the csv in there, and I've tried using the localization prefab object and creating an array of one on it and dragging the file in there (and I've also tried not using the localization prefab object). No matter how I do it:

the UILocalize does not auto-suggest the keys that I've written
Nothing is changed or displayed when I run the game and I get
"Localization key not found - "blah blah""

What am I doing wrong?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization system
« Reply #35 on: June 04, 2014, 02:02:38 AM »
Did you delete the Localization.csv file that comes with NGUI? If you didn't, it won't be clear which one will be loaded.

I'm also not clear on what you mean by "localization prefab". Localization is a static class. You can't put it on a game object. If you can, then you are using an old version of NGUI and need to update.

sinok426

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
    • sinok426
Re: Localization system
« Reply #36 on: June 26, 2014, 03:54:50 AM »
Hello!

I have the same problem with Localization, it doesn't work any more.

The first time I try to use it with the example scene, it works perfectly, so I've replaced the Localization.txt file by a custom Localization.csv file to try the csv, and it also works. Great!
But after moving the csv file in my Assets/Resources folder (and deleting the old one in NGUI examples folder), Localization was broken. It looks like it only reads the first line (KEY,English,Français, etc...), all the other keys are not found (in inspector preview and at runtime).

No idea of what happens, I was a bit lost, so I decided to delete NGUI plugin and reimport the same version of NGUI. But it did'nt solve the problem, the Localization doesn't work even in the example scene.

I'm using NGUI 3.5.9 & Unity 4.3.2

Any ideas of what is the problem ?


keop

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: Localization system
« Reply #37 on: June 26, 2014, 09:11:47 AM »
Hi,

I was reading this thread today because of the very same problem.
Now I solved it, first I had to remove the Localization.txt file inside Assets/NGUI/Resources folder, second I created a Resources folder inside Resources folder (yeah, it sounds weird, but it works) and created a Localization.txt file there (Assets/Resources/Resources/Localization.txt).
For some reason, it doesn't work at Asset/Resources/Localization.txt path, maybe a bug?

Hope it helps.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization system
« Reply #38 on: June 26, 2014, 11:41:54 AM »
All NGUI does is calls Resources.Load("Localization") on line 118 of Localization.cs. This will work as long as you only have one file called Localization.

If the inspector preview is not able to read the Localization file beyond the first line, then I suggest checking your file's line endings.

sinok426

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
    • sinok426
Re: Localization system
« Reply #39 on: June 26, 2014, 12:30:02 PM »
Thanks for the answers!

The Resources loading for the Localization file is working, no problem with this.
When I change the first line by adding new languages, it shows me all the languages in the UI popup list when I play the example scene, but all the other keys (Flag,Sound,etc...) are not found even with the original Localization.txt file that goes with NGUI (so it's not a problem with this file also).

It looks like i've broken something but I can't see what... I've only one Localization file in my project, and a freshly imported NGUI version without any modifications.
I think my last chance is to try an update of unity and NGUI  :-\
« Last Edit: June 26, 2014, 03:47:31 PM by sinok426 »

keop

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: Localization system
« Reply #40 on: June 27, 2014, 02:47:49 AM »
When I make changes in the Localization.txt file, I have to run the player and then stop it to refresh the new localization content.
Maybe it helps you.

sinok426

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
    • sinok426
Re: Localization system
« Reply #41 on: June 27, 2014, 07:53:36 AM »
So, I find a way to solve the problem  ;D
It had nothing to do with NGUI, the problem was my unity project that was "corrupted".

The only thing I had to do was to replace my old ProjectSettings.asset file in the ProjectSettings folder by a standard one(from a blank project).
But I can't explain why the only thing that did'nt work in my project was the NGUI localization. Solved!

pretender

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 155
    • View Profile
Re: Localization system
« Reply #42 on: September 23, 2014, 04:32:48 AM »
Hi Aren!

Can you tell me whats wrong with this localization file?

  1. KEY,English,Spain
  2. ID_HELP,"Help","Ayuda"
  3. ID_SETTINGS,"Settings","Ajustes"

File is utf8, I have Label with UILocalize script and key set to ID_HELP
I also have pop up list that has LanguageSelection script on it

In run time i get this warning: "Localization key not found: 'ID_HELP'"
Also pop up list doesn't display available languages
I tried to place Localization.csv to Assets/Resources and as well in the NGUI Examples/Resources folder where original Localization.csv was (until I deleted it)

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization system
« Reply #43 on: September 23, 2014, 12:49:18 PM »
Nothing is wrong with the localization file. Change the extension to TXT rather than CSV just to be safe, and double-check to make sure you don't have any other Localization.txt files anywhere else. I know you said you deleted it, but that's the #1 reason for it. When in doubt, loop through the keys in the localization file to see what it's loading.

pretender

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 155
    • View Profile
Re: Localization system
« Reply #44 on: October 04, 2014, 03:58:10 AM »
Is it possible to use multiple localization files?