I am developing a data processing app using Google Sheets and its API as backend .
In that I will upload all datas as arrays with GOOGLETRANSLATE via batchUpdate API like below
[hello_word,"Hello World",=GOOGLETRANSLATE("Hello World","en","es"),=GOOGLETRANSLATE("Hello World","en","fr"),=GOOGLETRANSLATE("Hello World","en","ar")][good_morning,"Good morning ",=GOOGLETRANSLATE("Good morning ","en","es"),=GOOGLETRANSLATE("Good morning ","en","fr"),=GOOGLETRANSLATE("Good morning ","en","ar")]// 1000 keys ....Now my problem is ,
Since there are more than 3000 cells to be translated , it take some time .
Meanwhile , the cells showing "Loading..." message until translations finished
Now my need is , I need some ways to find whether all of 3000+ cells are translated from outside , that is something like , executing a script in Google Sheet(stored in apps script) from a REST API such as Google Sheets API .
What I tried
First I search Stackoverflow and got a script and executed it manually in console with some success.
function searchText() { var findText = "Loading...";var sheet = SpreadsheetApp.getActiveSpreadsheet();var CurrSheet = sheet.getSheetByName('strings');var SHTvalues = CurrSheet.createTextFinder(findText).findAll();var result = SHTvalues.map(r => ({row: r.getRow(), col: r.getColumn()}));//Logger.log(result);if (result.length > 0) { Logger.log('still trlansating ');}else Logger.log('translated ');}The above script works good , but there is a catch.
I am using the search word as 'Loading...'to find in progress cells and it's working
But if any cell contains a user data exactly as 'Loading...', then I am getting false positives !!! , that is translating still in progress !!
(is there is any way to show some custom message until a formula executed ??)
So I also need a permanent solution to know the status for formulas from an external end ?
Please guide me