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

Unified Diff: chrome/common/extensions/docs/examples/api/fontSettings/popup.js

Issue 10532105: Use ICU script code "Jpan" instead of "Hrkt" in Japanese pref names (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: change in tests and comment Created 8 years, 6 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/common/extensions/docs/examples/api/fontSettings/popup.js
diff --git a/chrome/common/extensions/docs/examples/api/fontSettings/popup.js b/chrome/common/extensions/docs/examples/api/fontSettings/popup.js
index f5723feaf3fb6fba36398b19ee1e23a767a4ed39..2f4073d03d895500dccdc3b995becb41ab25d30e 100644
--- a/chrome/common/extensions/docs/examples/api/fontSettings/popup.js
+++ b/chrome/common/extensions/docs/examples/api/fontSettings/popup.js
@@ -23,12 +23,12 @@ var defaultSampleText = 'Lorem ipsum dolor sit amat.';
var scriptSpecificSampleText = {
// "Cyrllic script".
'Cyrl': 'Lorem ipsum Кириллица',
- 'Hang': 'Lorem ipsum 雪海泳 정 참판 양반댁 규수 큰 교자 타고 혼례 치른 날.',
- 'Hans': 'Lorem ipsum 雪海泳 简体字。',
- 'Hant': 'Lorem ipsum 雪海泳 繁體字。',
- 'Hrkt': 'Lorem ipsum 雪海泳 バスを待ち大路の春をうたがはず。',
- // "Khmer language".
+ 'Hans': 'Lorem ipsum 简体字。',
+ 'Hant': 'Lorem ipsum 繁體字。',
+ 'Jpan': 'Lorem ipsum バスを待ち大路の春をうたがはず。',
+ // "Khmer language".
'Khmr': 'Lorem ipsum \u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A',
+ 'Kore': 'Lorem ipsum 정 참판 양반댁 규수 큰 교자 타고 혼례 치른 날.',
};
function getSelectedScript() {
@@ -106,6 +106,13 @@ function getFontHandler(list) {
};
}
+// Temporary workaround for https://bugs.webkit.org/show_bug.cgi?id=88845.
+function getScriptUsedByWebKit(script) {
+ if (script == 'Jpan') return 'Hrkt';
+ if (script == 'Kore') return 'Hang';
+ return script;
+}
+
// Called when the script list selection changes. Sets the selected value of
// each font list to the current font setting, and updates the document's lang
// so that the samples are shown in the current font setting.
@@ -121,7 +128,7 @@ function updateFontListsForScript() {
details.script = script;
// For font selection it's the script code that matters, not language, so
// just use en for lang.
- document.body.lang = 'en-' + script;
+ document.body.lang = 'en-' + getScriptUsedByWebKit(script);
chrome.experimental.fontSettings.getFont(details, getFontHandler(list));
}
@@ -218,8 +225,8 @@ function initEncoding() {
function clearAllSettings() {
var scripts =
["Arab", "Armn", "Beng", "Cans", "Cher", "Cyrl", "Deva", "Ethi", "Geor",
- "Grek", "Gujr", "Guru", "Hang", "Hans", "Hant", "Hebr", "Hrkt", "Knda",
- "Khmr", "Laoo", "Mlym", "Mong", "Mymr", "Orya", "Sinh", "Taml", "Telu",
+ "Grek", "Gujr", "Guru", "Hans", "Hant", "Hebr", "Jpan", "Khmr", "Knda",
+ "Kore", "Laoo", "Mlym", "Mong", "Mymr", "Orya", "Sinh", "Taml", "Telu",
"Thaa", "Thai", "Tibt", "Yiii", "Zyyy"];
var families =
["standard", "sansserif", "serif", "fixed", "cursive", "fantasy"];

Powered by Google App Engine
This is Rietveld 408576698