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

Unified Diff: components/login/localized_values_builder.h

Issue 878253002: LocalizedValuesBuilder moved to components/login. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed dependency on 'base'. Created 5 years, 10 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 | « components/login/DEPS ('k') | components/login/localized_values_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/login/localized_values_builder.h
diff --git a/components/login/localized_values_builder.h b/components/login/localized_values_builder.h
new file mode 100644
index 0000000000000000000000000000000000000000..8c1731c87d1b297f54f6bf732ee521f7151af0e7
--- /dev/null
+++ b/components/login/localized_values_builder.h
@@ -0,0 +1,75 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_LOGIN_LOCALIZED_VALUES_BUILDER_H_
+#define COMPONENTS_LOGIN_LOCALIZED_VALUES_BUILDER_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "base/strings/string16.h"
+#include "components/login/login_export.h"
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace login {
+
+// Class that collects Localized Values for translation.
+class LOGIN_EXPORT LocalizedValuesBuilder {
+ public:
+ explicit LocalizedValuesBuilder(base::DictionaryValue* dict);
+ explicit LocalizedValuesBuilder(const std::string& prefix,
+ base::DictionaryValue* dict);
+
+ // Method to declare localized value. |key| is the i18n key used in html.
+ // |message| is text of the message.
+ void Add(const std::string& key, const std::string& message);
+
+ // Method to declare localized value. |key| is the i18n key used in html.
+ // |message| is text of the message.
+ void Add(const std::string& key, const base::string16& message);
+
+ // Method to declare localized value. |key| is the i18n key used in html.
+ // |message_id| is a resource id of message.
+ void Add(const std::string& key, int message_id);
+
+ // Method to declare localized value. |key| is the i18n key used in html.
+ // |message_id| is a resource id of message. Message is expected to have
+ // one format parameter subsituted by |a|.
+ void AddF(const std::string& key, int message_id, const base::string16& a);
+
+ // Method to declare localized value. |key| is the i18n key used in html.
+ // |message_id| is a resource id of message. Message is expected to have
+ // two format parameters subsituted by |a| and |b| respectively.
+ void AddF(const std::string& key,
+ int message_id,
+ const base::string16& a,
+ const base::string16& b);
+
+ // Method to declare localized value. |key| is the i18n key used in html.
+ // |message_id| is a resource id of message. Message is expected to have
+ // one format parameter subsituted by resource identified by |message_id_a|.
+ void AddF(const std::string& key, int message_id, int message_id_a);
+
+ // Method to declare localized value. |key| is the i18n key used in html.
+ // |message_id| is a resource id of message. Message is expected to have
+ // two format parameters subsituted by resource identified by |message_id_a|
+ // and |message_id_b| respectively.
+ void AddF(const std::string& key,
+ int message_id,
+ int message_id_a,
+ int message_id_b);
+
+ private:
+ std::string prefix_;
+
+ // Not owned.
+ base::DictionaryValue* dict_;
+};
+
+} // namespace login
+
+#endif // COMPONENTS_LOGIN_LOCALIZED_VALUES_BUILDER_H_
« no previous file with comments | « components/login/DEPS ('k') | components/login/localized_values_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698