chromium/extensions/common/message_bundle.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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[] =;

// Reserved messages names.
const char MessageBundle::kUILocaleKey[] =;
const char MessageBundle::kBidiDirectionKey[] =;
const char MessageBundle::kBidiReversedDirectionKey[] =;
const char MessageBundle::kBidiStartEdgeKey[] =;
const char MessageBundle::kBidiEndEdgeKey[] =;
const char MessageBundle::kExtensionIdKey[] =;

// Reserved messages values.
const char MessageBundle::kBidiLeftEdgeValue[] =;
const char MessageBundle::kBidiRightEdgeValue[] =;

// Formats message in case we encounter a bad formed key in the JSON object.
// Returns false and sets |error| to actual error message.
static bool BadKeyMessage(const std::string& name, std::string* error) {}

// static
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() {}

// static
bool MessageBundle::ReplaceMessagesWithExternalDictionary(
    const SubstitutionMap& dictionary, std::string* text, std::string* error) {}

// static
bool MessageBundle::ReplaceVariables(const SubstitutionMap& variables,
                                     const std::string& var_begin_delimiter,
                                     const std::string& var_end_delimiter,
                                     std::string* message,
                                     std::string* error) {}

// static
bool MessageBundle::IsValidName(const std::string& name) {}

// Dictionary interface.

std::string MessageBundle::GetL10nMessage(const std::string& name) const {}

// static
std::string MessageBundle::GetL10nMessage(const std::string& name,
                                          const SubstitutionMap& dictionary) {}

}  // namespace extensions