mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 02:49:27 +01:00
i18n: Skip fuzzy strings
The German translation currently has at least one fuzzy string with a missing %s; and several translations are completely wrong.
This commit is contained in:
parent
109f938b0c
commit
32198d42c2
10
src/i18n.py
10
src/i18n.py
@ -43,9 +43,11 @@ WAITING_FOR_MSGID = 1
|
||||
IN_MSGID = 2
|
||||
WAITING_FOR_MSGSTR = 3
|
||||
IN_MSGSTR = 4
|
||||
NEXT_IS_FUZZY = 5
|
||||
|
||||
MSGID = 'msgid "'
|
||||
MSGSTR = 'msgstr "'
|
||||
FUZZY = '#, fuzzy'
|
||||
|
||||
currentLocale = 'en'
|
||||
|
||||
@ -148,7 +150,13 @@ def parse(translationFile):
|
||||
line = line[0:-1] # Remove the ending \n
|
||||
line = line
|
||||
|
||||
if line.startswith(MSGID):
|
||||
if step == WAITING_FOR_MSGID and line.startswith(FUZZY):
|
||||
step = NEXT_IS_FUZZY
|
||||
elif step == NEXT_IS_FUZZY and line.startswith(MSGID):
|
||||
# Don't use fuzzy strings; they may have a mismatched number of %s or be
|
||||
# outright wrong; use English instead.
|
||||
step = WAITING_FOR_MSGID
|
||||
elif line.startswith(MSGID):
|
||||
# Don't check if step is WAITING_FOR_MSGID
|
||||
untranslated = ''
|
||||
translated = ''
|
||||
|
Loading…
Reference in New Issue
Block a user