From a857787b938a3bdd96776b7fc71223c2f18c0f89 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 13 Dec 2024 10:24:16 +0800 Subject: [PATCH] Use show_message function --- src/PYPConfig.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc index 548fbff5..04a995aa 100644 --- a/src/PYPConfig.cc +++ b/src/PYPConfig.cc @@ -20,8 +20,10 @@ #include "PYPConfig.h" #include +#include #include #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(""));