"Unable to import file" in v2.8.0 b6

More
7 years 2 months ago - 7 years 2 months ago #2469 by RoKo0
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.
Attachments:
Last edit: 7 years 2 months ago by RoKo0.

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #2475 by Frank
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
Attachments:

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #2482 by RoKo0
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.

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #2483 by RoKo0
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_\. ]+", " ");
        }

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #2488 by Frank
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

Please Log in or Create an account to join the conversation.

Time to create page: 0.204 seconds
Template by JoomlaShine