OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/options/language_options_handler_common.h" | 5 #include "chrome/browser/ui/webui/options/language_options_handler_common.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 IDS_OPTIONS_SETTINGS_LANGUAGES_IS_DISPLAYED_IN_THIS_LANGUAGE, | 57 IDS_OPTIONS_SETTINGS_LANGUAGES_IS_DISPLAYED_IN_THIS_LANGUAGE, |
58 product_name)); | 58 product_name)); |
59 localized_strings->SetString("display_in_this_language", | 59 localized_strings->SetString("display_in_this_language", |
60 l10n_util::GetStringFUTF16( | 60 l10n_util::GetStringFUTF16( |
61 IDS_OPTIONS_SETTINGS_LANGUAGES_DISPLAY_IN_THIS_LANGUAGE, | 61 IDS_OPTIONS_SETTINGS_LANGUAGES_DISPLAY_IN_THIS_LANGUAGE, |
62 product_name)); | 62 product_name)); |
63 localized_strings->SetString("this_language_is_currently_in_use", | 63 localized_strings->SetString("this_language_is_currently_in_use", |
64 l10n_util::GetStringFUTF16( | 64 l10n_util::GetStringFUTF16( |
65 IDS_OPTIONS_SETTINGS_LANGUAGES_THIS_LANGUAGE_IS_CURRENTLY_IN_USE, | 65 IDS_OPTIONS_SETTINGS_LANGUAGES_THIS_LANGUAGE_IS_CURRENTLY_IN_USE, |
66 product_name)); | 66 product_name)); |
67 localized_strings->SetString("restart_required", | |
68 l10n_util::GetStringUTF16(IDS_OPTIONS_RELAUNCH_REQUIRED)); | |
69 // OS X uses the OS native spellchecker so no need for these strings. | |
70 #if !defined(OS_MACOSX) | |
71 localized_strings->SetString("use_this_for_spell_checking", | 67 localized_strings->SetString("use_this_for_spell_checking", |
72 l10n_util::GetStringUTF16( | 68 l10n_util::GetStringUTF16( |
73 IDS_OPTIONS_SETTINGS_USE_THIS_FOR_SPELL_CHECKING)); | 69 IDS_OPTIONS_SETTINGS_USE_THIS_FOR_SPELL_CHECKING)); |
74 localized_strings->SetString("cannot_be_used_for_spell_checking", | 70 localized_strings->SetString("cannot_be_used_for_spell_checking", |
75 l10n_util::GetStringUTF16( | 71 l10n_util::GetStringUTF16( |
76 IDS_OPTIONS_SETTINGS_CANNOT_BE_USED_FOR_SPELL_CHECKING)); | 72 IDS_OPTIONS_SETTINGS_CANNOT_BE_USED_FOR_SPELL_CHECKING)); |
77 localized_strings->SetString("is_used_for_spell_checking", | 73 localized_strings->SetString("is_used_for_spell_checking", |
78 l10n_util::GetStringUTF16( | 74 l10n_util::GetStringUTF16( |
79 IDS_OPTIONS_SETTINGS_IS_USED_FOR_SPELL_CHECKING)); | 75 IDS_OPTIONS_SETTINGS_IS_USED_FOR_SPELL_CHECKING)); |
| 76 localized_strings->SetString("restart_required", |
| 77 l10n_util::GetStringUTF16(IDS_OPTIONS_RELAUNCH_REQUIRED)); |
80 localized_strings->SetString("enable_spell_check", | 78 localized_strings->SetString("enable_spell_check", |
81 l10n_util::GetStringUTF16(IDS_OPTIONS_ENABLE_SPELLCHECK)); | 79 l10n_util::GetStringUTF16(IDS_OPTIONS_ENABLE_SPELLCHECK)); |
82 localized_strings->SetString("enable_auto_spell_correction", | 80 localized_strings->SetString("enable_auto_spell_correction", |
83 l10n_util::GetStringUTF16(IDS_OPTIONS_ENABLE_AUTO_SPELL_CORRECTION)); | 81 l10n_util::GetStringUTF16(IDS_OPTIONS_ENABLE_AUTO_SPELL_CORRECTION)); |
84 #endif // !OS_MACOSX | |
85 localized_strings->SetString("add_language_title", | 82 localized_strings->SetString("add_language_title", |
86 l10n_util::GetStringUTF16(IDS_OPTIONS_LANGUAGES_ADD_TITLE)); | 83 l10n_util::GetStringUTF16(IDS_OPTIONS_LANGUAGES_ADD_TITLE)); |
87 localized_strings->SetString("add_language_select_label", | 84 localized_strings->SetString("add_language_select_label", |
88 l10n_util::GetStringUTF16(IDS_OPTIONS_LANGUAGES_ADD_SELECT_LABEL)); | 85 l10n_util::GetStringUTF16(IDS_OPTIONS_LANGUAGES_ADD_SELECT_LABEL)); |
89 localized_strings->SetString("restart_button", | 86 localized_strings->SetString("restart_button", |
90 l10n_util::GetStringUTF16( | 87 l10n_util::GetStringUTF16( |
91 IDS_OPTIONS_SETTINGS_LANGUAGES_RELAUNCH_BUTTON)); | 88 IDS_OPTIONS_SETTINGS_LANGUAGES_RELAUNCH_BUTTON)); |
92 | 89 |
93 // The following are resources, rather than local strings. | 90 // The following are resources, rather than local strings. |
94 localized_strings->SetString("currentUiLanguageCode", | 91 localized_strings->SetString("currentUiLanguageCode", |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 154 } |
158 | 155 |
159 void LanguageOptionsHandlerCommon::SpellCheckLanguageChangeCallback( | 156 void LanguageOptionsHandlerCommon::SpellCheckLanguageChangeCallback( |
160 const ListValue* args) { | 157 const ListValue* args) { |
161 const std::string language_code = UTF16ToASCII(ExtractStringValue(args)); | 158 const std::string language_code = UTF16ToASCII(ExtractStringValue(args)); |
162 CHECK(!language_code.empty()); | 159 CHECK(!language_code.empty()); |
163 const std::string action = base::StringPrintf( | 160 const std::string action = base::StringPrintf( |
164 "LanguageOptions_SpellCheckLanguageChange_%s", language_code.c_str()); | 161 "LanguageOptions_SpellCheckLanguageChange_%s", language_code.c_str()); |
165 UserMetrics::RecordComputedAction(action); | 162 UserMetrics::RecordComputedAction(action); |
166 } | 163 } |
OLD | NEW |