Fixed #16343: now wmllint doesn`t add translate mark to empty strings...

...and removes translate marks from empty strings
This commit is contained in:
Kosov Eugene 2010-08-02 20:19:32 +00:00
parent c88629e242
commit 066c24be9b
2 changed files with 6 additions and 1 deletions

View file

@ -262,6 +262,7 @@ Version 1.9.0-svn:
* Reducing cache loading for title screen, --test, --editor and --load
* Removed Lua dependency, the source is now in the source tree
* Introduced a new allignement called "Liminal". Those units fight best during the twilight times of day.
* Fixed #16343: wmllint wants to add translation markers to the empty string in description=
Version 1.8.0:
* AI:

View file

@ -1227,7 +1227,11 @@ def global_sanity_check(filename, lines):
elif key in ('name', 'male_name', 'female_name'): # FIXME: check this someday
pass
elif key in translatables:
if markcheck and not value.startswith("$") and not value.startswith("{") and not re.match(" +", value) and not has_tr_mark:
if markcheck and has_tr_mark and lines[i].find("\"\"")>-1:
print '"%s", line %d: %s doesn`t need translation mark (translatable string is empty)' \
% (filename, i+1, key)
lines[i] = lines[i].replace("=_","=")
if markcheck and not value.startswith("$") and not value.startswith("{") and not re.match(" +", value) and not has_tr_mark and lines[i].find("\"\"")==-1:
print '"%s", line %d: %s needs translation mark' \
% (filename, i+1, key)
lines[i] = lines[i].replace('=', "=_ ")