Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2719)

Unified Diff: chrome/common/extensions/extension_message_bundle.h

Issue 546040: Add reserved messages to ExtensionMessageBundle dictionary. They are of the f... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/extension_message_bundle.h
===================================================================
--- chrome/common/extensions/extension_message_bundle.h (revision 36561)
+++ chrome/common/extensions/extension_message_bundle.h (working copy)
@@ -30,6 +30,21 @@
static const char* kMessageBegin;
static const char* kMessageEnd;
+ // Reserved message names in the dictionary.
+ // Update i18n documentation when adding new reserved value.
+ static const char* kUILocaleKey;
+ // See http://code.google.com/apis/gadgets/docs/i18n.html#BIDI for
+ // description.
+ // TODO(cira): point to chrome docs once they are out.
+ static const char* kBidiDirectionKey;
+ static const char* kBidiReversedDirectionKey;
+ static const char* kBidiStartEdgeKey;
+ static const char* kBidiEndEdgeKey;
+
+ // Values for some of the reserved messages.
+ static const char* kBidiLeftEdgeValue;
+ static const char* kBidiRightEdgeValue;
+
// Creates ExtensionMessageBundle or returns NULL if there was an error.
// Expects locale_catalogs to be sorted from more specific to less specific,
// with default catalog at the end.
@@ -68,16 +83,13 @@
std::string* message,
std::string* error);
- // Allow only ascii 0-9, a-z, A-Z, and _ in the variable name.
- // Returns false if the input is empty or if it has illegal characters.
- // Public for easier unittesting.
- template<typename str>
- static bool IsValidName(const str& name);
-
// Getter for dictionary_.
const SubstitutionMap* dictionary() const { return &dictionary_; }
private:
+ // Testing friend.
+ friend class ExtensionMessageBundleTest;
+
// Use Create to create ExtensionMessageBundle instance.
ExtensionMessageBundle();
@@ -87,6 +99,11 @@
// Returns false on error.
bool Init(const CatalogVector& locale_catalogs, std::string* error);
+ // Appends reserved messages to the dictionary.
jungshik at Google 2010/01/20 21:35:47 nit: "Appends locale-specific reserved messages to
Nebojša Ćirić 2010/01/20 22:40:21 Done.
+ // Returns false if there was a conflict with user defined messages.
+ bool AppendReservedMessages(const std::string& application_locale,
+ std::string* error);
+
// Helper methods that navigate JSON tree and return simplified message.
// They replace all $PLACEHOLDERS$ with their value, and return just key/value
// of the message.
@@ -107,6 +124,11 @@
std::string* message,
std::string* error) const;
+ // Allow only ascii 0-9, a-z, A-Z, and _ in the variable name.
+ // Returns false if the input is empty or if it has illegal characters.
+ template<typename str>
+ static bool IsValidName(const str& name);
+
// Holds all messages for application locale.
SubstitutionMap dictionary_;
};
« no previous file with comments | « chrome/common/extensions/extension_constants.cc ('k') | chrome/common/extensions/extension_message_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698