Quote:
Originally Posted by ownedbycats
I also noticed that when I used bistate booleans, true/false also worked the same as yes/no. I had to fix a bunch of saved searches when I switched to tristate.
|
That is because bistate bools are implemented using tristate. Undefined is used for the False value.
Quote:
now I am curious, how does searching for #bool:yes/no work with translations?
|
The rules from the code:
First the local (translated) words are determined. This is for English.
- self.local_no = icu_lower(_('no'))
- self.local_yes = icu_lower(_('yes'))
- self.local_unchecked = icu_lower(_('unchecked'))
- self.local_checked = icu_lower(_('checked'))
- self.local_empty = icu_lower(_('empty'))
- self.local_blank = icu_lower(_('blank'))
The comparisons are below. The quoted strings are literal, not translated.
- Value 'True': self.local_yes, self.local_checked, 'checked', '_checked', 'yes', '_yes', 'true'
- Value 'False':self.local_no, self.local_unchecked, 'unchecked', '_unchecked', 'no', '_no', 'true'
- Value Undefined: self.local_empty, self.local_blank, 'blank', '_blank', 'empty', '_empty', 'false'
To head off the inevitable next question, '_yes' etc exist because it is possible the the translation of (for example) 'Empty' is 'Yes'. The words 'true' and 'false' are reserved.