mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 04:52:48 +02:00
Added translation for 'Tags' in ExclusionRules and PrefixRules
This commit is contained in:
parent
34c340a197
commit
05e59444e5
1 changed files with 8 additions and 7 deletions
|
|
@ -88,7 +88,7 @@ def _initControlArrays(self):
|
|||
[{'ordinal':0,
|
||||
'enabled':True,
|
||||
'name':_('Catalogs'),
|
||||
'field':'Tags',
|
||||
'field':_('Tags'),
|
||||
'pattern':'Catalog'},],
|
||||
['table_widget'])
|
||||
|
||||
|
|
@ -97,13 +97,13 @@ def _initControlArrays(self):
|
|||
[{'ordinal':0,
|
||||
'enabled':True,
|
||||
'name':_('Read book'),
|
||||
'field':'Tags',
|
||||
'field':_('Tags'),
|
||||
'pattern':'+',
|
||||
'prefix':u'\u2713'},
|
||||
{'ordinal':1,
|
||||
'enabled':True,
|
||||
'name':_('Wishlist item'),
|
||||
'field':'Tags',
|
||||
'field':_('Tags'),
|
||||
'pattern':'Wishlist',
|
||||
'prefix':u'\u00d7'},],
|
||||
['table_widget','table_widget'])
|
||||
|
|
@ -127,7 +127,7 @@ def construct_tw_opts_object(self, c_name, opt_value, opts_dict):
|
|||
elif 'prefix' in rule and rule['prefix'] is None:
|
||||
continue
|
||||
else:
|
||||
if rule['field'] != 'Tags':
|
||||
if rule['field'] != _('Tags'):
|
||||
# Look up custom column friendly name
|
||||
rule['field'] = self.eligible_custom_fields[rule['field']]['field']
|
||||
if rule['pattern'] in [_('any value'),_('any date')]:
|
||||
|
|
@ -226,7 +226,7 @@ def exclude_genre_reset(self):
|
|||
def fetch_eligible_custom_fields(self):
|
||||
self.all_custom_fields = self.db.custom_field_keys()
|
||||
custom_fields = {}
|
||||
custom_fields['Tags'] = {'field':'tag', 'datatype':u'text'}
|
||||
custom_fields[_('Tags')] = {'field':'tag', 'datatype':u'text'}
|
||||
for custom_field in self.all_custom_fields:
|
||||
field_md = self.db.metadata_for_field(custom_field)
|
||||
if field_md['datatype'] in ['bool','composite','datetime','enumeration','text']:
|
||||
|
|
@ -318,7 +318,7 @@ def initialize(self, name, db):
|
|||
index = getattr(self,c_name).findText(opt_value)
|
||||
if index == -1:
|
||||
if c_name == 'read_source_field':
|
||||
index = self.read_source_field.findText('Tag')
|
||||
index = self.read_source_field.findText(_('Tags'))
|
||||
elif c_name == 'genre_source_field':
|
||||
index = self.genre_source_field.findText(_('Tags'))
|
||||
getattr(self,c_name).setCurrentIndex(index)
|
||||
|
|
@ -836,9 +836,10 @@ def source_index_changed(self, combo, row, pattern=''):
|
|||
# Populate the Pattern field based upon the Source field
|
||||
|
||||
source_field = str(combo.currentText())
|
||||
|
||||
if source_field == '':
|
||||
values = []
|
||||
elif source_field == 'Tags':
|
||||
elif source_field == _('Tags'):
|
||||
values = sorted(self.db.all_tags(), key=sort_key)
|
||||
else:
|
||||
if self.eligible_custom_fields[unicode(source_field)]['datatype'] in ['enumeration', 'text']:
|
||||
|
|
|
|||
Loading…
Reference in a new issue