Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: chrome/browser/resources/chromeos/chromevox/host/interface/abstract_msgs.js

Issue 578303002: Add new braille tables supported by liblouis 2.6.0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@libloiusupgrade
Patch Set: Add braille table variant, sort tables and add more tests. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/host/interface/abstract_msgs.js
diff --git a/chrome/browser/resources/chromeos/chromevox/host/interface/abstract_msgs.js b/chrome/browser/resources/chromeos/chromevox/host/interface/abstract_msgs.js
index c23594ff9367f5662453bbec4cefa925404c2e2c..7d82e032f71c1a5d4fbbc527a7a0f08d225fdfd8 100644
--- a/chrome/browser/resources/chromeos/chromevox/host/interface/abstract_msgs.js
+++ b/chrome/browser/resources/chromeos/chromevox/host/interface/abstract_msgs.js
@@ -13,7 +13,13 @@ goog.provide('cvox.AbstractMsgs');
/**
* @constructor
*/
-cvox.AbstractMsgs = function() { };
+cvox.AbstractMsgs = function() {
+ /**
+ * @type {Object.<string, string>}
+ * @private
+ */
+ this.localeNameDict_ = null;
+};
@@ -46,3 +52,24 @@ cvox.AbstractMsgs.prototype.getMsg = function(message_id, opt_subs) {
*/
cvox.AbstractMsgs.prototype.getNumber = function(num) {
};
+
+
+/**
David Tseng 2014/09/19 23:13:39 Kind of odd to put this here. Why not place in Chr
+ * Gets a localized display name for a locale.
+ * NOTE: Only a subset of locale identifiers are supported. See the
+ * |CHROMEVOX_LOCALE_DICT| message.
+ * @param {string} locale On the form |ll| or |ll_CC|, where |ll| is
+ * the language code and |CC| the country code.
+ * @return {string} The display name.
+ */
+cvox.AbstractMsgs.prototype.getLocaleDisplayName = function(locale) {
+ if (!this.localeNameDict_) {
+ this.localeNameDict_ = /** @type {Object.<string, string>} */(
+ JSON.parse(this.getMsg('locale_dict')));
+ }
+ var name = this.localeNameDict_[locale];
+ if (!name) {
+ throw Error('Unsupported locale identifier: ' + locale);
+ }
+ return name;
+};

Powered by Google App Engine
This is Rietveld 408576698