1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_LOGIN_LOCALIZED_VALUES_BUILDER_H_
6 #define COMPONENTS_LOGIN_LOCALIZED_VALUES_BUILDER_H_
10 #include "base/macros.h"
11 #include "base/strings/string16.h"
12 #include "components/login/login_export.h"
15 class DictionaryValue;
20 // Class that collects Localized Values for translation.
21 class LOGIN_EXPORT LocalizedValuesBuilder {
23 explicit LocalizedValuesBuilder(base::DictionaryValue* dict);
24 explicit LocalizedValuesBuilder(const std::string& prefix,
25 base::DictionaryValue* dict);
27 // Method to declare localized value. |key| is the i18n key used in html.
28 // |message| is text of the message.
29 void Add(const std::string& key, const std::string& message);
31 // Method to declare localized value. |key| is the i18n key used in html.
32 // |message| is text of the message.
33 void Add(const std::string& key, const base::string16& message);
35 // Method to declare localized value. |key| is the i18n key used in html.
36 // |message_id| is a resource id of message.
37 void Add(const std::string& key, int message_id);
39 // Method to declare localized value. |key| is the i18n key used in html.
40 // |message_id| is a resource id of message. Message is expected to have
41 // one format parameter subsituted by |a|.
42 void AddF(const std::string& key, int message_id, const base::string16& a);
44 // Method to declare localized value. |key| is the i18n key used in html.
45 // |message_id| is a resource id of message. Message is expected to have
46 // two format parameters subsituted by |a| and |b| respectively.
47 void AddF(const std::string& key,
49 const base::string16& a,
50 const base::string16& b);
52 // Method to declare localized value. |key| is the i18n key used in html.
53 // |message_id| is a resource id of message. Message is expected to have
54 // one format parameter subsituted by resource identified by |message_id_a|.
55 void AddF(const std::string& key, int message_id, int message_id_a);
57 // Method to declare localized value. |key| is the i18n key used in html.
58 // |message_id| is a resource id of message. Message is expected to have
59 // two format parameters subsituted by resource identified by |message_id_a|
60 // and |message_id_b| respectively.
61 void AddF(const std::string& key,
70 base::DictionaryValue* dict_;
75 #endif // COMPONENTS_LOGIN_LOCALIZED_VALUES_BUILDER_H_