svghmi/i18n.py
branchsvghmi
changeset 3198 d9c8f8789fc8
parent 3157 279e08f238ca
child 3214 bb314cdfc656
equal deleted inserted replaced
3196:f1049e4df866 3198:d9c8f8789fc8
    94         translated_message = []
    94         translated_message = []
    95         for langcode,translation in translations:
    95         for langcode,translation in translations:
    96             msg = translation.pop(msgid, None)
    96             msg = translation.pop(msgid, None)
    97             if msg is None:
    97             if msg is None:
    98                 broken_lang.add(langcode)
    98                 broken_lang.add(langcode)
    99                 errcallback(_('{}: Missing translation for "{}" (label:{}, id:{})\n').format(lang,msgid,label,svgid))
    99                 errcallback(_('{}: Missing translation for "{}" (label:{}, id:{})\n').format(langcode,msgid,label,svgid))
   100                 translated_message.append(msgid)
   100                 translated_message.append(msgid)
   101             else:
   101             else:
   102                 translated_message.append(msg)
   102                 translated_message.append(msg)
   103         translated_messages.append((msgid,translated_message))
   103         translated_messages.append((msgid,translated_message))
   104     langs = []
   104     langs = []
   119         broken = False
   119         broken = False
   120         for msgid, msg in translation.iteritems():
   120         for msgid, msg in translation.iteritems():
   121             broken = True
   121             broken = True
   122             errcallback(_('{}: Unused translation "{}":"{}"\n').format(langcode,msgid,msg))
   122             errcallback(_('{}: Unused translation "{}":"{}"\n').format(langcode,msgid,msg))
   123         if broken or langcode in broken_lang:
   123         if broken or langcode in broken_lang:
   124             errcallback(_('Translation for {} is outdated, please edit {}.po, click "Catalog -> Update from POT File..." and select messages.pot.\n').format(lang,lang))
   124             errcallback(_('Translation for {} is outdated, please edit {}.po, click "Catalog -> Update from POT File..." and select messages.pot.\n').format(langcode,langcode))
   125 
   125 
   126 
   126 
   127     return langs,translated_messages
   127     return langs,translated_messages
   128 
   128 
   129 
   129