1 // Copyright 2015 The Chromium Authors
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/values.h"
11 #include "components/login/login_export.h"
15 // Class that collects Localized Values for translation.
16 class LOGIN_EXPORT LocalizedValuesBuilder {
18 explicit LocalizedValuesBuilder(base::Value::Dict* dict);
20 // Method to declare localized value. |key| is the i18n key used in html.
21 // |message| is text of the message.
22 void Add(const std::string& key, const std::string& message);
24 // Method to declare localized value. |key| is the i18n key used in html.
25 // |message| is text of the message.
26 void Add(const std::string& key, const std::u16string& message);
28 // Method to declare localized value. |key| is the i18n key used in html.
29 // |message_id| is a resource id of message.
30 void Add(const std::string& key, int message_id);
32 // Method to declare localized value. |key| is the i18n key used in html.
33 // |message_id| is a resource id of message. Message is expected to have
34 // one format parameter subsituted by |a|.
35 void AddF(const std::string& key, int message_id, const std::u16string& a);
37 // Method to declare localized value. |key| is the i18n key used in html.
38 // |message_id| is a resource id of message. Message is expected to have
39 // two format parameters subsituted by |a| and |b| respectively.
40 void AddF(const std::string& key,
42 const std::u16string& a,
43 const std::u16string& b);
45 // Method to declare localized value. |key| is the i18n key used in html.
46 // |message_id| is a resource id of message. Message is expected to have
47 // two format parameters subsituted by |a|, |b| and |c| respectively.
48 void AddF(const std::string& key,
50 const std::u16string& a,
51 const std::u16string& b,
52 const std::u16string& c);
54 // Method to declare localized value. |key| is the i18n key used in html.
55 // |message_id| is a resource id of message. Message is expected to have
56 // one format parameter subsituted by resource identified by |message_id_a|.
57 void AddF(const std::string& key, int message_id, int message_id_a);
59 // Method to declare localized value. |key| is the i18n key used in html.
60 // |message_id| is a resource id of message. Message is expected to have
61 // two format parameters subsituted by resource identified by |message_id_a|
62 // and |message_id_b| respectively.
63 void AddF(const std::string& key,
68 // Method to declare localized value. |key| is the i18n key used in html.
69 // |message_id| is a resource id of message. Message is expected to have
70 // three format parameters subsituted by resource identified by
71 // |message_id_a|, |message_id_b| and |message_id_c| respectively.
72 void AddF(const std::string& key,
82 base::Value::Dict* dict_;
87 #endif // COMPONENTS_LOGIN_LOCALIZED_VALUES_BUILDER_H_