Author Topic: Few questions about NGUI localization methods  (Read 1910 times)

bac9

  • Full Member
  • ***
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 113
    • View Profile
Few questions about NGUI localization methods
« on: November 25, 2013, 01:19:25 AM »
1. How should I go about rewriting the script to support multiple paragraphs per string properly? Having to use \n every time makes editing of stuff like huge encyclopedia entries quite a pain.

I understand why it's currently not supported: so that first word of the paragraph won't be interpreted as a name of a new string, so apart from adding the recognition of line endings to the script, I'd like to ask how to add safer syntax to the text files - for example, replacing this:

  1. string1 = text1
  2. string2 = text2part1\ntext2part2\ntext2part3

With this:

  1. string1 = "text1";
  2. string2 = "text2part1
  3. text2part2
  4. text2part3";

That, or replacing whole .txt reading with .xml reading where string name would be a name of a certain tag.

2. Is whole range of UTF-8 symbols properly supported (given that the font used in the game to display the game supports it)?

3. Can someone point me to the documentation that covers how can you leave certain assets accessible for editing in a build? I realize it's more of a question for Unity documentation, but I was unable to find anything in Google so I'm probably formulating the question wrong. Essentially: how can you force Unity to leave the .txt files out in the open?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Few questions about NGUI localization methods
« Reply #1 on: November 25, 2013, 03:22:11 AM »
1. I'll likely just add support for CSV file parsing in the future.

2. If you save the text file as UTF-8, yes.

3. What you mean? Which assets? Editing how?

bac9

  • Full Member
  • ***
  • Thank You
  • -Given: 2
  • -Receive: 4
  • Posts: 113
    • View Profile
Re: Few questions about NGUI localization methods
« Reply #2 on: November 26, 2013, 05:48:33 AM »
Great to hear about the CSV support coming.

What I meant in the third question is creating a build where .txt files used by the localization system are not included into the archives or encrypted, and are left out in the open, accessible for editing.

Essentially, instead of using it to embed multiple translations, I'm trying to leverage the localization system to allow text editing without compiling new build. Client complains about some sentence? I change the .txt and all is right again, without bothersome rebuilding. But I don't know how to tell the Localization component to use an external file instead of a text asset that will be hidden in the archive during the build process.

So, for that to work, do I need to alter the localization system script (and if so, what alterations do I need there)? Or maybe, there is simply a way to tell Unity not to pack certain assets (that will solve the issue without the need to change anything in the localization script)?
« Last Edit: November 26, 2013, 05:54:06 AM by bac9 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Few questions about NGUI localization methods
« Reply #3 on: November 26, 2013, 06:22:19 AM »
You can set your own localized dictionary by using Localization.instance.Set, and you can set a text asset using Localization.instance.Load.