Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreLocalizer.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_LOCALIZER__
8#define __HDI_CORE_LOCALIZER__
9
10#include <map>
11
12#include "hdicoreTypes.h"
13
17#define HDI_CORE_LOCALIZER hdi::core::Localizer::instance()
18
19namespace hdi
20{
21 namespace core
22 {
48 {
49 public:
50 typedef std::map<Locale, std::string> StringMap;
51
60
69
77 void setDefaultLocale(const Locale defaultLocale_);
78
88 void addString(const std::string& key_, const Locale locale_, const std::string& str_);
89
98 void removeString(const std::string& key_, const Locale locale_);
99
109 StringMap getAllStrings(const std::string& key_) const;
110
122 std::string getString(const std::string& key_, const Locale locale_) const;
123
136 std::string getLocalString(const std::string& key_) const;
137
138
139 private:
140 friend class Plugin;
141
145 static Localizer* __instance;
146
152 Localizer();
153
159 ~Localizer();
160 };
161 }
162}
163
164#endif
165// __HDI_CORE_LOCALIZER__
Singleton class to aid in runtime localization.
Definition: hdicoreLocalizer.h:48
void addString(const std::string &key_, const Locale locale_, const std::string &str_)
Adds a new localized string value, keyed by a unique string and the value's locale.
std::string getString(const std::string &key_, const Locale locale_) const
Gets a localized string for a given key and locale.
std::string getLocalString(const std::string &key_) const
Gets a localized string for a given key and whatever locale the app currently has.
StringMap getAllStrings(const std::string &key_) const
Gets a map of locales and their corresponding localized strings for a given key.
static Localizer * instance()
Allows access to the singleton localizer instance object.
void setDefaultLocale(const Locale defaultLocale_)
Sets the default locale of the Localizer instance.
Locale defaultLocale() const
Gets the default locale of the Localizer instance.
void removeString(const std::string &key_, const Locale locale_)
Removes an existing localized string value by its key and locale.
Base plugin class; the heart of any plugin project.
Definition: hdicorePlugin.h:35
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
Locale
Indicates the locale under which the app is running. Many languages are only listed for one country,...
Definition: hdicoreTypes.h:851