add Q_() to help transltors

This commit is contained in:
Nikos Kouremenos 2005-08-12 17:53:25 +00:00
parent ba4e81095d
commit 1968b201d7
1 changed files with 14 additions and 0 deletions

View File

@ -37,3 +37,17 @@ def _(s):
if s == '':
return s
return _translation.gettext(s)
def Q_(s):
# Qualified translatable strings
# Some strings are too ambiguous to be easily translated.
# so we must use as:
# s = Q_('?vcard:Unknown')
# widget.set_text(s)
# Q_() removes the ?vcard:
# but gettext while parsing the file detects ?vcard:Unknown as a whole string.
# translator can either put the ?vcard: part or no (easier for him to no)
# nothing fails
if s[0] == '?':
s = s[s.index(':')+1:] # remove ?abc: part
return s