mirror of
https://github.com/Hopiu/django-rosetta.git
synced 2026-04-29 01:14:42 +00:00
Don't crash when a PO file for the selected ref language is missing or invalid.
This commit is contained in:
parent
f00009686f
commit
e83d68655e
1 changed files with 6 additions and 1 deletions
|
|
@ -203,7 +203,12 @@ def home(request):
|
|||
ref_pofile = None
|
||||
if ref_lang != 'msgid':
|
||||
ref_fn = re.sub('/locale/[a-z]{2}/','/locale/%s/' % ref_lang, rosetta_i18n_fn)
|
||||
ref_pofile = pofile(ref_fn)
|
||||
try:
|
||||
ref_pofile = pofile(ref_fn)
|
||||
except IOError:
|
||||
# there's a syntax error in the PO file and polib can't open it. Let's just
|
||||
# do nothing and thus display msgids.
|
||||
pass
|
||||
|
||||
for o in paginator.object_list:
|
||||
# default
|
||||
|
|
|
|||
Loading…
Reference in a new issue