diff options
| author | Peng Huang <shawn.p.huang@gmail.com> | 2010-04-15 15:24:26 +0800 |
|---|---|---|
| committer | Peng Huang <shawn.p.huang@gmail.com> | 2010-04-15 15:25:26 +0800 |
| commit | 9e5ecb8182be4e5a7c91cb92e9c5c64ed63fe8a2 (patch) | |
| tree | d83120974e4b036428ea40ac9b7de3a00568159f | |
| parent | 547f5f2edf23027731a3e9f13f2de60a32224c9f (diff) | |
Add special phrases in setup ui
| -rw-r--r-- | po/ru.po | 164 | ||||
| -rw-r--r-- | po/zh_CN.po | 151 | ||||
| -rw-r--r-- | setup/ibus-pinyin-preferences.ui | 361 | ||||
| -rw-r--r-- | setup/main.py | 78 | ||||
| -rw-r--r-- | src/Config.cc | 5 | ||||
| -rw-r--r-- | src/Config.h | 2 | ||||
| -rw-r--r-- | src/SpecialPhraseTable.cc | 3 | ||||
| -rw-r--r-- | src/phrases.txt | 2 |
8 files changed, 489 insertions, 277 deletions
@@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-15 13:51+0800\n" +"POT-Creation-Date: 2010-04-15 15:24+0800\n" "PO-Revision-Date: 2009-10-14 09:44+0300\n" "Last-Translator: Alexey Kotlyarov <koterpillar@gmail.com>\n" "Language-Team: Russian\n" @@ -31,7 +31,7 @@ msgstr "Пиньинь" msgid "Pinyin input method (debug)" msgstr "Метод ввода пиньинь" -#: ../src/PinyinProperties.cc:21 ../setup/ibus-pinyin-preferences.ui.h:10 +#: ../src/PinyinProperties.cc:21 ../setup/ibus-pinyin-preferences.ui.h:12 msgid "Chinese" msgstr "Китайский" @@ -48,172 +48,170 @@ msgid "Simplfied/Traditional Chinese" msgstr "Упрощенные/традиционные иероглифы" #: ../src/PinyinProperties.cc:69 ../src/PinyinProperties.cc:71 -#: ../setup/ibus-pinyin-preferences.ui.h:34 +#: ../setup/ibus-pinyin-preferences.ui.h:36 msgid "Pinyin preferences" msgstr "Настройки пиньиня" -#: ../setup/main.py:39 ../setup/ibus-pinyin-preferences.ui.h:5 +#: ../setup/main.py:253 ../setup/ibus-pinyin-preferences.ui.h:7 #, no-c-format, python-format msgid "<big><b>IBus Pinyin %s</b></big>" msgstr "<big><b>IBus Пиньинь %s</b></big>" #: ../setup/ibus-pinyin-preferences.ui.h:1 +#, fuzzy +msgid "<b>Dictionary option</b>" +msgstr "<b>Другие</b>" + +#: ../setup/ibus-pinyin-preferences.ui.h:2 msgid "<b>Initial state</b>" msgstr "<b>Начальное состояние</b>" -#: ../setup/ibus-pinyin-preferences.ui.h:2 +#: ../setup/ibus-pinyin-preferences.ui.h:3 msgid "<b>Others</b>" msgstr "<b>Другие</b>" -#: ../setup/ibus-pinyin-preferences.ui.h:3 +#: ../setup/ibus-pinyin-preferences.ui.h:4 #, fuzzy msgid "<b>Pinyin mode</b>" msgstr "<b>Пиньинь</b>" -#: ../setup/ibus-pinyin-preferences.ui.h:6 +#: ../setup/ibus-pinyin-preferences.ui.h:5 +#, fuzzy +msgid "<b>UI</b>" +msgstr "<b>Другие</b>" + +#: ../setup/ibus-pinyin-preferences.ui.h:8 msgid "" "<small>Copyright © 2009 Peng Huang <shawn.p.huang@gmail.com></" "small>" msgstr "" "<small>Copyright © 2009 Хуан Пэн <shawn.p.huang@gmail.com></small>" -#: ../setup/ibus-pinyin-preferences.ui.h:7 +#: ../setup/ibus-pinyin-preferences.ui.h:9 msgid "ABC" msgstr "ABC" -#: ../setup/ibus-pinyin-preferences.ui.h:8 +#: ../setup/ibus-pinyin-preferences.ui.h:10 msgid "About" msgstr "О программе" -#: ../setup/ibus-pinyin-preferences.ui.h:9 +#: ../setup/ibus-pinyin-preferences.ui.h:11 msgid "Auto commit" msgstr "Автоматически подтверждать фразу" -#: ../setup/ibus-pinyin-preferences.ui.h:11 +#: ../setup/ibus-pinyin-preferences.ui.h:13 msgid "Chinese:" msgstr "Иероглифы:" -#: ../setup/ibus-pinyin-preferences.ui.h:12 +#: ../setup/ibus-pinyin-preferences.ui.h:14 msgid "Correct pinyin" msgstr "Исправления" -#: ../setup/ibus-pinyin-preferences.ui.h:13 +#: ../setup/ibus-pinyin-preferences.ui.h:15 msgid "Dictionary" msgstr "" -#: ../setup/ibus-pinyin-preferences.ui.h:14 +#: ../setup/ibus-pinyin-preferences.ui.h:16 msgid "Double pinyin" msgstr "Двойной пиньинь" -#: ../setup/ibus-pinyin-preferences.ui.h:15 -msgid "Enable automatic commit phrase." -msgstr "Подтверждать набранную фразу при вводе знаков препинания." +#: ../setup/ibus-pinyin-preferences.ui.h:17 +msgid "Edit custom phrases" +msgstr "" -#: ../setup/ibus-pinyin-preferences.ui.h:16 +#: ../setup/ibus-pinyin-preferences.ui.h:18 msgid "Enable fuzzy pinyin." msgstr "Включить нечеткий пиньинь." -#: ../setup/ibus-pinyin-preferences.ui.h:17 +#: ../setup/ibus-pinyin-preferences.ui.h:19 msgid "Enable incomplete pinyin (like zh g)." msgstr "Включить неполный пиньинь (например, zh g)." -#: ../setup/ibus-pinyin-preferences.ui.h:18 +#: ../setup/ibus-pinyin-preferences.ui.h:20 msgid "Enable pinyin correcting." msgstr "Включить исправление пиньиня." -#: ../setup/ibus-pinyin-preferences.ui.h:19 +#: ../setup/ibus-pinyin-preferences.ui.h:21 msgid "English" msgstr "Английский" -#: ../setup/ibus-pinyin-preferences.ui.h:20 +#: ../setup/ibus-pinyin-preferences.ui.h:22 msgid "Full" msgstr "Полная" -#: ../setup/ibus-pinyin-preferences.ui.h:21 +#: ../setup/ibus-pinyin-preferences.ui.h:23 msgid "Full pinyin" msgstr "Полный пиньинь" -#: ../setup/ibus-pinyin-preferences.ui.h:22 +#: ../setup/ibus-pinyin-preferences.ui.h:24 msgid "Fuzzy pinyin" msgstr "Нечеткий пиньинь" -#: ../setup/ibus-pinyin-preferences.ui.h:23 -msgid "General" -msgstr "Общие" - -#: ../setup/ibus-pinyin-preferences.ui.h:24 +#: ../setup/ibus-pinyin-preferences.ui.h:25 msgid "Half" msgstr "Половинная" -#: ../setup/ibus-pinyin-preferences.ui.h:25 +#: ../setup/ibus-pinyin-preferences.ui.h:26 msgid "Half/full width:" msgstr "Полная/половинная ширина:" -#: ../setup/ibus-pinyin-preferences.ui.h:26 +#: ../setup/ibus-pinyin-preferences.ui.h:27 msgid "Horizontal" msgstr "" -#: ../setup/ibus-pinyin-preferences.ui.h:27 +#: ../setup/ibus-pinyin-preferences.ui.h:28 msgid "Incomplete pinyin" msgstr "Неполный пиньинь" -#: ../setup/ibus-pinyin-preferences.ui.h:28 +#: ../setup/ibus-pinyin-preferences.ui.h:29 msgid "Language:" msgstr "Язык:" -#: ../setup/ibus-pinyin-preferences.ui.h:29 +#: ../setup/ibus-pinyin-preferences.ui.h:30 msgid "MSPY" msgstr "MSPY" -#: ../setup/ibus-pinyin-preferences.ui.h:30 +#: ../setup/ibus-pinyin-preferences.ui.h:31 msgid "Number of candidates:" msgstr "Число кандидатов" -#: ../setup/ibus-pinyin-preferences.ui.h:31 +#: ../setup/ibus-pinyin-preferences.ui.h:32 msgid "Orientation of candidates:" msgstr "Число кандидатов" -#: ../setup/ibus-pinyin-preferences.ui.h:32 +#: ../setup/ibus-pinyin-preferences.ui.h:33 msgid "PYJJ" msgstr "PYJJ" -#: ../setup/ibus-pinyin-preferences.ui.h:33 +#: ../setup/ibus-pinyin-preferences.ui.h:34 msgid "Pinyin input method for IBus" msgstr "Метод ввода пиньинь для IBus" #: ../setup/ibus-pinyin-preferences.ui.h:35 +#, fuzzy +msgid "Pinyin mode" +msgstr "<b>Пиньинь</b>" + +#: ../setup/ibus-pinyin-preferences.ui.h:37 msgid "Punctuations:" msgstr "Знаки препинания:" -#: ../setup/ibus-pinyin-preferences.ui.h:36 +#: ../setup/ibus-pinyin-preferences.ui.h:38 msgid "Schema:" msgstr "Схема:" -#: ../setup/ibus-pinyin-preferences.ui.h:37 +#: ../setup/ibus-pinyin-preferences.ui.h:39 msgid "Select double pinyin schema." msgstr "Выбор схемы двойного пиньиня." -#: ../setup/ibus-pinyin-preferences.ui.h:38 +#: ../setup/ibus-pinyin-preferences.ui.h:40 msgid "Setup the initial state of pinyin input method." msgstr "Настройка начального состояния метода ввода." -#: ../setup/ibus-pinyin-preferences.ui.h:39 -msgid "Setup the number of candidates show in one page of lookup table." -msgstr "Число кандидатов на одной странице таблицы поиска." - -#: ../setup/ibus-pinyin-preferences.ui.h:40 +#: ../setup/ibus-pinyin-preferences.ui.h:41 msgid "Show candidates in traditional Chinese" msgstr "Показывать кандидаты традиционными иероглифами." -#: ../setup/ibus-pinyin-preferences.ui.h:41 -#, fuzzy -msgid "" -"Show candidates in traditional Chinese, if the input method is in " -"traditional Chinese inputing mode." -msgstr "" -"Показывать кандидаты традиционными иероглифами, если включен ввод " -"традиционных иероглифов." - #: ../setup/ibus-pinyin-preferences.ui.h:42 msgid "Show raw input of Double Pinyin" msgstr "" @@ -227,14 +225,12 @@ msgid "Traditional" msgstr "Традиционные" #: ../setup/ibus-pinyin-preferences.ui.h:45 -msgid "Use [,] [.] key to page up/down the lookup table." +msgid "UI" msgstr "" -"Использовать клавиши [,] [.] для перемещения вверх-вниз по таблице поиска." #: ../setup/ibus-pinyin-preferences.ui.h:46 -msgid "Use [-] [=] key to page up/down the lookup table." +msgid "Use custom phrases" msgstr "" -"Использовать клавиши [-] [=] для перемещения вверх-вниз по таблице поиска." #: ../setup/ibus-pinyin-preferences.ui.h:47 msgid "Use double pinyin." @@ -245,40 +241,64 @@ msgid "Use full pinyin." msgstr "Использовать полный пиньинь." #: ../setup/ibus-pinyin-preferences.ui.h:49 -msgid "" -"Use left and right shift keys to select the second and thrid candidates." -msgstr "" -"Использовать клавиши \"влево\" и \"вправо\" для выбора второго и третьего " -"кандидатов" - -#: ../setup/ibus-pinyin-preferences.ui.h:50 msgid "Vertical" msgstr "" -#: ../setup/ibus-pinyin-preferences.ui.h:51 +#: ../setup/ibus-pinyin-preferences.ui.h:50 msgid "ZGPY" msgstr "ZGPY" -#: ../setup/ibus-pinyin-preferences.ui.h:52 +#: ../setup/ibus-pinyin-preferences.ui.h:51 msgid "ZRM" msgstr "ZRM" -#: ../setup/ibus-pinyin-preferences.ui.h:53 +#: ../setup/ibus-pinyin-preferences.ui.h:52 msgid "[,] [.] flip page" msgstr "Использовать клавиши [,] [.] для переключения страниц" -#: ../setup/ibus-pinyin-preferences.ui.h:54 +#: ../setup/ibus-pinyin-preferences.ui.h:53 msgid "[-] [=] flip page" msgstr "Использовать клавиши [-] [=] для переключения страниц" -#: ../setup/ibus-pinyin-preferences.ui.h:55 +#: ../setup/ibus-pinyin-preferences.ui.h:54 msgid "[Shift] select candidate" msgstr "Использовать [Shift] для выбора кандидатов" -#: ../setup/ibus-pinyin-preferences.ui.h:56 +#: ../setup/ibus-pinyin-preferences.ui.h:55 msgid "http://ibus.googlecode.com" msgstr "http://ibus.googlecode.com" +#~ msgid "Enable automatic commit phrase." +#~ msgstr "Подтверждать набранную фразу при вводе знаков препинания." + +#~ msgid "Setup the number of candidates show in one page of lookup table." +#~ msgstr "Число кандидатов на одной странице таблицы поиска." + +#, fuzzy +#~ msgid "" +#~ "Show candidates in traditional Chinese, if the input method is in " +#~ "traditional Chinese inputing mode." +#~ msgstr "" +#~ "Показывать кандидаты традиционными иероглифами, если включен ввод " +#~ "традиционных иероглифов." + +#~ msgid "Use [,] [.] key to page up/down the lookup table." +#~ msgstr "" +#~ "Использовать клавиши [,] [.] для перемещения вверх-вниз по таблице поиска." + +#~ msgid "Use [-] [=] key to page up/down the lookup table." +#~ msgstr "" +#~ "Использовать клавиши [-] [=] для перемещения вверх-вниз по таблице поиска." + +#~ msgid "" +#~ "Use left and right shift keys to select the second and thrid candidates." +#~ msgstr "" +#~ "Использовать клавиши \"влево\" и \"вправо\" для выбора второго и третьего " +#~ "кандидатов" + +#~ msgid "General" +#~ msgstr "Общие" + #~ msgid "+-*/=%" #~ msgstr "+-*/=%" diff --git a/po/zh_CN.po b/po/zh_CN.po index 7d2a992..d7a8c16 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ibus-pinyin 1.2.99\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-04-15 13:51+0800\n" +"POT-Creation-Date: 2010-04-15 15:24+0800\n" "PO-Revision-Date: 2009-09-20 16:05+8\n" "Last-Translator: Peng Huang <shawn.p.huang@gmail.com>\n" "Language-Team: Peng Huang <shawn.p.huang@gmail.com>\n" @@ -27,7 +27,7 @@ msgstr "拼音(调试)" msgid "Pinyin input method (debug)" msgstr "拼音输入法(调试)" -#: ../src/PinyinProperties.cc:21 ../setup/ibus-pinyin-preferences.ui.h:10 +#: ../src/PinyinProperties.cc:21 ../setup/ibus-pinyin-preferences.ui.h:12 msgid "Chinese" msgstr "中文" @@ -44,167 +44,165 @@ msgid "Simplfied/Traditional Chinese" msgstr "简体/繁体中文" #: ../src/PinyinProperties.cc:69 ../src/PinyinProperties.cc:71 -#: ../setup/ibus-pinyin-preferences.ui.h:34 +#: ../setup/ibus-pinyin-preferences.ui.h:36 msgid "Pinyin preferences" msgstr "拼音首选项" -#: ../setup/main.py:39 ../setup/ibus-pinyin-preferences.ui.h:5 +#: ../setup/main.py:253 ../setup/ibus-pinyin-preferences.ui.h:7 #, no-c-format, python-format msgid "<big><b>IBus Pinyin %s</b></big>" msgstr "<big><b>IBus 拼音 %s</b></big>" #: ../setup/ibus-pinyin-preferences.ui.h:1 +msgid "<b>Dictionary option</b>" +msgstr "<b>词典选项</b>" + +#: ../setup/ibus-pinyin-preferences.ui.h:2 msgid "<b>Initial state</b>" msgstr "<b>初始状态</b>" -#: ../setup/ibus-pinyin-preferences.ui.h:2 +#: ../setup/ibus-pinyin-preferences.ui.h:3 msgid "<b>Others</b>" msgstr "<b>其他</b>" -#: ../setup/ibus-pinyin-preferences.ui.h:3 +#: ../setup/ibus-pinyin-preferences.ui.h:4 msgid "<b>Pinyin mode</b>" msgstr "<b>拼音模式</b>" -#: ../setup/ibus-pinyin-preferences.ui.h:6 +#: ../setup/ibus-pinyin-preferences.ui.h:5 +msgid "<b>UI</b>" +msgstr "<b>外观</b>" + +#: ../setup/ibus-pinyin-preferences.ui.h:8 msgid "" "<small>Copyright © 2009 Peng Huang <shawn.p.huang@gmail.com></" "small>" msgstr "<small>版权所有 © 2009 黄鹏 <shawn.p.huang@gmail.com></small>" -#: ../setup/ibus-pinyin-preferences.ui.h:7 +#: ../setup/ibus-pinyin-preferences.ui.h:9 msgid "ABC" msgstr "智能ABC" -#: ../setup/ibus-pinyin-preferences.ui.h:8 +#: ../setup/ibus-pinyin-preferences.ui.h:10 msgid "About" msgstr "关于" -#: ../setup/ibus-pinyin-preferences.ui.h:9 +#: ../setup/ibus-pinyin-preferences.ui.h:11 msgid "Auto commit" msgstr "自动上词" -#: ../setup/ibus-pinyin-preferences.ui.h:11 +#: ../setup/ibus-pinyin-preferences.ui.h:13 msgid "Chinese:" msgstr "中文:" -#: ../setup/ibus-pinyin-preferences.ui.h:12 +#: ../setup/ibus-pinyin-preferences.ui.h:14 msgid "Correct pinyin" msgstr "拼音纠错" -#: ../setup/ibus-pinyin-preferences.ui.h:13 +#: ../setup/ibus-pinyin-preferences.ui.h:15 msgid "Dictionary" msgstr "词典" -#: ../setup/ibus-pinyin-preferences.ui.h:14 +#: ../setup/ibus-pinyin-preferences.ui.h:16 msgid "Double pinyin" msgstr "双拼" -#: ../setup/ibus-pinyin-preferences.ui.h:15 -msgid "Enable automatic commit phrase." -msgstr "启动自动上词。" +#: ../setup/ibus-pinyin-preferences.ui.h:17 +msgid "Edit custom phrases" +msgstr "编辑自定义词组" -#: ../setup/ibus-pinyin-preferences.ui.h:16 +#: ../setup/ibus-pinyin-preferences.ui.h:18 msgid "Enable fuzzy pinyin." msgstr "启动模糊拼音。" -#: ../setup/ibus-pinyin-preferences.ui.h:17 +#: ../setup/ibus-pinyin-preferences.ui.h:19 msgid "Enable incomplete pinyin (like zh g)." msgstr "支持不完全拼音(例如:zh g)。" -#: ../setup/ibus-pinyin-preferences.ui.h:18 +#: ../setup/ibus-pinyin-preferences.ui.h:20 msgid "Enable pinyin correcting." msgstr "启动拼音纠错。" -#: ../setup/ibus-pinyin-preferences.ui.h:19 +#: ../setup/ibus-pinyin-preferences.ui.h:21 msgid "English" msgstr "英文" -#: ../setup/ibus-pinyin-preferences.ui.h:20 +#: ../setup/ibus-pinyin-preferences.ui.h:22 msgid "Full" msgstr "全角" -#: ../setup/ibus-pinyin-preferences.ui.h:21 +#: ../setup/ibus-pinyin-preferences.ui.h:23 msgid "Full pinyin" msgstr "全拼" -#: ../setup/ibus-pinyin-preferences.ui.h:22 +#: ../setup/ibus-pinyin-preferences.ui.h:24 msgid "Fuzzy pinyin" msgstr "模糊拼音" -#: ../setup/ibus-pinyin-preferences.ui.h:23 -msgid "General" -msgstr "常规" - -#: ../setup/ibus-pinyin-preferences.ui.h:24 +#: ../setup/ibus-pinyin-preferences.ui.h:25 msgid "Half" msgstr "半角" -#: ../setup/ibus-pinyin-preferences.ui.h:25 +#: ../setup/ibus-pinyin-preferences.ui.h:26 msgid "Half/full width:" msgstr "全角/半角:" -#: ../setup/ibus-pinyin-preferences.ui.h:26 +#: ../setup/ibus-pinyin-preferences.ui.h:27 msgid "Horizontal" msgstr "水平" -#: ../setup/ibus-pinyin-preferences.ui.h:27 +#: ../setup/ibus-pinyin-preferences.ui.h:28 msgid "Incomplete pinyin" msgstr "简拼" -#: ../setup/ibus-pinyin-preferences.ui.h:28 +#: ../setup/ibus-pinyin-preferences.ui.h:29 msgid "Language:" msgstr "语言:" -#: ../setup/ibus-pinyin-preferences.ui.h:29 +#: ../setup/ibus-pinyin-preferences.ui.h:30 msgid "MSPY" msgstr "微软拼音" -#: ../setup/ibus-pinyin-preferences.ui.h:30 +#: ../setup/ibus-pinyin-preferences.ui.h:31 msgid "Number of candidates:" msgstr "每页显示候选词数:" -#: ../setup/ibus-pinyin-preferences.ui.h:31 +#: ../setup/ibus-pinyin-preferences.ui.h:32 msgid "Orientation of candidates:" msgstr "候选词排列方向:" -#: ../setup/ibus-pinyin-preferences.ui.h:32 +#: ../setup/ibus-pinyin-preferences.ui.h:33 msgid "PYJJ" msgstr "拼音加加" -#: ../setup/ibus-pinyin-preferences.ui.h:33 +#: ../setup/ibus-pinyin-preferences.ui.h:34 msgid "Pinyin input method for IBus" msgstr "IBus 拼音输入法" #: ../setup/ibus-pinyin-preferences.ui.h:35 +msgid "Pinyin mode" +msgstr "拼音模式" + +#: ../setup/ibus-pinyin-preferences.ui.h:37 msgid "Punctuations:" msgstr "标点符号:" -#: ../setup/ibus-pinyin-preferences.ui.h:36 +#: ../setup/ibus-pinyin-preferences.ui.h:38 msgid "Schema:" msgstr "双拼方案:" -#: ../setup/ibus-pinyin-preferences.ui.h:37 +#: ../setup/ibus-pinyin-preferences.ui.h:39 msgid "Select double pinyin schema." msgstr "选择双拼模式。" -#: ../setup/ibus-pinyin-preferences.ui.h:38 +#: ../setup/ibus-pinyin-preferences.ui.h:40 msgid "Setup the initial state of pinyin input method." msgstr "设置拼音输入法初始状态。" -#: ../setup/ibus-pinyin-preferences.ui.h:39 -msgid "Setup the number of candidates show in one page of lookup table." -msgstr "设置每页显示后先词数量。" - -#: ../setup/ibus-pinyin-preferences.ui.h:40 +#: ../setup/ibus-pinyin-preferences.ui.h:41 msgid "Show candidates in traditional Chinese" msgstr "显示繁体候选词" -#: ../setup/ibus-pinyin-preferences.ui.h:41 -msgid "" -"Show candidates in traditional Chinese, if the input method is in " -"traditional Chinese inputing mode." -msgstr "当输入法处于繁体模式时,使用繁体候选词。" - #: ../setup/ibus-pinyin-preferences.ui.h:42 msgid "Show raw input of Double Pinyin" msgstr "显示双拼原始输入" @@ -218,12 +216,12 @@ msgid "Traditional" msgstr "繁体" #: ../setup/ibus-pinyin-preferences.ui.h:45 -msgid "Use [,] [.] key to page up/down the lookup table." -msgstr "按[,][.]键翻页。" +msgid "UI" +msgstr "外观" #: ../setup/ibus-pinyin-preferences.ui.h:46 -msgid "Use [-] [=] key to page up/down the lookup table." -msgstr "使用[-][=]键翻页。" +msgid "Use custom phrases" +msgstr "使用自定义词组" #: ../setup/ibus-pinyin-preferences.ui.h:47 msgid "Use double pinyin." @@ -234,38 +232,57 @@ msgid "Use full pinyin." msgstr "使用全拼。" #: ../setup/ibus-pinyin-preferences.ui.h:49 -msgid "" -"Use left and right shift keys to select the second and thrid candidates." -msgstr "使用左右[shift]键选择第二个和第三个候选词。" - -#: ../setup/ibus-pinyin-preferences.ui.h:50 msgid "Vertical" msgstr "竖直" -#: ../setup/ibus-pinyin-preferences.ui.h:51 +#: ../setup/ibus-pinyin-preferences.ui.h:50 msgid "ZGPY" msgstr "紫光拼音" -#: ../setup/ibus-pinyin-preferences.ui.h:52 +#: ../setup/ibus-pinyin-preferences.ui.h:51 msgid "ZRM" msgstr "自然码" -#: ../setup/ibus-pinyin-preferences.ui.h:53 +#: ../setup/ibus-pinyin-preferences.ui.h:52 msgid "[,] [.] flip page" msgstr "[,][.]键翻页" -#: ../setup/ibus-pinyin-preferences.ui.h:54 +#: ../setup/ibus-pinyin-preferences.ui.h:53 msgid "[-] [=] flip page" msgstr "[-][=]键翻页" -#: ../setup/ibus-pinyin-preferences.ui.h:55 +#: ../setup/ibus-pinyin-preferences.ui.h:54 msgid "[Shift] select candidate" msgstr "[Shift]键选词" -#: ../setup/ibus-pinyin-preferences.ui.h:56 +#: ../setup/ibus-pinyin-preferences.ui.h:55 msgid "http://ibus.googlecode.com" msgstr "http://ibus.googlecode.com" +#~ msgid "Enable automatic commit phrase." +#~ msgstr "启动自动上词。" + +#~ msgid "Setup the number of candidates show in one page of lookup table." +#~ msgstr "设置每页显示后先词数量。" + +#~ msgid "" +#~ "Show candidates in traditional Chinese, if the input method is in " +#~ "traditional Chinese inputing mode." +#~ msgstr "当输入法处于繁体模式时,使用繁体候选词。" + +#~ msgid "Use [,] [.] key to page up/down the lookup table." +#~ msgstr "按[,][.]键翻页。" + +#~ msgid "Use [-] [=] key to page up/down the lookup table." +#~ msgstr "使用[-][=]键翻页。" + +#~ msgid "" +#~ "Use left and right shift keys to select the second and thrid candidates." +#~ msgstr "使用左右[shift]键选择第二个和第三个候选词。" + +#~ msgid "General" +#~ msgstr "常规" + #~ msgid "+-*/=%" #~ msgstr "+-*/=%" diff --git a/setup/ibus-pinyin-preferences.ui b/setup/ibus-pinyin-preferences.ui index b5a2dc1..91f6a33 100644 --- a/setup/ibus-pinyin-preferences.ui +++ b/setup/ibus-pinyin-preferences.ui @@ -363,90 +363,24 @@ </packing> </child> <child> - <object class="GtkFrame" id="frame5"> + <object class="GtkFrame" id="frame6"> <property name="visible">True</property> <property name="label_xalign">0</property> <property name="shadow_type">none</property> <child> - <object class="GtkAlignment" id="alignment8"> + <object class="GtkAlignment" id="alignment11"> <property name="visible">True</property> <property name="top_padding">6</property> <property name="left_padding">12</property> <child> - <object class="GtkVBox" id="vbox8"> + <object class="GtkVBox" id="vbox11"> <property name="visible">True</property> <property name="orientation">vertical</property> <property name="spacing">6</property> <child> - <object class="GtkHBox" id="hbox3"> - <property name="visible">True</property> - <property name="spacing">12</property> - <property name="homogeneous">True</property> - <child> - <object class="GtkLabel" id="label4"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Orientation of candidates:</property> - <property name="use_markup">True</property> - </object> - <packing> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkComboBox" id="LookupTableOrientation"> - <property name="visible">True</property> - <property name="model">liststoreLookupTableOrientation</property> - <property name="button_sensitivity">on</property> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="hbox4"> - <property name="visible">True</property> - <property name="spacing">12</property> - <property name="homogeneous">True</property> - <child> - <object class="GtkLabel" id="label16"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Number of candidates:</property> - <property name="use_markup">True</property> - </object> - <packing> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHScale" id="hscaleLookupTablePageSize"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">Setup the number of candidates show in one page of lookup table.</property> - <property name="update_policy">delayed</property> - <property name="adjustment">LookupTablePageSize</property> - <property name="digits">0</property> - <property name="value_pos">left</property> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkTable" id="table5"> + <object class="GtkTable" id="table2"> <property name="visible">True</property> - <property name="n_rows">4</property> + <property name="n_rows">2</property> <property name="n_columns">2</property> <property name="column_spacing">6</property> <property name="row_spacing">6</property> @@ -457,7 +391,6 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">Use left and right shift keys to select the second and thrid candidates.</property> <property name="draw_indicator">True</property> </object> </child> @@ -467,7 +400,6 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">Use [-] [=] key to page up/down the lookup table.</property> <property name="active">True</property> <property name="draw_indicator">True</property> </object> @@ -482,7 +414,6 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">Use [,] [.] key to page up/down the lookup table.</property> <property name="active">True</property> <property name="draw_indicator">True</property> </object> @@ -497,7 +428,6 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">Enable automatic commit phrase.</property> <property name="draw_indicator">True</property> </object> <packing> @@ -507,41 +437,156 @@ <property name="bottom_attach">2</property> </packing> </child> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label20"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Others</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">2</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="tab"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Pinyin mode</property> + </object> + <packing> + <property name="tab_fill">False</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment10"> + <property name="visible">True</property> + <property name="top_padding">12</property> + <property name="bottom_padding">12</property> + <property name="left_padding">12</property> + <property name="right_padding">12</property> + <child> + <object class="GtkVBox" id="vbox10"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkFrame" id="frame5"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment8"> + <property name="visible">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkVBox" id="vbox8"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkHBox" id="hbox3"> + <property name="visible">True</property> + <property name="spacing">12</property> + <property name="homogeneous">True</property> + <child> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Orientation of candidates:</property> + <property name="use_markup">True</property> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> <child> - <object class="GtkCheckButton" id="TradCandidate"> - <property name="label" translatable="yes">Show candidates in traditional Chinese</property> + <object class="GtkComboBox" id="LookupTableOrientation"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">Show candidates in traditional Chinese, if the input method is in traditional Chinese inputing mode.</property> - <property name="draw_indicator">True</property> + <property name="model">liststoreLookupTableOrientation</property> + <property name="button_sensitivity">on</property> </object> <packing> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> + <property name="position">1</property> </packing> </child> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="hbox4"> + <property name="visible">True</property> + <property name="spacing">12</property> + <property name="homogeneous">True</property> <child> - <object class="GtkCheckButton" id="DoublePinyinShowRaw"> - <property name="label" translatable="yes">Show raw input of Double Pinyin</property> + <object class="GtkLabel" id="label16"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Number of candidates:</property> + <property name="use_markup">True</property> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHScale" id="hscaleLookupTablePageSize"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes">Show raw input of Double Pinyin</property> - <property name="draw_indicator">True</property> + <property name="update_policy">delayed</property> + <property name="adjustment">LookupTablePageSize</property> + <property name="digits">0</property> + <property name="value_pos">left</property> </object> <packing> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="position">1</property> </packing> </child> </object> <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="TradCandidate"> + <property name="label" translatable="yes">Show candidates in traditional Chinese</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> <property name="position">2</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="DoublePinyinShowRaw"> + <property name="label" translatable="yes">Show raw input of Double Pinyin</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="position">3</property> + </packing> + </child> </object> </child> </object> @@ -549,26 +594,36 @@ <child type="label"> <object class="GtkLabel" id="label8"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Others</b></property> + <property name="label" translatable="yes"><b>UI</b></property> <property name="use_markup">True</property> </object> </child> </object> <packing> <property name="expand">False</property> - <property name="position">2</property> + <property name="position">0</property> </packing> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> </child> </object> + <packing> + <property name="position">1</property> + </packing> </child> <child type="tab"> - <object class="GtkLabel" id="label1"> + <object class="GtkLabel" id="label13"> <property name="visible">True</property> - <property name="label" translatable="yes">General</property> + <property name="label" translatable="yes">UI</property> </object> <packing> + <property name="position">1</property> <property name="tab_fill">False</property> </packing> </child> @@ -715,7 +770,7 @@ </child> </object> <packing> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child type="tab"> @@ -724,7 +779,7 @@ <property name="label" translatable="yes">Correct pinyin</property> </object> <packing> - <property name="position">1</property> + <property name="position">2</property> <property name="tab_fill">False</property> </packing> </child> @@ -1147,7 +1202,7 @@ </child> </object> <packing> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> <child type="tab"> @@ -1156,26 +1211,106 @@ <property name="label" translatable="yes">Fuzzy pinyin</property> </object> <packing> - <property name="position">2</property> + <property name="position">3</property> <property name="tab_fill">False</property> </packing> </child> <child> - <object class="GtkVBox" id="vbox5"> + <object class="GtkAlignment" id="alignment12"> <property name="visible">True</property> - <property name="orientation">vertical</property> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> + <property name="top_padding">12</property> + <property name="bottom_padding">12</property> + <property name="left_padding">12</property> + <property name="right_padding">12</property> <child> - <placeholder/> + <object class="GtkVBox" id="vbox5"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkFrame" id="frame7"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment13"> + <property name="visible">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkVBox" id="vbox12"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="spacing">12</property> + <child> + <object class="GtkCheckButton" id="SpecialPhrases"> + <property name="label" translatable="yes">Use custom phrases</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="EditSpecialPhrases"> + <property name="label" translatable="yes">Edit custom phrases</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label17"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Dictionary option</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> </child> </object> <packing> - <property name="position">3</property> + <property name="position">4</property> </packing> </child> <child type="tab"> @@ -1184,7 +1319,7 @@ <property name="label" translatable="yes">Dictionary</property> </object> <packing> - <property name="position">3</property> + <property name="position">4</property> <property name="tab_fill">False</property> </packing> </child> @@ -1275,7 +1410,7 @@ </child> </object> <packing> - <property name="position">4</property> + <property name="position">5</property> </packing> </child> <child type="tab"> @@ -1284,7 +1419,7 @@ <property name="label" translatable="yes">About</property> </object> <packing> - <property name="position">4</property> + <property name="position">5</property> <property name="tab_fill">False</property> </packing> </child> diff --git a/setup/main.py b/setup/main.py index fed0c83..29769d4 100644 --- a/setup/main.py +++ b/setup/main.py @@ -4,6 +4,7 @@ import locale import os import version import gettext +from xdg import BaseDirectory _ = lambda a : gettext.dgettext("ibus-pinyin", a) @@ -24,8 +25,11 @@ class PreferencesDialog: self.__init_pinyin() self.__init_init_state() self.__init_others() + self.__init_ui() self.__init_correct_pinyin() self.__init_fuzzy_pinyin() + self.__init_dictionary() + self.__init_about() def __init_pinyin(self): # pinyin @@ -35,8 +39,6 @@ class PreferencesDialog: self.__double_pinyin_schema = self.__builder.get_object("DoublePinyinSchema") self.__double_pinyin_schema_label = self.__builder.get_object("labelDoublePinyinSchema") self.__double_pinyin_show_raw = self.__builder.get_object("DoublePinyinShowRaw") - self.__name_version = self.__builder.get_object("NameVersion") - self.__name_version.set_markup(_("<big><b>IBus Pinyin %s</b></big>") % version.get_version()) renderer = gtk.CellRendererText() self.__double_pinyin_schema.pack_start(renderer) @@ -46,17 +48,14 @@ class PreferencesDialog: self.__incomplete_pinyin.set_active(self.__get_value("IncompletePinyin", True)) self.__full_pinyin.set_active(not self.__get_value("DoublePinyin", False)) self.__double_pinyin_schema.set_active(self.__get_value("DoublePinyinSchema", 0)) - self.__double_pinyin_show_raw.set_active(self.__get_value("DoublePinyinShowRaw", False)) if self.__full_pinyin.get_active(): # self.__incomplete_pinyin.set_sensitive(True) self.__double_pinyin_schema.set_sensitive(False) self.__double_pinyin_schema_label.set_sensitive(False) - self.__double_pinyin_show_raw.set_sensitive(False) else: # self.__incomplete_pinyin.set_sensitive(False) self.__double_pinyin_schema.set_sensitive(True) self.__double_pinyin_schema_label.set_sensitive(True) - self.__double_pinyin_show_raw.set_sensitive(True) def __full_pinyin_toggled_cb(widget): val = widget.get_active() @@ -104,27 +103,37 @@ class PreferencesDialog: self.__init_simp.connect("toggled", self.__toggled_cb, "InitSimplifiedChinese") def __init_others(self): - #others - self.__lookup_table_page_size = self.__builder.get_object("LookupTablePageSize") - self.__lookup_table_orientation = self.__builder.get_object("LookupTableOrientation") - - renderer = gtk.CellRendererText() - self.__lookup_table_orientation.pack_start(renderer) - self.__lookup_table_orientation.set_attributes(renderer, text=0) - + # others self.__shift_select_candidate = self.__builder.get_object("ShiftSelectCandidate") self.__minus_equal_page = self.__builder.get_object("MinusEqualPage") self.__comma_period_page = self.__builder.get_object("CommaPeriodPage") self.__auto_commit = self.__builder.get_object("AutoCommit") - self.__trad_candidate = self.__builder.get_object("TradCandidate") # read values - self.__lookup_table_orientation.set_active(self.__get_value("LookupTableOrientation", 0)) - self.__lookup_table_page_size.set_value(self.__get_value("LookupTablePageSize", 5)) self.__shift_select_candidate.set_active(self.__get_value("ShiftSelectCandidate", False)) self.__minus_equal_page.set_active(self.__get_value("MinusEqualPage", True)) self.__comma_period_page.set_active(self.__get_value("CommaPeriodPage", True)) self.__auto_commit.set_active(self.__get_value("AutoCommit", False)) + + # connect signals + self.__shift_select_candidate.connect("toggled", self.__toggled_cb, "ShiftSelectCandidate") + self.__minus_equal_page.connect("toggled", self.__toggled_cb, "MinusEqualPage") + self.__comma_period_page.connect("toggled", self.__toggled_cb, "CommaPeriodPage") + self.__auto_commit.connect("toggled", self.__toggled_cb, "AutoCommit") + + def __init_ui(self): + # UI + self.__lookup_table_page_size = self.__builder.get_object("LookupTablePageSize") + self.__lookup_table_orientation = self.__builder.get_object("LookupTableOrientation") + self.__trad_candidate = self.__builder.get_object("TradCandidate") + + renderer = gtk.CellRendererText() + self.__lookup_table_orientation.pack_start(renderer) + self.__lookup_table_orientation.set_attributes(renderer, text=0) + + # read values + self.__lookup_table_orientation.set_active(self.__get_value("LookupTableOrientation", 0)) + self.__lookup_table_page_size.set_value(self.__get_value("LookupTablePageSize", 5)) self.__trad_candidate.set_active(self.__get_value("TradCandidate", False)) # connect signals @@ -136,17 +145,8 @@ class PreferencesDialog: self.__lookup_table_orientation.connect("changed", __lookup_table_orientation_changed_cb) self.__lookup_table_page_size.connect("value-changed", __lookup_table_page_size_changed_cb) - - self.__shift_select_candidate.connect("toggled", self.__toggled_cb, "ShiftSelectCandidate") - self.__minus_equal_page.connect("toggled", self.__toggled_cb, "MinusEqualPage") - self.__comma_period_page.connect("toggled", self.__toggled_cb, "CommaPeriodPage") - self.__auto_commit.connect("toggled", self.__toggled_cb, "AutoCommit") self.__trad_candidate.connect("toggled", self.__toggled_cb, "TradCandidate") - def __entry_activate_cb(widget, name): - text = widget.get_text() - self.__set_value(name, text) - def __init_correct_pinyin(self): # auto correct self.__correct_pinyin = self.__builder.get_object("CorrectPinyin") @@ -224,6 +224,34 @@ class PreferencesDialog: widget = self.__builder.get_object(name) widget.connect("toggled", self.__toggled_cb, name) + def __init_dictionary(self): + # dictionary + self.__special_phrases = self.__builder.get_object("SpecialPhrases") + self.__edit_special_phrases = self.__builder.get_object("EditSpecialPhrases") + + # read values + self.__special_phrases.set_active(self.__get_value("SpecialPhrases", True)) + + def __edit_special_phrases_clicked_cb(widget): + from xdg import BaseDirectory + import shutil + path = os.path.join(BaseDirectory.xdg_config_home, "ibus", "pinyin") + os.path.exists(path) or os.makedirs(path) + path = os.path.join(path, "phrases.txt") + if not os.path.exists(path): + datadir = os.getenv("IBUS_DATAROOTDIR") or "/usr/share/ibus-pinyin" + src = os.path.join(datadir, "phrases.txt") + shutil.copyfile(src, path) + os.system("xdg-open %s" % path) + + # connect signals + self.__special_phrases.connect("toggled", self.__toggled_cb, "SpecialPhrases") + self.__edit_special_phrases.connect("clicked", __edit_special_phrases_clicked_cb) + + def __init_about(self): + self.__name_version = self.__builder.get_object("NameVersion") + self.__name_version.set_markup(_("<big><b>IBus Pinyin %s</b></big>") % version.get_version()) + def __changed_cb(self, widget, name): self.__set_value(name, widget.get_active()) diff --git a/src/Config.cc b/src/Config.cc index c328d8e..e01d40f 100644 --- a/src/Config.cc +++ b/src/Config.cc @@ -23,6 +23,7 @@ gboolean Config::m_init_full = FALSE; gboolean Config::m_init_full_punct = TRUE; gboolean Config::m_init_simp_chinese = TRUE; gboolean Config::m_trad_candidate = FALSE; +gboolean Config::m_special_phrases = TRUE; static const StaticString engine_pinyin ("engine/Pinyin"); static const StaticString correct_pinyin ("CorrectPinyin"); @@ -44,6 +45,7 @@ static const StaticString init_full ("InitFull"); static const StaticString init_full_punct ("InitFullPunct"); static const StaticString init_simp_chinese ("InitSimplifiedChinese"); static const StaticString trad_candidate ("TradCandidate"); +static const StaticString special_phrases ("SpecialPhrases"); static const struct { StaticString name; @@ -106,6 +108,7 @@ Config::readDefaultValues (void) m_init_simp_chinese = read (engine_pinyin, init_simp_chinese, true); m_trad_candidate = read (engine_pinyin, trad_candidate, false); + m_special_phrases = read (engine_pinyin, special_phrases, true); /* others */ m_orientation = read (engine_pinyin, PY::orientation, 0); @@ -216,6 +219,8 @@ Config::valueChangedCallback (IBusConfig *config, m_init_simp_chinese = normalizeGValue (value, true); else if (trad_candidate == name) m_trad_candidate = normalizeGValue (value, false); + else if (special_phrases == name) + m_special_phrases = normalizeGValue (value, true); /* lookup table page size */ else if (PY::orientation == name) { m_orientation = normalizeGValue (value, 0); diff --git a/src/Config.h b/src/Config.h index 5d0f83b..07f16f1 100644 --- a/src/Config.h +++ b/src/Config.h @@ -31,6 +31,7 @@ public: static gboolean initFullPunct (void) { return m_init_full_punct; } static gboolean initSimpChinese (void) { return m_init_simp_chinese; } static gboolean tradCandidate (void) { return m_trad_candidate; } + static gboolean specialPhrases (void) { return m_special_phrases; } private: bool read (const gchar *section, const gchar *name, bool defval); @@ -65,6 +66,7 @@ private: static gboolean m_init_full_punct; static gboolean m_init_simp_chinese; static gboolean m_trad_candidate; + static gboolean m_special_phrases; }; }; diff --git a/src/SpecialPhraseTable.cc b/src/SpecialPhraseTable.cc index c4dc71e..ee5a811 100644 --- a/src/SpecialPhraseTable.cc +++ b/src/SpecialPhraseTable.cc @@ -1,6 +1,7 @@ #include <iostream> #include <fstream> #include <string> +#include "Config.h" #include "DynamicSpecialPhrase.h" #include "SpecialPhraseTable.h" @@ -60,6 +61,8 @@ SpecialPhraseTable::lookup (const std::string &command, { result.clear (); + if (!Config::specialPhrases ()) + return FALSE; if (m_map.find (command) == m_map.end ()) return FALSE; diff --git a/src/phrases.txt b/src/phrases.txt index 1d42b8d..83a8f13 100644 --- a/src/phrases.txt +++ b/src/phrases.txt @@ -1,6 +1,8 @@ ; ibus 音输入法--自定义短语配置文件 ; ; 说明: +; **注意** +; 修改后请重新启动输入法,或者运行命令pkill ibus-engine-pinyin ; 格式: ; 英文字符串=短语 ; 英文字符串=#动态短语 |
