#include "extensions/common/message_bundle.h"
#include <memory>
#include <string>
#include <vector>
#include "base/containers/adapters.h"
#include "base/containers/contains.h"
#include "base/i18n/rtl.h"
#include "base/lazy_instance.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/extension_l10n_util.h"
#include "extensions/common/manifest_constants.h"
namespace extensions {
errors;
const char MessageBundle::kContentKey[] = …;
const char MessageBundle::kMessageKey[] = …;
const char MessageBundle::kPlaceholdersKey[] = …;
const char MessageBundle::kPlaceholderBegin[] = …;
const char MessageBundle::kPlaceholderEnd[] = …;
const char MessageBundle::kMessageBegin[] = …;
const char MessageBundle::kMessageEnd[] = …;
const char MessageBundle::kUILocaleKey[] = …;
const char MessageBundle::kBidiDirectionKey[] = …;
const char MessageBundle::kBidiReversedDirectionKey[] = …;
const char MessageBundle::kBidiStartEdgeKey[] = …;
const char MessageBundle::kBidiEndEdgeKey[] = …;
const char MessageBundle::kExtensionIdKey[] = …;
const char MessageBundle::kBidiLeftEdgeValue[] = …;
const char MessageBundle::kBidiRightEdgeValue[] = …;
static bool BadKeyMessage(const std::string& name, std::string* error) { … }
MessageBundle* MessageBundle::Create(const CatalogVector& locale_catalogs,
std::string* error) { … }
bool MessageBundle::Init(const CatalogVector& locale_catalogs,
std::string* error) { … }
bool MessageBundle::AppendReservedMessagesForLocale(
const std::string& app_locale, std::string* error) { … }
bool MessageBundle::GetMessageValue(const std::string& key,
const base::Value& name_value,
std::string* value,
std::string* error) const { … }
MessageBundle::MessageBundle() { … }
bool MessageBundle::GetPlaceholders(const base::Value::Dict& name_tree,
const std::string& name_key,
SubstitutionMap* placeholders,
std::string* error) const { … }
bool MessageBundle::ReplacePlaceholders(const SubstitutionMap& placeholders,
std::string* message,
std::string* error) const { … }
bool MessageBundle::ReplaceMessages(std::string* text,
std::string* error) const { … }
MessageBundle::~MessageBundle() { … }
bool MessageBundle::ReplaceMessagesWithExternalDictionary(
const SubstitutionMap& dictionary, std::string* text, std::string* error) { … }
bool MessageBundle::ReplaceVariables(const SubstitutionMap& variables,
const std::string& var_begin_delimiter,
const std::string& var_end_delimiter,
std::string* message,
std::string* error) { … }
bool MessageBundle::IsValidName(const std::string& name) { … }
std::string MessageBundle::GetL10nMessage(const std::string& name) const { … }
std::string MessageBundle::GetL10nMessage(const std::string& name,
const SubstitutionMap& dictionary) { … }
}