Skip to content
Snippets Groups Projects
Commit 1968b201 authored by nkour's avatar nkour
Browse files

add Q_() to help transltors

parent ba4e8109
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment