Add translations of "Allow access to file URLs"

The JSON file is generated as follows.

1. Go to the src/chrome/app/resources directory of Chromium's source.

2. Find the translation ID of the "Allow access to file URLs" string:

grep 'Allow access to file URLs' generated_resources_en-GB.xtb

3. With the ID that you've found, locate the other translations.

grep 3341703758641437857 generated_resources_*.xtb

4. If the result looks OK, serialize the result as JSON and save it.

> path/to/pdf.js/web/chrome-i18n-allow-access-to-file-urls.json \
python -c "import json;print(json.dumps({ \
$(grep 3341703758641437857 generated_resources_*.xtb | \
 sed "s@generated_resources_\([^.]\+\)\.xtb:<translation[^>]\+>\(.\+\)</translation>@'\1':'''\2''',@" \
)}, sort_keys=True, indent=2))"

(Strings are taken from Chromium 45.0.2448.0 (ccrev.com/337313).
This commit is contained in:
Rob Wu 2015-07-18 18:26:04 +02:00
parent 775d4e69cf
commit cf1d398bd2
3 changed files with 69 additions and 1 deletions

View file

@ -181,6 +181,18 @@ var ChromeCom = (function ChromeComClosure() {
document.getElementById('chrome-pdfjs-logo-bg').style.backgroundImage =
'url(' + chrome.runtime.getURL(iconPath) + ')';
// Use Chrome's definition of UI language instead of PDF.js's #lang=...,
// because the shown string should match the UI at chrome://extensions.
// These strings are from chrome/app/resources/generated_resources_*.xtb.
var i18nFileAccessLabel =
//#include chrome-i18n-allow-access-to-file-urls.json
[chrome.i18n.getUILanguage && chrome.i18n.getUILanguage()];
if (i18nFileAccessLabel) {
document.getElementById('chrome-file-access-label').textContent =
i18nFileAccessLabel;
}
var link = document.getElementById('chrome-link-to-extensions-page');
link.href = 'chrome://extensions/?id=' + chrome.runtime.id;
link.onclick = function(e) {