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

Unified Diff: chrome/browser/chromeos/options/language_config_view.h

Issue 1512022: Add NormalizeLanguageCode() to normalize language codes. (Closed)
Patch Set: add a comment Created 10 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/options/language_config_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/options/language_config_view.h
diff --git a/chrome/browser/chromeos/options/language_config_view.h b/chrome/browser/chromeos/options/language_config_view.h
index 2a1b932296b5bffb63f69e7d8d735fb06b8bba98..0dd64d2748d720667a42484649f33bc562adddc6 100644
--- a/chrome/browser/chromeos/options/language_config_view.h
+++ b/chrome/browser/chromeos/options/language_config_view.h
@@ -73,7 +73,7 @@ class LanguageConfigView : public TableModel,
const NotificationDetails& details);
// Gets the list of supported language codes like "en" and "ja".
- void GetSupportedLangageCodes(
+ void GetSupportedLanguageCodes(
std::vector<std::string>* out_language_codes) const;
// Rewrites the language name and returns the modified version if
@@ -83,6 +83,13 @@ class LanguageConfigView : public TableModel,
static std::wstring MaybeRewriteLanguageName(
const std::wstring& language_name);
+ // Normalizes the language code and returns the normalized version.
+ // The function concverts a two-letter language code to its
+ // corresponding three-letter code like "ja" => "jpn". Otherwise,
+ // returns the given language code as-is.
+ static std::string NormalizeLanguageCode(
+ const std::string& language_code);
+
private:
// Initializes the input method config view.
void InitInputMethodConfigViewMap();
@@ -114,7 +121,8 @@ class LanguageConfigView : public TableModel,
void GetActiveLanguageIDs(std::vector<std::string>* out_language_ids);
// Gets the list of supported IME IDs like "pinyin" and "m17n:ar:kbd".
- void GetSupportedLangageIDs(std::vector<std::string>* out_language_ids) const;
+ void GetSupportedLanguageIDs(
+ std::vector<std::string>* out_language_ids) const;
// Converts a language ID to a language code of the IME. Returns "" when
// |language_id| is unknown.
« no previous file with comments | « no previous file | chrome/browser/chromeos/options/language_config_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698