|
|
714a2c6 |
From ab19e1a63f73040bd7f423923b0e886d8c87bd54 Mon Sep 17 00:00:00 2001
|
|
|
714a2c6 |
From: Mike FABIAN <mfabian@redhat.com>
|
|
|
714a2c6 |
Date: Tue, 13 Nov 2012 07:59:07 +0100
|
|
|
714a2c6 |
Subject: [PATCH 1/5] Fix marking of translatable strings for gettext
|
|
|
714a2c6 |
|
|
|
714a2c6 |
was broken in:
|
|
|
714a2c6 |
|
|
|
714a2c6 |
commit 6d2ab577c41c9b07a84c049137c8184bb67f5e30
|
|
|
714a2c6 |
Author: Caius 'kaio' Chance <me@kaio.net>
|
|
|
714a2c6 |
Date: Fri Oct 5 10:40:47 2012 +1000
|
|
|
714a2c6 |
|
|
|
714a2c6 |
Refactor _refresh_properties() function.
|
|
|
714a2c6 |
---
|
|
|
714a2c6 |
engine/table.py | 42 +++++++++++++++++++++---------------------
|
|
|
714a2c6 |
1 file changed, 21 insertions(+), 21 deletions(-)
|
|
|
714a2c6 |
|
|
|
714a2c6 |
diff --git a/engine/table.py b/engine/table.py
|
|
|
714a2c6 |
index a7354bc..7ea8403 100644
|
|
|
714a2c6 |
--- a/engine/table.py
|
|
|
714a2c6 |
+++ b/engine/table.py
|
|
|
714a2c6 |
@@ -1052,57 +1052,57 @@ class tabengine (ibus.EngineBase):
|
|
|
714a2c6 |
# taken and modified from PinYin.py :)
|
|
|
714a2c6 |
if self._mode == 1: # refresh mode
|
|
|
714a2c6 |
if self._status == u'CN':
|
|
|
714a2c6 |
- self._set_property(self._status_property, 'chinese.svg', 'Chinese Mode', 'Switch to English mode')
|
|
|
714a2c6 |
+ self._set_property(self._status_property, 'chinese.svg', _('Chinese Mode'), _('Switch to English mode'))
|
|
|
714a2c6 |
else:
|
|
|
714a2c6 |
- self._set_property(self._status_property, 'ibus-table.svg', self._status, 'Switch to English mode')
|
|
|
714a2c6 |
+ self._set_property(self._status_property, 'ibus-table.svg', self._status, _('Switch to English mode'))
|
|
|
714a2c6 |
else:
|
|
|
714a2c6 |
- self._set_property(self._status_property, 'english.svg', 'English Mode', 'Switch to Table mode')
|
|
|
714a2c6 |
+ self._set_property(self._status_property, 'english.svg', _('English Mode'), _('Switch to Table mode'))
|
|
|
714a2c6 |
|
|
|
714a2c6 |
if self._full_width_letter[self._mode]:
|
|
|
714a2c6 |
- self._set_property(self._letter_property, 'full-letter.svg', 'Full Letter', 'Switch to half-width letter')
|
|
|
714a2c6 |
+ self._set_property(self._letter_property, 'full-letter.svg', _('Full Letter'), _('Switch to half-width letter'))
|
|
|
714a2c6 |
else:
|
|
|
714a2c6 |
- self._set_property(self._letter_property, 'half-letter.svg', 'Half Letter', 'Switch to full-width letter')
|
|
|
714a2c6 |
+ self._set_property(self._letter_property, 'half-letter.svg', _('Half Letter'), _('Switch to full-width letter'))
|
|
|
714a2c6 |
|
|
|
714a2c6 |
if self._full_width_punct[self._mode]:
|
|
|
714a2c6 |
- self._set_property(self._punct_property, 'full-punct.svg', 'Full-width Punctuation', 'Switch to half-width punctuation')
|
|
|
714a2c6 |
+ self._set_property(self._punct_property, 'full-punct.svg', _('Full-width Punctuation'), _('Switch to half-width punctuation'))
|
|
|
714a2c6 |
else:
|
|
|
714a2c6 |
- self._set_property(self._punct_property, 'half-punct.svg', 'Half-width Punctuation', 'Switch to full-width punctuation')
|
|
|
714a2c6 |
+ self._set_property(self._punct_property, 'half-punct.svg', _('Half-width Punctuation'), _('Switch to full-width punctuation'))
|
|
|
714a2c6 |
|
|
|
714a2c6 |
if self._editor._py_mode:
|
|
|
714a2c6 |
- self._set_property(self._py_property, 'py-mode.svg', 'PinYin Mode', 'Switch to Table mode')
|
|
|
714a2c6 |
+ self._set_property(self._py_property, 'py-mode.svg', _('PinYin Mode'), _('Switch to Table mode'))
|
|
|
714a2c6 |
else:
|
|
|
714a2c6 |
- self._set_property(self._py_property, 'tab-mode.svg', 'Table Mode', 'Switch to PinYin mode')
|
|
|
714a2c6 |
+ self._set_property(self._py_property, 'tab-mode.svg', _('Table Mode'), _('Switch to PinYin mode'))
|
|
|
714a2c6 |
|
|
|
714a2c6 |
if self._editor._onechar:
|
|
|
714a2c6 |
- self._set_property(self._onechar_property, 'onechar.svg', 'Single Char Mode', 'Switch to phrase mode')
|
|
|
714a2c6 |
+ self._set_property(self._onechar_property, 'onechar.svg', _('Single Char Mode'), _('Switch to phrase mode'))
|
|
|
714a2c6 |
else:
|
|
|
714a2c6 |
- self._set_property(self._onechar_property, 'phrase.svg', 'Phrase Mode', 'Switch to single char mode')
|
|
|
714a2c6 |
+ self._set_property(self._onechar_property, 'phrase.svg', _('Phrase Mode'), _('Switch to single char mode'))
|
|
|
714a2c6 |
|
|
|
714a2c6 |
if self._auto_commit:
|
|
|
714a2c6 |
- self._set_property(self._auto_commit_property, 'acommit.svg', 'Direct Commit Mode', 'Switch to normal commit mode, which use space to commit')
|
|
|
714a2c6 |
+ self._set_property(self._auto_commit_property, 'acommit.svg', _('Direct Commit Mode'), _('Switch to normal commit mode, which use space to commit'))
|
|
|
714a2c6 |
else:
|
|
|
714a2c6 |
- self._set_property(self._auto_commit_property, 'ncommit.svg', 'Normal Commit Mode', 'Switch to direct commit mode')
|
|
|
714a2c6 |
+ self._set_property(self._auto_commit_property, 'ncommit.svg', _('Normal Commit Mode'), _('Switch to direct commit mode'))
|
|
|
714a2c6 |
|
|
|
714a2c6 |
# the chinese_mode:
|
|
|
714a2c6 |
if self.db._is_chinese:
|
|
|
714a2c6 |
if self._editor._chinese_mode == 0:
|
|
|
714a2c6 |
- self._set_property(self._cmode_property, 'sc-mode.svg', 'Simplified Chinese Mode', 'Switch to Traditional Chinese mode')
|
|
|
714a2c6 |
+ self._set_property(self._cmode_property, 'sc-mode.svg', _('Simplified Chinese Mode'), _('Switch to Traditional Chinese mode'))
|
|
|
714a2c6 |
elif self._editor._chinese_mode == 1:
|
|
|
714a2c6 |
- self._set_property(self._cmode_property, 'tc-mode.svg', 'Traditional Chinese Mode', 'Switch to Simplify Chinese first Big Charset Mode')
|
|
|
714a2c6 |
+ self._set_property(self._cmode_property, 'tc-mode.svg', _('Traditional Chinese Mode'), _('Switch to Simplify Chinese first Big Charset Mode'))
|
|
|
714a2c6 |
elif self._editor._chinese_mode == 2:
|
|
|
714a2c6 |
- self._set_property(self._cmode_property, 'scb-mode.svg', 'Simplified Chinese First Big Charset Mode', 'Switch to Traditional Chinese first Big Charset Mode')
|
|
|
714a2c6 |
+ self._set_property(self._cmode_property, 'scb-mode.svg', _('Simplified Chinese First Big Charset Mode'), _('Switch to Traditional Chinese first Big Charset Mode'))
|
|
|
714a2c6 |
elif self._editor._chinese_mode == 3:
|
|
|
714a2c6 |
- self._set_property(self._cmode_property, 'tcb-mode.svg', 'Traditional Chinese First Big Charset Mode', 'Switch to Big Charset Mode')
|
|
|
714a2c6 |
+ self._set_property(self._cmode_property, 'tcb-mode.svg', _('Traditional Chinese First Big Charset Mode'), _('Switch to Big Charset Mode'))
|
|
|
714a2c6 |
elif self._editor._chinese_mode == 4:
|
|
|
714a2c6 |
- self._set_property(self._cmode_property, 'cb-mode.svg', 'Big Chinese Mode', 'Switch to Simplified Chinese Mode')
|
|
|
714a2c6 |
+ self._set_property(self._cmode_property, 'cb-mode.svg', _('Big Chinese Mode'), _('Switch to Simplified Chinese Mode'))
|
|
|
714a2c6 |
|
|
|
714a2c6 |
# use buildin method to update properties :)
|
|
|
714a2c6 |
map (self.update_property, self.properties)
|
|
|
714a2c6 |
|
|
|
714a2c6 |
def _set_property (self, property, icon, label, tooltip):
|
|
|
714a2c6 |
- property.set_icon ( u'%s%s' % (self._icon_dir, icon ) )
|
|
|
714a2c6 |
- property.set_label ( _( unicode(label) ) )
|
|
|
714a2c6 |
- property.set_tooltip ( _( unicode(tooltip) ) )
|
|
|
714a2c6 |
+ property.set_icon ( u'%s%s' % (self._icon_dir, icon ) )
|
|
|
714a2c6 |
+ property.set_label ( unicode(label) )
|
|
|
714a2c6 |
+ property.set_tooltip ( unicode(tooltip) )
|
|
|
714a2c6 |
|
|
|
714a2c6 |
def _change_mode (self):
|
|
|
714a2c6 |
'''Shift input mode, TAB -> EN -> TAB
|
|
|
714a2c6 |
--
|
|
|
714a2c6 |
1.7.11.7
|
|
|
714a2c6 |
|