@@ -705,28 +705,29 @@ def load_messages(themes, translations, default_lang, themes_dirs):
705
705
default_folder = os .path .join (get_theme_path_real ('base' , themes_dirs ), 'messages' )
706
706
sys .path .insert (0 , default_folder )
707
707
sys .path .insert (0 , msg_folder )
708
- english = __import__ ('messages_en' )
709
- # If we don't do the reload, the module is cached
710
- _reload (english )
711
- for lang in list (translations .keys ()):
712
- try :
713
- translation = __import__ ('messages_' + lang )
714
- # If we don't do the reload, the module is cached
715
- _reload (translation )
716
- if sorted (translation .MESSAGES .keys ()) != \
717
- sorted (english .MESSAGES .keys ()) and \
718
- lang not in language_incomplete_warned :
719
- language_incomplete_warned .append (lang )
720
- LOGGER .warn ("Incomplete translation for language "
721
- "'{0}'." .format (lang ))
722
- messages [lang ].update (english .MESSAGES )
723
- for k , v in translation .MESSAGES .items ():
724
- if v :
725
- messages [lang ][k ] = v
726
- del (translation )
727
- except ImportError as orig :
728
- raise LanguageNotFoundError (lang , orig )
729
- del (english )
708
+
709
+ english = __import__ ('messages_en' )
710
+ # If we don't do the reload, the module is cached
711
+ _reload (english )
712
+ for lang in list (translations .keys ()):
713
+ try :
714
+ translation = __import__ ('messages_' + lang )
715
+ # If we don't do the reload, the module is cached
716
+ _reload (translation )
717
+ if sorted (translation .MESSAGES .keys ()) != \
718
+ sorted (english .MESSAGES .keys ()) and \
719
+ lang not in language_incomplete_warned :
720
+ language_incomplete_warned .append (lang )
721
+ LOGGER .warn ("Incomplete translation for language "
722
+ "'{0}'." .format (lang ))
723
+ messages [lang ].update (english .MESSAGES )
724
+ for k , v in translation .MESSAGES .items ():
725
+ if v :
726
+ messages [lang ][k ] = v
727
+ del (translation )
728
+ except ImportError as orig :
729
+ raise LanguageNotFoundError (lang , orig )
730
+ del (english )
730
731
sys .path = oldpath
731
732
return messages
732
733
0 commit comments