This commit is contained in:
Kovid Goyal 2023-07-13 15:06:57 +05:30
parent a209713677
commit 9f02e0a91c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -47,17 +47,17 @@ def usage(code, msg=''):
sys.exit(code) sys.exit(code)
def add(ctxt, id, str, fuzzy): def add(ctxt, msgid, msgstr, fuzzy):
"Add a non-fuzzy translation to the dictionary." "Add a non-fuzzy translation to the dictionary."
if (not fuzzy or not id) and str: if (not fuzzy or not msgid) and msgstr:
if id: if msgid:
STATS['translated'] += 1 STATS['translated'] += 1
if ctxt is None: if ctxt is None:
MESSAGES[id] = str MESSAGES[msgid] = msgstr
else: else:
MESSAGES[b"%b\x04%b" % (ctxt, id)] = str MESSAGES[b"%b\x04%b" % (ctxt, msgid)] = msgstr
else: else:
if id: if msgid:
STATS['untranslated'] += 1 STATS['untranslated'] += 1