Welcome, Guest
Username: Password: Remember me

TOPIC: "Unable to import file" in v2.8.0 b6

"Unable to import file" in v2.8.0 b6 2 months 1 week ago #2469

  • RoKo0
  • RoKo0's Avatar
  • Offline
  • New Member
  • Posts: 15
  • Karma: 0
I cant import this file (I attached) from the previous to v2.8.0
(Separator: Semicolon)
I get "Unable to import file" message. Please help.

File Attachment:

File Name: tmp.csv
File Size:117 KB


Or just let me know how to fix the bug "filter's textField loses its focus" in the previous version.
Last Edit: 2 months 1 week ago by RoKo0.
The administrator has disabled public write access.

"Unable to import file" in v2.8.0 b6 2 months 6 days ago #2475

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 915
  • Thank you received: 196
  • Karma: 58
Hi,
I checked the csv and the file is not a valid csv file.
Did you edited the file using a Spreadsheet program or did you generated it from I2 Localization?

The problem with the file is that some of the translations that have multiple lines are not surrounded with quotes(").
for example:
EditorTutorial/Build3Step1;Text;;Add new front arms to the top of the car above the bottom arms: Press CTRL + 1 to select the bottom arms.
 Copy these frames ({[[Hotkeys/copy_parts]]}) and paste them to the new place ({[[Hotkeys/paste_parts]]}). Then move the copied frames to the desired position.;Добавьте новые рачаги на верх машины над нижними рычагами: Нажмите CTRL + 1, чтобы выбрать нижние рычаги.
 Скопируйте эти рамы ({[[Hotkeys/copy_parts]]}) и вставьте их на новом месте ({[[Hotkeys/paste_parts]]}). Затем переместите эти рамы в нужную позицию.

instead of
EditorTutorial/Build3Step1;Text;;"Add new front arms to the top of the car above the bottom arms: Press CTRL + 1 to select the bottom arms.
 Copy these frames ({[[Hotkeys/copy_parts]]}) and paste them to the new place ({[[Hotkeys/paste_parts]]}). Then move the copied frames to the desired position.";"Добавьте новые рачаги на верх машины над нижними рычагами: Нажмите CTRL + 1, чтобы выбрать нижние рычаги.
 Скопируйте эти рамы ({[[Hotkeys/copy_parts]]}) и вставьте их на новом месте ({[[Hotkeys/paste_parts]]}). Затем переместите эти рамы в нужную позицию."

I even tried importing the csv file into other Spreadsheet programs like Excel and Google Spreadsheet and they as well were not recognizing those texts as part of the same cell.

I manually corrected those lines and I2 Localization was able to read the file correctly.
Attached is the modified file.

File Attachment:

File Name: tmp_fixed.csv
File Size:117 KB


Can you please let me know if you generated the csv from I2 Localization, I tried exporting the terms, but the csv was generated correctly.
I'm curious about how you got the file!

Hope that helps,
Frank
Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
The administrator has disabled public write access.

"Unable to import file" in v2.8.0 b6 2 months 6 days ago #2482

  • RoKo0
  • RoKo0's Avatar
  • Offline
  • New Member
  • Posts: 15
  • Karma: 0
I used I2 localization v2.7.0 f1 to export this file.
And I found the reason: There were some invisible symbols in the strings.

For this example, I cannot see many strings when I edit the term, but I found invisible symbols:
EditorTutorial/Build3Step1;Text;;Add new front arms to the top of the car above the bottom arms: Press CTRL + 1 to select the bottom arms.
 Copy these frames ({[[Hotkeys/copy_parts]]}) and paste them to the new place ({[[Hotkeys/paste_parts]]}). Then move the copied frames to the desired position.;Добавьте новые рачаги на верх машины над нижними рычагами: Нажмите CTRL + 1, чтобы выбрать нижние рычаги.
 Скопируйте эти рамы ({[[Hotkeys/copy_parts]]}) и вставьте их на новом месте ({[[Hotkeys/paste_parts]]}). Затем переместите эти рамы в нужную позицию.

When I remove these invisible symbols, the file is exported correctly.
The administrator has disabled public write access.

"Unable to import file" in v2.8.0 b6 2 months 5 days ago #2483

  • RoKo0
  • RoKo0's Avatar
  • Offline
  • New Member
  • Posts: 15
  • Karma: 0
Why your RemoveNonASCII() function removes dots from my terms?
I replace it to:
        public static string RemoveNonASCII( string text, bool allowCategory=false )
        {
            if (string.IsNullOrEmpty(text))
                return text;

            if (allowCategory)
                return System.Text.RegularExpressions.Regex.Replace(text, @"[^a-zA-Z0-9\\/_\. ]+", " ");
            return System.Text.RegularExpressions.Regex.Replace(text, @"[^a-zA-Z0-9_\. ]+", " ");
        }
The administrator has disabled public write access.

"Unable to import file" in v2.8.0 b6 2 months 4 days ago #2488

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 915
  • Thank you received: 196
  • Karma: 58
Hi,
The RemoveNonASCII function applied to term's name, was meant to avoid invalid characters (new lines, controls and invisible chars) to get added to the term's name when auto-detecting it from the label's text or when importing from spreadsheets.

However, I agree that the restriction to only include letters, digits and some punctuation signs is very restricted, so I'm changing the function to allow even extended characters (Chinese characters, etc).

The new function is:
        public static string RemoveNonASCII( string text, bool allowCategory=false )
        {
            if (string.IsNullOrEmpty(text))
                return text;

            return new string(text.Select(c => (char.IsControl(c)|| (c=='\\' && !allowCategory)) ? ' ' : c).ToArray());
        }

It has been included in 2.8.0f2 which I will release on Monday to the AssetStore.
Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
The administrator has disabled public write access.
Time to create page: 0.784 seconds
Colors