Keep Spreadsheet cell color

More
8 years 11 months ago #1216 by r.pedra
Hi,
Is it possible in any way(maybe with the web service you provide), to keep the color in the cells of the Google Spreadsheet?
We are working with a professional translator and he is using cell background color to say if a term is translated or not.
The problem is that when we export the file from Unity to Drive using your "Merge" button, all the colors in cells are erased.

Do you have a solution for this?

Thank you

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

More
8 years 10 months ago #1217 by Frank
Replied by Frank on topic Keep Spreadsheet cell color
Hi,

We are working with a professional translator and he is using cell background color to say if a term is translated or not.


The plugin does that already for you.
When the terms are translated by using the Translate and TranslateAll buttons, they are flagged as Auto Translated.

Terms with that flag show different in the Unity (they show a button next to them to allow translators verify it and approve them if they are correct).

Also, when they are imported into Google Spreadsheets, instead of just setting the translations, they are set by using the GOOGLETRANSLATE formulae.
That way, any modification to the other columns will update the translation. Also those cells are highlighted with a different color to identify them.



More info about Auto Translation:
Auto Translation documentation

Is it possible in any way(maybe with the web service you provide), to keep the color in the cells of the Google Spreadsheet?


If the highlight the plugin applies its not enough and the translator wants to apply different color schemes or set a different visual, then you will need to modify the WebService to disable settings the spreadsheet colors:

You can do that by opening the WebService in google drive and do the following modifications:

In file ImportCSV.gs line 127 comment out the "SetupSheetFormat( sheet, range );" line
  range.setValues(rangeData);
  range.setNotes(notes);
  
//  SetupSheetFormat( sheet, range );
  SetupAutoTranslated( range, rangeData, languages, csv );
}
then, in function SetupAutoTranslated, comment out the lines modifying the background colors:
function SetupAutoTranslated( range, values, languages, csv )
{
//  var backgrounds = range.getBackgrounds();
  for (var r=1; r<values.length; ++r)
  for (var c=1; c<values[r].length; ++c)
      if (values[r][c]==="" && (csv[r][1]=="" || csv[r][1]=="Text"))
      {
        SetAutoTranslateCell(values, r, c, languages);
//        backgrounds[r][c] = "#f0f0f0";
      }
//  range.setBackgrounds( backgrounds );
  range.setValues( values );
}


Then, you will need to save the file, and deploy the plugin again by following the steps to create a new version and deploy it:

1- On the menu, select "Publish" and then "Deploy as web app"

2- In the window that opens
- Project Version: select "New"
- In "Execute app as:" select "me(your email)"
- In "Who has access to the app:" select "any one, even anonymous"

and that's it, no need to copy the url back to unity as that doesn't change.


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: r.pedra

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

More
8 years 10 months ago #1222 by r.pedra
Replied by r.pedra on topic Keep Spreadsheet cell color
Thank you, that's what I ended doing but I was not familiar with Google Script so it took me some time.

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

Time to create page: 0.191 seconds
Template by JoomlaShine