Problems with CSV import

More
7 years 7 months ago #389 by Frank
Replied by Frank on topic Problems with CSV import
Duplicated thread,
Check this instead: www.inter-illusion.com/forum/i2-localiza...mport-local-csv-file

Thanks,
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

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

More
1 year 2 weeks ago #4374 by keshav5999
Replied by keshav5999 on topic Problems with CSV import
While importing the spreadsheet from google drive, it takes first column as keys, can i change so that it takes fifth column or any column for the keys?

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

More
1 year 2 weeks ago #4379 by Frank
Replied by Frank on topic Problems with CSV import
Hi,
By default the plugin reads the Key from the first downloaded column. If you need to modify it, you could change the code that searches for that column.

in: Assets/I2/Localization/Scripts/LanguageSource/LanguageSourceData_Import_CSV.cs
function: Import_CSV // this is called from both import CSV and imported from google

these variables define the columns containing the keys, desc and first language:
int LanguagesStartIdx = 1;
int TypeColumnIdx = -1;
int DescColumnIdx = -1;

you will need to comment out the if
if (Tokens.Length>1 && ArrayContains(Tokens[0], ValidColumnName_Key))

which is where those variables are filled out based on the header text, and instead, just manually set the values yourself.
For instance:

int LanguagesStartIdx = 10;
int TypeColumnIdx = 6;
int DescColumnIdx = -1;

Then in line 125 change the Tokens[0] by the column you want.
Like in:
string sKey = string.IsNullOrEmpty(Category) ? Tokens[5] : string.Concat(Category, "/", Tokens[5]);

That will take the column 6 as the key

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 following user(s) said Thank You: keshav5999

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

Time to create page: 0.152 seconds
Template by JoomlaShine