diff options
author | cira@chromium.org <cira@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-19 22:54:53 +0000 |
---|---|---|
committer | cira@chromium.org <cira@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-19 22:54:53 +0000 |
commit | e6145324931ec430ea217b1fc68697194028c58c (patch) | |
tree | 7dec715bc9a16b836ccdfee40b8d03d780037dce /chrome | |
parent | 5b5945635bcd8f0b3b57a5c4d0e4273f53d48451 (diff) | |
download | chromium_src-e6145324931ec430ea217b1fc68697194028c58c.zip chromium_src-e6145324931ec430ea217b1fc68697194028c58c.tar.gz chromium_src-e6145324931ec430ea217b1fc68697194028c58c.tar.bz2 |
Modifying three main samples of docs (gmail checker, news feed, subscribe to feed) to i18n versions. Only "news feed" is saved as a separate version to keep the non-i18n one.
Landing it on behalf of ernestd(at)google.com
TBR=finnur
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36565 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
13 files changed, 286 insertions, 20 deletions
diff --git a/chrome/common/extensions/docs/examples/extensions/gmail/_locales/en/messages.json b/chrome/common/extensions/docs/examples/extensions/gmail/_locales/en/messages.json new file mode 100644 index 0000000..4dfd2de --- /dev/null +++ b/chrome/common/extensions/docs/examples/extensions/gmail/_locales/en/messages.json @@ -0,0 +1,36 @@ +{ + "name": { + "message": "$Google$ Mail Checker", + "description": "Extension name in manifest.", + "placeholders": { + "google": { + "content": "Google", + "example": "Google" + } + } + }, + "description": { + "message": "Displays the number of unread messages in your $Google$ Mail inbox. You can also click the button to open your inbox.", + "description": "Extension description in manifest.", + "placeholders": { + "google": { + "content": "Google", + "example": "Google" + } + } + }, + "node_error": { + "message": "Error: feed retrieved, but no <fullcount> node found", + "description": "Missing node error." + }, + "exception": { + "message": "exception: $exception$", + "description": "Exception message.", + "placeholders": { + "exception": { + "content": "$1", + "example": "xhr object error." + } + } + } +} diff --git a/chrome/common/extensions/docs/examples/extensions/gmail/_locales/es/messages.json b/chrome/common/extensions/docs/examples/extensions/gmail/_locales/es/messages.json new file mode 100644 index 0000000..87674fe --- /dev/null +++ b/chrome/common/extensions/docs/examples/extensions/gmail/_locales/es/messages.json @@ -0,0 +1,36 @@ +{ + "name": { + "message": "$Google$ Mail Checker", + "description": "Nombre de la extensión en el manifiesto.", + "placeholders": { + "google": { + "content": "Google", + "example": "Google" + } + } + }, + "description": { + "message": "Muestra el número de mensajes sin leer en tu bandeja de entrada de $Google$ Mail. También se puede acceder directamente a tu bandeja de entrada pulsando el botón.", + "description": "Descripción de la extensión en el manifiesto.", + "placeholders": { + "google": { + "content": "Google", + "example": "Google" + } + } + }, + "node_error": { + "message": "Error: feed capturado, pero no se puede hallar el nodo <fullcount>", + "description": "Error de nodo no encontrado." + }, + "exception": { + "message": "excepción: $exception$", + "description": "Mensaje de la excepción.", + "placeholders": { + "exception": { + "content": "$1", + "example": "Error en el objecto xhr." + } + } + } +} diff --git a/chrome/common/extensions/docs/examples/extensions/gmail/background.html b/chrome/common/extensions/docs/examples/extensions/gmail/background.html index 0a0563f..7f2b25f 100644 --- a/chrome/common/extensions/docs/examples/extensions/gmail/background.html +++ b/chrome/common/extensions/docs/examples/extensions/gmail/background.html @@ -163,8 +163,7 @@ function getInboxCount(onSuccess, onError) { handleSuccess(fullCountNode.textContent); return; } else { - console.error("Error: feed retrieved, but no <fullcount> node " + - "found"); + console.error(chrome.i18n.getMessage("node_error")); } } @@ -178,7 +177,7 @@ function getInboxCount(onSuccess, onError) { xhr.open("GET", getFeedUrl(), true); xhr.send(null); } catch(e) { - console.error("exception: " + e); + console.error(chrome.i18n.getMessage("exception", e)); handleError(); } } diff --git a/chrome/common/extensions/docs/examples/extensions/gmail/manifest.json b/chrome/common/extensions/docs/examples/extensions/gmail/manifest.json index 96a7588..90101314 100644 --- a/chrome/common/extensions/docs/examples/extensions/gmail/manifest.json +++ b/chrome/common/extensions/docs/examples/extensions/gmail/manifest.json @@ -1,6 +1,6 @@ { - "name": "Google Mail Checker", - "description": "Displays the number of unread messages in your Google Mail inbox. You can also click the button to open your inbox.", + "name": "__MSG_name__", + "description": "__MSG_description__", "version": "3", "background_page": "background.html", "options_page": "options.html", @@ -8,9 +8,10 @@ "tabs", "http://*.google.com/", "https://*.google.com/" ], "browser_action": { - "default_title": "" + "default_title": "" }, "icons": { "128": "icon_128.png" - } + }, + "default_locale": "en" } diff --git a/chrome/common/extensions/docs/examples/extensions/news_i18n/_locales/en/messages.json b/chrome/common/extensions/docs/examples/extensions/news_i18n/_locales/en/messages.json index 0288725..9f5ea5d 100644 --- a/chrome/common/extensions/docs/examples/extensions/news_i18n/_locales/en/messages.json +++ b/chrome/common/extensions/docs/examples/extensions/news_i18n/_locales/en/messages.json @@ -54,6 +54,10 @@ "example": "Google" } } + }, + "newsUrl": { + "message": "http://news.google.com", + "description": "Url to Google News." } } diff --git a/chrome/common/extensions/docs/examples/extensions/news_i18n/_locales/es/messages.json b/chrome/common/extensions/docs/examples/extensions/news_i18n/_locales/es/messages.json new file mode 100644 index 0000000..2093149 --- /dev/null +++ b/chrome/common/extensions/docs/examples/extensions/news_i18n/_locales/es/messages.json @@ -0,0 +1,63 @@ +{ + "name": { + "message": "Lector de noticias", + "description": "Nombre de la extensión en el manifiesto." + }, + "description": { + "message": "Muestra los primeros 5 eventos de '$Google$ noticias - destacados' RSS feed en una ventana.", + "description": "Descripción de la extensión en el manifiesto.", + "placeholders": { + "google": { + "content": "Google", + "example": "Google" + } + } + }, + "default_title": { + "message": "$Google$ noticias", + "description": "Texto de la accion de menú de la extension en el manifiesto.", + "placeholders": { + "google": { + "content": "Google", + "example": "Google" + } + } + }, + "unknown_title": { + "message": "Título desconocido", + "description": "Noticia con título desconocido." + }, + "error": { + "message": "Error: $error$", + "description": "Plantilla de error genérico. Hace falta pasar un parámetro de error.", + "placeholders": { + "error": { + "content": "$1", + "example": "Fallo al capturar el RSS feed." + } + } + }, + "failed_to_fetch_rss": { + "message": "Fallo al capturar el RSS feed.", + "description": "Mensaje de error visible para el usuario." + }, + "not_a_valid_feed": { + "message": "Feed no válido.", + "description": "Mensaje de error visible para el usuario." + }, + "more_stories": { + "message": "Ir a $Google$ noticias \u00BB", + "description": "Nombre del enlace a Google noticias.", + "placeholders": { + "google": { + "content": "Google", + "example": "Google" + } + } + }, + "newsUrl": { + "message": "http://news.google.es", + "description": "Dirección de Google News." + } +} + diff --git a/chrome/common/extensions/docs/examples/extensions/news_i18n/feed.html b/chrome/common/extensions/docs/examples/extensions/news_i18n/feed.html index 4d7ca01..902b0de 100644 --- a/chrome/common/extensions/docs/examples/extensions/news_i18n/feed.html +++ b/chrome/common/extensions/docs/examples/extensions/news_i18n/feed.html @@ -102,7 +102,7 @@ function messageHandler(event) { </script> <script> // Feed URL. -var feedUrl = 'http://news.google.com/?output=rss'; +var feedUrl = chrome.i18n.getMessage('newsUrl') + '/?output=rss'; // The XMLHttpRequest object that tries to load and parse the feed. var req; @@ -280,7 +280,7 @@ function iframeMessageHandler(e) { iframes[i].style.height = msg.size + "px"; } else if (msg.type == "show") { var url = msg.url; - if (url.indexOf("http://news.google.com") == 0) { + if (url.indexOf(chrome.i18n.getMessage('newsUrl')) == 0) { // If the URL is a redirect URL, strip of the destination and go to // that directly. This is necessary because the Google news // redirector blocks use of the redirects in this case. diff --git a/chrome/common/extensions/docs/examples/extensions/news_i18n/manifest.json b/chrome/common/extensions/docs/examples/extensions/news_i18n/manifest.json index 681d6ef..3b60601 100644 --- a/chrome/common/extensions/docs/examples/extensions/news_i18n/manifest.json +++ b/chrome/common/extensions/docs/examples/extensions/news_i18n/manifest.json @@ -10,7 +10,8 @@ }, "permissions": [ "tabs", - "http://news.google.com/*" + "http://news.google.com/*", + "http://news.google.es/*" ], "default_locale": "en" } diff --git a/chrome/test/data/extensions/subscribe_page_action/_locales/en/messages.json b/chrome/test/data/extensions/subscribe_page_action/_locales/en/messages.json new file mode 100644 index 0000000..47d4d15 --- /dev/null +++ b/chrome/test/data/extensions/subscribe_page_action/_locales/en/messages.json @@ -0,0 +1,62 @@ +{ + "name": { + "message": "RSS Subscription Extension (by Google)", + "description": "Extension name in manifest." + }, + "description": { + "message": "Adds one-click subscription to your toolbar.", + "description": "Extension description in manifest." + }, + "default_title": { + "message": "Subscribe to this feed", + "description": "Extension browser action tooltip text in manifest." + }, + "action_title": { + "message": "Click to subscribe...", + "description": "Extension browser action tooltip text." + }, + "unknown_feed_name": { + "message": "Unknown feed name", + "description": "Error message for unknown name." + }, + "manage_option": { + "message": "Manage...", + "description": "The Manage label in the feed reader drop down." + }, + "feed_for": { + "message": "Feed for $feed$", + "description": "The label showing the feed name.", + "placeholders": { + "feed": { + "content": "$1", + "example": "cnn.com" + } + } + }, + "error_fetching": { + "message": "Error fetching feed", + "description": "The error shown when feed fetching fails." + }, + "not_valid_feed": { + "message": "Not a valid feed.", + "description": "The error shown when validation of the feed fails." + }, + "no_entries": { + "message": "This feed contains no entries.", + "description": "The error shown when the feed is empty." + }, + "one_entry_required": { + "message": "There must be at least one entry in this list", + "description": "The error shown when trying to remove the last item in the list." + }, + "remove_confirmation": { + "message": "Are you sure you want to remove $feed$", + "description": "Confirmation message before removing a feed reader from the list.", + "placeholders": { + "feed": { + "content": "$1", + "example": "Google Reader." + } + } + } +} diff --git a/chrome/test/data/extensions/subscribe_page_action/_locales/es/messages.json b/chrome/test/data/extensions/subscribe_page_action/_locales/es/messages.json new file mode 100644 index 0000000..d72e248 --- /dev/null +++ b/chrome/test/data/extensions/subscribe_page_action/_locales/es/messages.json @@ -0,0 +1,62 @@ +{ + "name": { + "message": "Extensión de subscripción RSS (de Google)", + "description": "Nombre de la extensión en el manifiesto." + }, + "description": { + "message": "Añade subscripciones en la barra del navegador en un clic.", + "description": "Descripción de la extensión en el manifiesto." + }, + "default_title": { + "message": "SubscrÃbete a este feed", + "description": "Texto de la acción de menú de la extension en el manifiesto." + }, + "action_title": { + "message": "Pulsa aqui para subscribirte...", + "description": "Texto de la acción de menú de la extensión." + }, + "unknown_feed_name": { + "message": "Nombre del feed desconocideo", + "description": "Mensaje de error para nombre desconocido." + }, + "manage_option": { + "message": "Administrar...", + "description": "Valor para la opción por defecto del menú." + }, + "feed_for": { + "message": "Feed para $feed$", + "description": "Mensaje en la etiqueta.", + "placeholders": { + "feed": { + "content": "$1", + "example": "cnn.com" + } + } + }, + "error_fetching": { + "message": "Error al capturar el feed", + "description": "Mensaje de error en la captura del feed." + }, + "not_valid_feed": { + "message": "Feed no válido.", + "description": "Mensaje de error después de verificación." + }, + "no_entries": { + "message": "Este Feed no contiene ninguna entrada.", + "description": "Mensaje de error para un feed vacio." + }, + "one_entry_required": { + "message": "Tiene que haber como mÃnimo una entrada en la lista.", + "description": "Mensaje de error si no hay entradas." + }, + "remove_confirmation": { + "message": "Estas seguro que quieras eliminar $feed$", + "description": "Mensaje de confirmación antes de eliminar.", + "placeholders": { + "feed": { + "content": "$1", + "example": "Google Reader." + } + } + } +} diff --git a/chrome/test/data/extensions/subscribe_page_action/background.html b/chrome/test/data/extensions/subscribe_page_action/background.html index c97d48f..cb20089 100644 --- a/chrome/test/data/extensions/subscribe_page_action/background.html +++ b/chrome/test/data/extensions/subscribe_page_action/background.html @@ -17,7 +17,7 @@ // Enable the page action icon. feedData[sender.tab.id] = request.feeds; chrome.pageAction.setTitle({ tabId: sender.tab.id, - title: "Click to subscribe..." + title: chrome.i18n.getMessage("action_title") }); chrome.pageAction.show(sender.tab.id); } diff --git a/chrome/test/data/extensions/subscribe_page_action/manifest.json b/chrome/test/data/extensions/subscribe_page_action/manifest.json index be13375..c333dee 100644 --- a/chrome/test/data/extensions/subscribe_page_action/manifest.json +++ b/chrome/test/data/extensions/subscribe_page_action/manifest.json @@ -1,6 +1,7 @@ { - "name": "RSS Subscription Extension (by Google)", - "description": "Adds one-click subscription to your toolbar.", + "name": "__MSG_name__", + "description": "__MSG_description__", + "default_locale": "en", "version": "1.9.1", "permissions": [ "tabs", @@ -17,7 +18,7 @@ ], "icons": { "128": "feed-icon-128x128.png" }, "page_action": { - "default_title": "Subscribe to this feed", + "default_title": "__MSG_default_title__", "default_icon": "feed-icon-16x16.png", "popup": "popup.html" } diff --git a/chrome/test/data/extensions/subscribe_page_action/subscribe.js b/chrome/test/data/extensions/subscribe_page_action/subscribe.js index 6234dfa..c4a423e 100644 --- a/chrome/test/data/extensions/subscribe_page_action/subscribe.js +++ b/chrome/test/data/extensions/subscribe_page_action/subscribe.js @@ -28,7 +28,7 @@ var styleSheet = ""; var frameScript = ""; // What to show when we cannot parse the feed name. -var unknownName = "Unknown feed name"; +var unknownName = chrome.i18n.getMessage("unknown_feed_name"); // A list of feed readers, populated by localStorage if available, otherwise // hard coded. @@ -76,7 +76,8 @@ function main() { if (storageEnabled) { // Add the "Manage..." entry to the dropdown and show the checkbox asking // if we always want to use this reader in the future (skip the preview). - readerDropdown.options[i] = new Option("Manage...", ""); + var manageText = chrome.i18n.getMessage("manage_option"); + readerDropdown.options[i] = new Option(manageText, ""); document.getElementById('alwaysUseSpan').style.display = "block"; } @@ -120,12 +121,12 @@ function main() { // Sets the title for the feed. function setFeedTitle(title) { var titleTag = document.getElementById('title'); - titleTag.textContent = "Feed for '" + title + "'"; + titleTag.textContent = chrome.i18n.getMessage("feed_for", title); } // Handles errors during the XMLHttpRequest. function handleError() { - handleFeedParsingFailed("Error fetching feed"); + handleFeedParsingFailed(chrome.i18n.getMessage("error_fetching")); } // Handles feed parsing errors. @@ -173,7 +174,7 @@ function handleResponse() { var doc = req.responseXML; if (!doc) { - handleFeedParsingFailed("Not a valid feed."); + handleFeedParsingFailed(chrome.i18n.getMessage("not_valid_feed")); return; } @@ -182,7 +183,7 @@ function handleResponse() { if (entries.length == 0) entries = doc.getElementsByTagName('item'); if (entries.length == 0) { - handleFeedParsingFailed("This feed contains no entries.") + handleFeedParsingFailed(chrome.i18n.getMessage("no_entries")); return; } |