diff options
| author | Peng Wu <alexepico@gmail.com> | 2024-12-13 10:24:16 +0800 |
|---|---|---|
| committer | Peng Wu <alexepico@gmail.com> | 2024-12-13 10:27:45 +0800 |
| commit | a857787b938a3bdd96776b7fc71223c2f18c0f89 (patch) | |
| tree | a1f082a6e3bc6aacd78a025d2bb92bf86eab965e /src | |
| parent | db736f56f35909a2d652656a044a72302481a429 (diff) | |
| download | ibus-libpinyin-a857787b938a3bdd96776b7fc71223c2f18c0f89.tar.gz ibus-libpinyin-a857787b938a3bdd96776b7fc71223c2f18c0f89.tar.xz ibus-libpinyin-a857787b938a3bdd96776b7fc71223c2f18c0f89.zip | |
Use show_message function
Diffstat (limited to 'src')
| -rw-r--r-- | src/PYPConfig.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc index 548fbff..04a995a 100644 --- a/src/PYPConfig.cc +++ b/src/PYPConfig.cc @@ -20,8 +20,10 @@ #include "PYPConfig.h" #include <string.h> +#include <libintl.h> #include <pinyin.h> #include "PYBus.h" +#include "PYXMLUtil.h" #include "PYLibPinyin.h" #include "PYTableDatabase.h" @@ -29,6 +31,9 @@ namespace PY { +#define _(text) (dgettext (GETTEXT_PACKAGE, text)) +#define N_(text) text + const gchar * const CONFIG_CORRECT_PINYIN = "correct-pinyin"; const gchar * const CONFIG_FUZZY_PINYIN = "fuzzy-pinyin"; const gchar * const CONFIG_ORIENTATION = "lookup-table-orientation"; @@ -675,11 +680,13 @@ PinyinConfig::valueChanged (const std::string &schema_id, std::string filename = normalizeGVariant (value, std::string("")); if (!filename.empty ()) TableDatabase::userInstance ().importTable (filename.c_str ()); + show_message (_("The table file is imported."), NULL); } else if (CONFIG_EXPORT_CUSTOM_TABLE == name) { std::string filename = normalizeGVariant (value, std::string("")); if (!filename.empty ()) TableDatabase::userInstance ().exportTable (filename.c_str ()); + show_message (_("The table file is exported."), NULL); } else if (CONFIG_CLEAR_CUSTOM_TABLE == name) { std::string target = normalizeGVariant (value, std::string("")); @@ -690,11 +697,13 @@ PinyinConfig::valueChanged (const std::string &schema_id, std::string filename = normalizeGVariant (value, std::string("")); if (!filename.empty ()) LibPinyinBackEnd::instance ().importPinyinDictionary (filename.c_str ()); + show_message (_("The pinyin dictionary file is imported."), NULL); } else if (CONFIG_EXPORT_DICTIONARY == name) { std::string filename = normalizeGVariant (value, std::string("")); if (!filename.empty ()) LibPinyinBackEnd::instance ().exportPinyinDictionary (filename.c_str ()); + show_message (_("The pinyin dictionary file is exported."), NULL); } else if (CONFIG_CLEAR_USER_DATA == name) { std::string target = normalizeGVariant (value, std::string("")); |
