- Prepare a copy of the code in the localized-message.js, setting
MESSAGESto suit your needs. - To call a message,
// Get user locale
var locale = Session.getActiveUserLocale();or alternatively, if you are creating a script bound to a Google Docs file (e.g., a Google Sheets file),
var locale = SpreadsheetApp.getActiveSpreadsheet().getSpreadsheetLocale();Then create an object of the message in that locale
var localizedMessages = new LocalizedMessage(locale);When calling a message,
console.log(localizedMessages.messageList.{{messageName}})