Co-authored-by: Faris Ansari <netchampfaris@users.noreply.github.com>
This commit is contained in:
parent
d296688b35
commit
eae7f74d1e
1 changed files with 6 additions and 1 deletions
|
|
@ -518,8 +518,13 @@ def get_messages_from_file(path):
|
|||
apps_path = get_bench_dir()
|
||||
if os.path.exists(path):
|
||||
with open(path, 'r') as sourcefile:
|
||||
try:
|
||||
file_contents = sourcefile.read()
|
||||
except Exception:
|
||||
print("Could not scan file for translation: {0}".format(path))
|
||||
return []
|
||||
data = [(os.path.relpath(path, apps_path), message, context, line) \
|
||||
for line, message, context in extract_messages_from_code(sourcefile.read())]
|
||||
for line, message, context in extract_messages_from_code(file_contents)]
|
||||
return data
|
||||
else:
|
||||
# print "Translate: {0} missing".format(os.path.abspath(path))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue