| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/options2/language_options_handler_common2.h" | 5 #include "chrome/browser/ui/webui/options2/language_options_handler_common2.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 27 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 | 39 |
| 40 void LanguageOptionsHandlerCommon::GetLocalizedValues( | 40 void LanguageOptionsHandlerCommon::GetLocalizedValues( |
| 41 DictionaryValue* localized_strings) { | 41 DictionaryValue* localized_strings) { |
| 42 DCHECK(localized_strings); | 42 DCHECK(localized_strings); |
| 43 string16 product_name = GetProductName(); | 43 string16 product_name = GetProductName(); |
| 44 localized_strings->SetString("add_button", | 44 localized_strings->SetString("add_button", |
| 45 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_LANGUAGES_ADD_BUTTON)); | 45 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_LANGUAGES_ADD_BUTTON)); |
| 46 localized_strings->SetString("languages", | 46 localized_strings->SetString("languages", |
| 47 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_LANGUAGES_LANGUAGES)); | 47 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_LANGUAGES_LANGUAGES)); |
| 48 localized_strings->SetString("please_add_another_language", | |
| 49 l10n_util::GetStringUTF16( | |
| 50 IDS_OPTIONS_SETTINGS_LANGUAGES_PLEASE_ADD_ANOTHER_LANGUAGE)); | |
| 51 localized_strings->SetString("remove_button", | |
| 52 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_LANGUAGES_REMOVE_BUTTON)); | |
| 53 localized_strings->SetString("add_language_instructions", | 48 localized_strings->SetString("add_language_instructions", |
| 54 l10n_util::GetStringUTF16( | 49 l10n_util::GetStringUTF16( |
| 55 IDS_OPTIONS_SETTINGS_LANGUAGES_ADD_LANGUAGE_INSTRUCTIONS)); | 50 IDS_OPTIONS_SETTINGS_LANGUAGES_ADD_LANGUAGE_INSTRUCTIONS)); |
| 56 localized_strings->SetString("cannot_be_displayed_in_this_language", | 51 localized_strings->SetString("cannot_be_displayed_in_this_language", |
| 57 l10n_util::GetStringFUTF16( | 52 l10n_util::GetStringFUTF16( |
| 58 IDS_OPTIONS_SETTINGS_LANGUAGES_CANNOT_BE_DISPLAYED_IN_THIS_LANGUAGE, | 53 IDS_OPTIONS_SETTINGS_LANGUAGES_CANNOT_BE_DISPLAYED_IN_THIS_LANGUAGE, |
| 59 product_name)); | 54 product_name)); |
| 60 localized_strings->SetString("is_displayed_in_this_language", | 55 localized_strings->SetString("is_displayed_in_this_language", |
| 61 l10n_util::GetStringFUTF16( | 56 l10n_util::GetStringFUTF16( |
| 62 IDS_OPTIONS_SETTINGS_LANGUAGES_IS_DISPLAYED_IN_THIS_LANGUAGE, | 57 IDS_OPTIONS_SETTINGS_LANGUAGES_IS_DISPLAYED_IN_THIS_LANGUAGE, |
| 63 product_name)); | 58 product_name)); |
| 64 localized_strings->SetString("display_in_this_language", | 59 localized_strings->SetString("display_in_this_language", |
| 65 l10n_util::GetStringFUTF16( | 60 l10n_util::GetStringFUTF16( |
| 66 IDS_OPTIONS_SETTINGS_LANGUAGES_DISPLAY_IN_THIS_LANGUAGE, | 61 IDS_OPTIONS_SETTINGS_LANGUAGES_DISPLAY_IN_THIS_LANGUAGE, |
| 67 product_name)); | 62 product_name)); |
| 68 localized_strings->SetString("this_language_is_currently_in_use", | |
| 69 l10n_util::GetStringFUTF16( | |
| 70 IDS_OPTIONS_SETTINGS_LANGUAGES_THIS_LANGUAGE_IS_CURRENTLY_IN_USE, | |
| 71 product_name)); | |
| 72 localized_strings->SetString("restart_required", | 63 localized_strings->SetString("restart_required", |
| 73 l10n_util::GetStringUTF16(IDS_OPTIONS_RELAUNCH_REQUIRED)); | 64 l10n_util::GetStringUTF16(IDS_OPTIONS_RELAUNCH_REQUIRED)); |
| 74 // OS X uses the OS native spellchecker so no need for these strings. | 65 // OS X uses the OS native spellchecker so no need for these strings. |
| 75 #if !defined(OS_MACOSX) | 66 #if !defined(OS_MACOSX) |
| 76 localized_strings->SetString("use_this_for_spell_checking", | 67 localized_strings->SetString("use_this_for_spell_checking", |
| 77 l10n_util::GetStringUTF16( | 68 l10n_util::GetStringUTF16( |
| 78 IDS_OPTIONS_SETTINGS_USE_THIS_FOR_SPELL_CHECKING)); | 69 IDS_OPTIONS_SETTINGS_USE_THIS_FOR_SPELL_CHECKING)); |
| 79 localized_strings->SetString("cannot_be_used_for_spell_checking", | 70 localized_strings->SetString("cannot_be_used_for_spell_checking", |
| 80 l10n_util::GetStringUTF16( | 71 l10n_util::GetStringUTF16( |
| 81 IDS_OPTIONS_SETTINGS_CANNOT_BE_USED_FOR_SPELL_CHECKING)); | 72 IDS_OPTIONS_SETTINGS_CANNOT_BE_USED_FOR_SPELL_CHECKING)); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 void LanguageOptionsHandlerCommon::SpellCheckLanguageChangeCallback( | 160 void LanguageOptionsHandlerCommon::SpellCheckLanguageChangeCallback( |
| 170 const ListValue* args) { | 161 const ListValue* args) { |
| 171 const std::string language_code = UTF16ToASCII(ExtractStringValue(args)); | 162 const std::string language_code = UTF16ToASCII(ExtractStringValue(args)); |
| 172 CHECK(!language_code.empty()); | 163 CHECK(!language_code.empty()); |
| 173 const std::string action = base::StringPrintf( | 164 const std::string action = base::StringPrintf( |
| 174 "LanguageOptions_SpellCheckLanguageChange_%s", language_code.c_str()); | 165 "LanguageOptions_SpellCheckLanguageChange_%s", language_code.c_str()); |
| 175 content::RecordComputedAction(action); | 166 content::RecordComputedAction(action); |
| 176 } | 167 } |
| 177 | 168 |
| 178 } // namespace options2 | 169 } // namespace options2 |
| OLD | NEW |