Skip to content

Commit

Permalink
Extend diff to Gettext rules
Browse files Browse the repository at this point in the history
See translate/l10n-guide#22

Signed-off-by: Michal Čihař <[email protected]>
  • Loading branch information
nijel committed Jan 26, 2018
1 parent 1569237 commit f2e4d18
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions list-diff
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,32 @@ def parse_csv(name):

LANGUAGES = parse_csv('languages.csv')
CLDR = parse_csv('cldr.csv')
GETTEXT = parse_csv('gettext.csv')

# Iterate over common languages
for code in sorted(set(CLDR) & set(LANGUAGES)):
if CLDR[code] != LANGUAGES[code]:
print('Defintion for {} differs:'.format(code))
print('Gettext:', LANGUAGES[code])
print('Languages:', LANGUAGES[code])
print('CLDR:', CLDR[code])
print()

# Iterate over common languages
for code in sorted(set(GETTEXT) & set(LANGUAGES)):
if GETTEXT[code] != LANGUAGES[code]:
print('Defintion for {} differs:'.format(code))
print('Languages:', LANGUAGES[code])
print('Gettext:', GETTEXT[code])
print()

# List missing ones
for code in sorted(set(CLDR) - set(LANGUAGES) - OLDCODES):
print('Defintion for {} missing in gettext:'.format(code))
print('Defintion for {} missing in languages:'.format(code))
print('CLDR:', CLDR[code])
print()

# List missing ones
for code in sorted(set(GETTEXT) - set(LANGUAGES) - OLDCODES):
print('Defintion for {} missing in languages:'.format(code))
print('Gettext:', GETTEXT[code])
print()

0 comments on commit f2e4d18

Please sign in to comment.