Localizing a Google Chrome Web App
问题 I'm trying to add localization support to a Google Chrome Web App and, while it is easy to define strings for manifest and CSS files, it is somewhat more difficult for HTML pages. In the manifest and in CSS files I can simply define localization strings like so: __MSG_name__ but this doesn't work with HTML pages. I can make a JavaScript function to fire onload that does the job like so: document.title = chrome.i18n.getMessage("name"); document.querySelector("span.name").innerHTML = chrome