summaryrefslogtreecommitdiffstats
path: root/src/PYStrokeEditor.cc
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-08-02 11:24:39 +0800
committerPeng Wu <alexepico@gmail.com>2012-08-02 15:49:29 +0800
commit07ae7e85a27089238363c23c83e89b7c6f5393b6 (patch)
tree946a7a6f43eb2e1f1733dea6c90a729e25b465ba /src/PYStrokeEditor.cc
parent88e6f403b0ed6a4eb33737c642d12b6fd462531b (diff)
downloadibus-libpinyin-07ae7e85a27089238363c23c83e89b7c6f5393b6.tar.gz
ibus-libpinyin-07ae7e85a27089238363c23c83e89b7c6f5393b6.tar.xz
ibus-libpinyin-07ae7e85a27089238363c23c83e89b7c6f5393b6.zip
polish aux text
Diffstat (limited to 'src/PYStrokeEditor.cc')
-rw-r--r--src/PYStrokeEditor.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/PYStrokeEditor.cc b/src/PYStrokeEditor.cc
index b2dfe22..252dddd 100644
--- a/src/PYStrokeEditor.cc
+++ b/src/PYStrokeEditor.cc
@@ -23,12 +23,16 @@
#include <string.h>
#include <string>
#include <vector>
+#include <libintl.h>
#include <glib.h>
#include <sqlite3.h>
#include "PYString.h"
#include "PYConfig.h"
+#define _(text) (gettext (text))
+
namespace PY {
+
class StrokeDatabase{
public:
StrokeDatabase(){
@@ -378,6 +382,14 @@ StrokeEditor::updateStateFromInput (void)
m_auxiliary_text = "u";
if (1 == m_text.length ()) {
clearLookupTable ();
+
+ const char * help_string =
+ _("Please use \"hspnz\" to input.");
+ int space_len = std::max ( 0, m_aux_text_len
+ - (int) g_utf8_strlen (help_string, -1));
+ m_auxiliary_text.append(space_len, ' ');
+ m_auxiliary_text += help_string;
+
return TRUE;
}