From 9e5ecb8182be4e5a7c91cb92e9c5c64ed63fe8a2 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Thu, 15 Apr 2010 15:24:26 +0800 Subject: [PATCH] Add special phrases in setup ui --- po/ru.po | 164 ++++++++++-------- po/zh_CN.po | 151 ++++++++-------- setup/ibus-pinyin-preferences.ui | 361 +++++++++++++++++++++++++++------------ setup/main.py | 78 ++++++--- src/Config.cc | 5 + src/Config.h | 2 + src/SpecialPhraseTable.cc | 3 + src/phrases.txt | 2 + 8 files changed, 489 insertions(+), 277 deletions(-) diff --git a/po/ru.po b/po/ru.po index 7b68c53..1d79df6 100644 --- a/po/ru.po +++ b/po/ru.po @@ -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 \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 "IBus Pinyin %s" msgstr "IBus Пиньинь %s" #: ../setup/ibus-pinyin-preferences.ui.h:1 +#, fuzzy +msgid "Dictionary option" +msgstr "Другие" + +#: ../setup/ibus-pinyin-preferences.ui.h:2 msgid "Initial state" msgstr "Начальное состояние" -#: ../setup/ibus-pinyin-preferences.ui.h:2 +#: ../setup/ibus-pinyin-preferences.ui.h:3 msgid "Others" msgstr "Другие" -#: ../setup/ibus-pinyin-preferences.ui.h:3 +#: ../setup/ibus-pinyin-preferences.ui.h:4 #, fuzzy msgid "Pinyin mode" msgstr "Пиньинь" -#: ../setup/ibus-pinyin-preferences.ui.h:6 +#: ../setup/ibus-pinyin-preferences.ui.h:5 +#, fuzzy +msgid "UI" +msgstr "Другие" + +#: ../setup/ibus-pinyin-preferences.ui.h:8 msgid "" "Copyright © 2009 Peng Huang <shawn.p.huang@gmail.com>" msgstr "" "Copyright © 2009 Хуан Пэн <shawn.p.huang@gmail.com>" -#: ../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 "Пиньинь" + +#: ../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 \n" "Language-Team: Peng Huang \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 "IBus Pinyin %s" msgstr "IBus 拼音 %s" #: ../setup/ibus-pinyin-preferences.ui.h:1 +msgid "Dictionary option" +msgstr "词典选项" + +#: ../setup/ibus-pinyin-preferences.ui.h:2 msgid "Initial state" msgstr "初始状态" -#: ../setup/ibus-pinyin-preferences.ui.h:2 +#: ../setup/ibus-pinyin-preferences.ui.h:3 msgid "Others" msgstr "其他" -#: ../setup/ibus-pinyin-preferences.ui.h:3 +#: ../setup/ibus-pinyin-preferences.ui.h:4 msgid "Pinyin mode" msgstr "拼音模式" -#: ../setup/ibus-pinyin-preferences.ui.h:6 +#: ../setup/ibus-pinyin-preferences.ui.h:5 +msgid "UI" +msgstr "外观" + +#: ../setup/ibus-pinyin-preferences.ui.h:8 msgid "" "Copyright © 2009 Peng Huang <shawn.p.huang@gmail.com>" msgstr "版权所有 © 2009 黄鹏 <shawn.p.huang@gmail.com>" -#: ../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 @@ - + True 0 none - + True 6 12 - + True vertical 6 - - True - 12 - True - - - True - 0 - Orientation of candidates: - True - - - 0 - - - - - True - liststoreLookupTableOrientation - on - - - 1 - - - - - 0 - - - - - True - 12 - True - - - True - 0 - Number of candidates: - True - - - 0 - - - - - True - True - Setup the number of candidates show in one page of lookup table. - delayed - LookupTablePageSize - 0 - left - - - 1 - - - - - 1 - - - - + True - 4 + 2 2 6 6 @@ -457,7 +391,6 @@ True True False - Use left and right shift keys to select the second and thrid candidates. True @@ -467,7 +400,6 @@ True True False - Use [-] [=] key to page up/down the lookup table. True True @@ -482,7 +414,6 @@ True True False - Use [,] [.] key to page up/down the lookup table. True True @@ -497,7 +428,6 @@ True True False - Enable automatic commit phrase. True @@ -507,41 +437,156 @@ 2 + + + 0 + + + + + + + + + True + <b>Others</b> + True + + + + + False + 2 + + + + + + + + + True + Pinyin mode + + + False + + + + + True + 12 + 12 + 12 + 12 + + + True + vertical + + + True + 0 + none + + + True + 6 + 12 + + + True + vertical + 6 + + + True + 12 + True + + + True + 0 + Orientation of candidates: + True + + + 0 + + - - Show candidates in traditional Chinese + True - True - False - Show candidates in traditional Chinese, if the input method is in traditional Chinese inputing mode. - True + liststoreLookupTableOrientation + on - 2 - 2 - 3 + 1 + + + 0 + + + + + True + 12 + True - - Show raw input of Double Pinyin + + True + 0 + Number of candidates: + True + + + 0 + + + + True True - False - Show raw input of Double Pinyin - True + delayed + LookupTablePageSize + 0 + left - 2 - 3 - 4 + 1 + 1 + + + + + Show candidates in traditional Chinese + True + True + False + True + + 2 + + + Show raw input of Double Pinyin + True + True + False + True + + + 3 + + @@ -549,26 +594,36 @@ True - <b>Others</b> + <b>UI</b> True False - 2 + 0 + + + + + + + + 1 + - + True - General + UI + 1 False @@ -715,7 +770,7 @@ - 1 + 2 @@ -724,7 +779,7 @@ Correct pinyin - 1 + 2 False @@ -1147,7 +1202,7 @@ - 2 + 3 @@ -1156,26 +1211,106 @@ Fuzzy pinyin - 2 + 3 False - + True - vertical - - - - - - + 12 + 12 + 12 + 12 - + + True + vertical + + + True + 0 + none + + + True + 6 + 12 + + + True + vertical + 6 + + + True + 12 + + + Use custom phrases + True + True + False + True + + + False + 0 + + + + + Edit custom phrases + True + True + True + + + False + False + 1 + + + + + False + False + 0 + + + + + + + + + + + + + + + True + <b>Dictionary option</b> + True + + + + + 0 + + + + + + + + + - 3 + 4 @@ -1184,7 +1319,7 @@ Dictionary - 3 + 4 False @@ -1275,7 +1410,7 @@ - 4 + 5 @@ -1284,7 +1419,7 @@ About - 4 + 5 False 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(_("IBus Pinyin %s") % 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(_("IBus Pinyin %s") % 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 #include #include +#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 ; 格式: ; 英文字符串=短语 ; 英文字符串=#动态短语 -- 2.7.4