How to 🧐Discover Undocumented Google API Error Codes in Multiple Languages
Google API error messages aren’t always documented across languages, which often leaves developers relying on guesswork or external translation when handling errors for a multi-language audience. Fortunately, there’s a systematic way to collect these undocumented translations directly from Google’s own services.
How Does it Work?
Google Workspace error messages dynamically adapt to your account’s locale. Thus, by intentionally triggering known errors and cycling systematically through Google Workspace Admin SDK language settings, you can capture native translations automatically.
Automated Google Workspace Error Translator Example:
Sample Apps Script code 👉👉👉
/**
* @description Automatically translates Google Apps Script errors
* to every Google-supported language by changing the user's locale.
*
* Core Concept:
* - Trigger an intentional, predictable error (e.g.: hiding all Sheets).
* - Change the Google Workspace user locale (requires Admin SDK).
* - Let Google regenerate errors in translated forms automatically.
* - Repeat every 15 minutes (enough time for locale change).
* - Store each localized error message for later use.
*
* ⚠️ Important:
* Your Google account must be a Google Workspace account (not a free Gmail)
* as Admin SDK locale can’t be programmatically changed in free accounts.
*/
// Simplified error example setup:
const ERROR_SETS = {
error_key: "CANNOT_HIDE_ALL_SHEETS",
func: errorHideLast // User-defined function: triggers a Sheets API predictable error.
};
// A simple trigger function to automate error generation every 15 mins:
function on15Minutes() {
checkErrorCodes_(ERROR_SETS);
}
// Retrieve and save translated error messages:
function read() {
const mem = getMemory_();
const dt = mem.getItems(ERROR_SETS.error_key);
const d = convertToTable(dt); const ss = SpreadsheetApp.openById(SS_ID);
const s = ss.getSheetById(SHEETS_HIDE_ALL[0].id);
s.getRange(1, 1, d.length, d[0].length).setValues(d);
console.log("👍Results pasted successfully", ss.getUrl());
}
Why Bother?
By generating authentic Google error messages programmatically, developers benefit from:
- Reliability: Native translations directly from Google’s own wording and formatting.
- Maintenance: Updates automatically triggered by periodic checks.
- User experience: Clearer instructions and localized error management.
Summary
Google’s loosely documented multilingual API error messages can be systematically captured by leveraging Google Workspace automation. Activate this strategy in your own automations for authentic, reliable translations directly from Google APIs.
Here is the list of errors for the situation when you try to delete all sheets:
{
"Не можна приховати всі аркуші в документі.": {
"langs": ["uk"]
},
"Невозможно скрыть все листы документа.": {
"langs": ["ru"]
},
"No puedes ocultar todas las hojas de un documento.": {
"langs": ["es"]
},
"Ni allwch guddio'r holl ddalenni mewn dogfen.": {
"langs": ["cy"]
},
"በአንድ ሰነድ ውስጥ ሁሉንም ሉሆችን መደበቅ አይችሉም።": {
"langs": ["am"]
},
"لا يمكنك إخفاء كل الأوراق من المستند.": {
"langs": ["ar"]
},
"Ezin dituzu ezkutatu dokumentuko orri guztiak.": {
"langs": ["eu"]
},
"আপনি কোনও ডকুমেন্টের সব শিট লুকাতে পারবেন না।": {
"langs": ["bn"]
},
"You can't hide all the sheets in a document.": {
"langs": ["en-GB","en","chr"]
},
"Não é possível ocultar todas as páginas de um documento.": {
"langs": ["pt-BR"]
},
"Не можете да скриете всички листове в документ.": {
"langs": ["bg"]
},
"No pots amagar tots els fulls d'un document.": {
"langs": ["ca"]
},
"Ne možete sakriti sve listove u dokumentu.": {
"langs": ["hr"]
},
"Není možné skrýt všechny listy v dokumentu.": {
"langs": ["cs"]
},
"Du kan ikke skjule alle regnearkene i et dokument.": {
"langs": ["no"]
},
"Je kunt niet alle bladen in een document verbergen.": {
"langs": ["nl"]
},
"Dokumendi kõiki lehti ei saa peita.": {
"langs": ["et"]
},
"Hindi mo puwedeng itago ang lahat ng sheet sa dokumento.": {
"langs": ["fil"]
},
"Et voi piilottaa kaikkia dokumentin taulukoita.": {
"langs": ["fi"]
},
"Vous ne pouvez pas masquer toutes les feuilles d'un document.": {
"langs": ["fr"]
},
"Sie können nicht alle Tabellenblätter eines Dokuments ausblenden.": {
"langs": ["de"]
},
"Δεν μπορείτε να αποκρύψετε όλα τα φύλλα σε ένα έγγραφο.": {
"langs": ["el"]
},
"તમે દસ્તાવેજમાંની બધી શીટ છુપાવી શકતા નથી.": {
"langs": ["gu"]
},
"לא ניתן להסתיר את כל הגיליונות במסמך.": {
"langs": ["iw"]
},
"आप किसी दस्तावेज़ में मौजूद सभी शीट को नहीं छिपा सकते.": {
"langs": ["hi"]
},
"Nem rejtheti el egy dokumentum összes munkalapját.": {
"langs": ["hu"]
},
"Ekki er hægt að fela öll blöð í skjali.": {
"langs": ["is"]
},
"Anda tidak dapat menyembunyikan semua sheet dalam dokumen.": {
"langs": ["id"]
},
"Non puoi nascondere tutti i fogli di un documento.": {
"langs": ["it"]
},
"スプレッドシート内のシートをすべて非表示にすることはできません。": {
"langs": ["ja"]
},
"ಡಾಕ್ಯುಮೆಂಟ್ನಲ್ಲಿರುವ ಎಲ್ಲಾ ಶೀಟ್ಗಳನ್ನು ನೀವು ಮರೆಮಾಡಲು ಸಾಧ್ಯವಿಲ್ಲ.": {
"langs": ["kn"]
},
"문서의 모든 시트를 숨길 수 없습니다.": {
"langs": ["ko"]
},
"Jūs nevarat paslēpt visas dokumenta lapas.": {
"langs": ["lv"]
},
"Negalite paslėpti visų lapų dokumente.": {
"langs": ["lt"]
},
"Anda tidak boleh menyembunyikan semua helaian dalam dokumen.": {
"langs": ["ms"]
},
"ഒരു ഡോക്യുമെന്റിലെ എല്ലാ ഷീറ്റുകളും നിങ്ങൾക്ക് മറയ്ക്കാനാകില്ല.": {
"langs": ["ml"]
},
"तुम्ही दस्तऐवजातील सर्व पत्रके लपवू शकत नाही.": {
"langs": ["mr"]
},
"Du kan ikke skjule alle arkene i et dokument.": {
"langs": ["da"]
},
"Nie możesz ukryć wszystkich arkuszy w dokumencie.": {
"langs": ["pl"]
},
"Não é possível ocultar todas as páginas num documento.": {
"langs": ["pt-PT"]
},
"Nu poți ascunde toate foile dintr-un document.": {
"langs": ["ro"]
},
"Не можете да сакријете све табеле у документу.": {
"langs": ["sr"]
},
"您无法隐藏文档中的所有工作表。": {
"langs": ["zh-CN"]
},
"Nemôžete skryť všetky hárky v dokumente.": {
"langs": ["sk"]
},
"Vseh listov v dokumentu ni mogoče skriti.": {
"langs": ["sl"]
},
"Huwezi kuficha laha zote katika hati.": {
"langs": ["sw"]
},
"Du kan inte dölja alla arbetsblad i ett dokument.": {
"langs": ["sv"]
},
"ஆவணத்தில் உள்ள தாள்கள் அனைத்தையும் மறைக்க முடியாது.": {
"langs": ["ta"]
},
"మీరు డాక్యుమెంట్లోని అన్ని షీట్లను దాచలేరు.": {
"langs": ["te"]
},
"ไม่สามารถซ่อนชีตทั้งหมดในเอกสารได้": {
"langs": ["th"]
},
"你無法隱藏文件中的所有工作表。": {
"langs": ["zh-TW"]
},
"Bir dokümandaki tüm sayfaları gizleyemezsiniz.": {
"langs": ["tr"]
},
"آپ کسی دستاویز میں موجود سبھی شیٹس کو نہیں چھپا سکتے ہیں۔": {
"langs": ["ur"]
},
"Bạn không thể ẩn tất cả trang tính trong một tài liệu.": {
"langs": ["vi"]
}
}
For some reason, Google did not translate the error to chr
— Cherokee. I guess that this language support appeared later, and they missed it here.
Related posts
I’ve used these techniques to help me collect errors:
Changing language with Apps Script:
Collecting items with Apps Script Storage: