diff options
author | Torne (Richard Coles) <torne@google.com> | 2014-06-25 10:31:36 +0100 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2014-06-25 10:31:36 +0100 |
commit | 6ce3a9ad00160cd58574b6bca6d2220c4dbfc83e (patch) | |
tree | bd4c283a39b6659d25c49870a045ff73b049eebc /cpp/include/libaddressinput/localization.h | |
parent | b8347ad8ead685b8afe0ff329ae047f17c7b817c (diff) | |
parent | f7ddeee545f03c948074c921c4648807d90227ae (diff) | |
download | src-l-preview.tar.gz |
Merge from Chromium at DEPS revision 278856android-wear-5.0.0_r1android-l-preview_r2android-cts-5.0_r9android-cts-5.0_r8android-cts-5.0_r7android-cts-5.0_r6android-cts-5.0_r5android-cts-5.0_r4android-cts-5.0_r3android-5.0.2_r3android-5.0.2_r1android-5.0.1_r1android-5.0.0_r7android-5.0.0_r6android-5.0.0_r5.1android-5.0.0_r5android-5.0.0_r4android-5.0.0_r3android-5.0.0_r2android-5.0.0_r1lollipop-wear-releaselollipop-releaselollipop-devlollipop-cts-releasel-preview
This commit was generated by merge_to_master.py.
Change-Id: I283eef90c15d40ea8cd6290f12094fc152a2c45e
Diffstat (limited to 'cpp/include/libaddressinput/localization.h')
-rw-r--r-- | cpp/include/libaddressinput/localization.h | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/cpp/include/libaddressinput/localization.h b/cpp/include/libaddressinput/localization.h index 08b5964..acfdf7e 100644 --- a/cpp/include/libaddressinput/localization.h +++ b/cpp/include/libaddressinput/localization.h @@ -26,17 +26,17 @@ namespace addressinput { struct AddressData; -// The object to retrieve localized strings based on message IDs. Sample usage: +// The object to retrieve localized strings based on message IDs. It returns +// English by default. Sample usage: // Localization localization; -// localization.SetLanguage("en"); // std::string best_language_tag; -// Process(BuildComponents("CA", localization, &best_language_tag)); +// Process(BuildComponents("CA", localization, "en-US", &best_language_tag)); // // Alternative usage: // Localization localization; -// localization.SetGetter(&MyStringGetter, "fr"); +// localization.SetGetter(&MyStringGetter); // std::string best_language_tag; -// Process(BuildComponents("CA", localization, &best_language_tag)); +// Process(BuildComponents("CA", localization, "fr-CA", &best_language_tag)); class Localization { public: // Initializes with English messages by default. @@ -63,17 +63,11 @@ class Localization { bool enable_examples, bool enable_links) const; - // Sets the language for the strings. The only supported language is "en" - // until we have translations. - void SetLanguage(const std::string& language_tag); - // Sets the string getter that takes a message identifier and returns the - // corresponding localized string. The |language_tag| parameter is used only - // for information purposes here. - void SetGetter(std::string (*getter)(int), const std::string& language_tag); - - // Returns the current language tag. - const std::string& GetLanguage() const { return language_tag_; } + // corresponding localized string. For example, in Chromium there is + // l10n_util::GetStringUTF8 which always returns strings in the current + // application locale. + void SetGetter(std::string (*getter)(int)); private: // Returns the error message where the address field is a postal code. Helper @@ -90,9 +84,6 @@ class Localization { // The string getter. std::string (*get_string_)(int); - - // The current language tag. - std::string language_tag_; }; } // namespace addressinput |