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/memory/raw_ptr.h"
11 #include "base/values.h"
12 #include "components/login/login_export.h"
16 // Class that collects Localized Values for translation.
17 class LOGIN_EXPORT LocalizedValuesBuilder {
19 explicit LocalizedValuesBuilder(base::Value::Dict* dict);
21 // Method to declare localized value. |key| is the i18n key used in html.
22 // |message| is text of the message.
23 void Add(const std::string& key, const std::string& message);
25 // Method to declare localized value. |key| is the i18n key used in html.
26 // |message| is text of the message.
27 void Add(const std::string& key, const std::u16string& message);
29 // Method to declare localized value. |key| is the i18n key used in html.
30 // |message_id| is a resource id of message.
31 void Add(const std::string& key, int message_id);
33 // Method to declare localized value. |key| is the i18n key used in html.
34 // |message_id| is a resource id of message. Message is expected to have
35 // one format parameter subsituted by |a|.
36 void AddF(const std::string& key, int message_id, const std::u16string& a);
38 // Method to declare localized value. |key| is the i18n key used in html.
39 // |message_id| is a resource id of message. Message is expected to have
40 // two format parameters subsituted by |a| and |b| respectively.
41 void AddF(const std::string& key,
43 const std::u16string& a,
44 const std::u16string& b);
46 // Method to declare localized value. |key| is the i18n key used in html.
47 // |message_id| is a resource id of message. Message is expected to have
48 // two format parameters subsituted by |a|, |b| and |c| respectively.
49 void AddF(const std::string& key,
51 const std::u16string& a,
52 const std::u16string& b,
53 const std::u16string& c);
55 // Method to declare localized value. |key| is the i18n key used in html.
56 // |message_id| is a resource id of message. Message is expected to have
57 // one format parameter subsituted by resource identified by |message_id_a|.
58 void AddF(const std::string& key, int message_id, int message_id_a);
60 // Method to declare localized value. |key| is the i18n key used in html.
61 // |message_id| is a resource id of message. Message is expected to have
62 // two format parameters subsituted by resource identified by |message_id_a|
63 // and |message_id_b| respectively.
64 void AddF(const std::string& key,
69 // Method to declare localized value. |key| is the i18n key used in html.
70 // |message_id| is a resource id of message. Message is expected to have
71 // three format parameters subsituted by resource identified by
72 // |message_id_a|, |message_id_b| and |message_id_c| respectively.
73 void AddF(const std::string& key,
83 raw_ptr<base::Value::Dict, ExperimentalAsh> dict_;
88 #endif // COMPONENTS_LOGIN_LOCALIZED_VALUES_BUILDER_H_