7 #ifndef _FCITX_UTILS_I18NSTRING_H_ 8 #define _FCITX_UTILS_I18NSTRING_H_ 11 #include <unordered_map> 12 #include <fcitx-utils/fcitxutils_export.h> 20 void set(
const std::string &str,
const std::string &locale =
"") {
21 if (!locale.empty()) {
33 const std::string &match(
const std::string &locale =
"system")
const;
35 bool operator==(
const I18NString &other)
const {
36 return other.default_ == default_ && other.map_ == map_;
39 bool operator!=(
const I18NString &other)
const {
40 return !operator==(other);
43 const std::string &defaultString()
const {
return default_; }
44 const std::unordered_map<std::string, std::string> &
45 localizedStrings()
const {
51 std::unordered_map<std::string, std::string> map_;
55 #endif // _FCITX_UTILS_I18NSTRING_H_