Author Topic: The problem with Localization  (Read 3728 times)

outgoing

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
The problem with Localization
« on: July 14, 2014, 05:51:18 AM »
Good day
What could be the problem when I read the entry from the file "csv" and the records are present signs newline "enter" in units text is clipped at the beginning of a few characters.
How to solve this problem? To create a file using the Google file

What file---->>
The total area of ​​the project planning area of 6.3 hectares.

Zone area of 3.5 hectares.
Ridership 3.0 thousand rush hour.

What happens ---->>>
 total area of ​​the project planning area of 6.3 hectares.

Zone area of 3.5 hectares.
Ridership 3.0 thousand rush hour.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: The problem with Localization
« Reply #1 on: July 15, 2014, 12:19:46 AM »
Can you post the actual data from the exported CSV?

outgoing

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: The problem with Localization
« Reply #2 on: July 15, 2014, 05:09:40 AM »
Uploading through script

public class DownloadLocalizationCSV : MonoBehaviour
{
    public string LanguageFile = "Language";
    public string LanguageDefault = "Russian";
   
    private void Awake()
    {
        Localization.LoadCSV(Resources.Load<TextAsset>(LanguageFile));
        Localization.language = LanguageDefault;
    }
}

File "cvs" in Attach.
Regularities of one character and a newline character is minus one at the beginning

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: The problem with Localization
« Reply #3 on: July 15, 2014, 08:43:55 PM »
Well first, the language file should be named "Localization.csv" (or .txt), not "Language.csv", and it will be picked up by NGUI automatically. No need for your script.

Second, your strings are not quite right...  why do you have a space after every comma? That space will show up in your content.

Now onto your actual problem... open up ByteReader.cs, and comment out line 220:
  1.                         if (insideQuotes)
  2.                         {
  3.                                 string s = ReadLine(false);
  4.                                 if (s == null) return null;
  5.                                 s = s.Replace("\\n", "\n");
  6.                                 line += "\n" + s;
  7.                                 //++wordStart; // <-- this right here
  8.                         }

outgoing

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: The problem with Localization
« Reply #4 on: July 16, 2014, 04:16:51 AM »
Thank you very much, helped  :)