This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b33062b
commit 78bfae2
Showing
4 changed files
with
29 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" Quick and dirty way to check if all translations might be used. """ | ||
|
||
# pylint: disable=invalid-name,superfluous-parens | ||
|
||
import subprocess | ||
import sys | ||
|
||
import polib | ||
|
||
error = 0 | ||
|
||
# Load all python code from git | ||
code = subprocess.check_output(['git', 'grep', '', '--', 'resources/*.py', 'resources/settings.xml']).decode('utf-8') | ||
|
||
# Load po file | ||
po = polib.pofile('resources/language/resource.language.en_gb/strings.po') | ||
for entry in po: | ||
# Extract msgctxt | ||
msgctxt = entry.msgctxt.lstrip('#') | ||
|
||
if msgctxt not in code: | ||
print('No usage found for translation:') | ||
print(entry) | ||
error = 1 | ||
|
||
sys.exit(error) |