Loading

Paste #pxg0yksi3

  1. diff -r 2b3743cd25a4 webtranslate/data.py
  2. --- a/webtranslate/data.py      Sun Jun 07 12:45:23 2015 +0200
  3. +++ b/webtranslate/data.py      Sun Jun 07 14:28:52 2015 +0200
  4. @@ -365,7 +365,7 @@
  5.          handle = open(fname, 'rt', encoding='utf-8')
  6.          data = json.load(handle)
  7.          handle.close()
  8. -        return load_language_json(projtype, pnode)
  9. +        return load_language_json(projtype, data)
  10.  # }}}
  11.  # {{{ class XmlSaver:
  12.  class XmlSaver:
  13. @@ -1161,8 +1161,8 @@
  14.      @return: The loaded language.
  15.      @rtype:  L{Language}
  16.      """
  17. -    assert 'lang_version' in node
  18. -    assert node['lang_version'] == 1
  19. +    assert 'language_version' in node
  20. +    assert node['language_version'] == 1
  21.  
  22.      lng = Language(node['name'])
  23.  
  24. @@ -1177,7 +1177,8 @@
  25.      else:
  26.          lng.gender = node['gender'].split(' ')
  27.  
  28. -    if not projtype.allow_case or 'case' not in node or node['case'] == '':
  29. +    case = node.get('cases')
  30. +    if not projtype.allow_case or case is None or case == '':
  31.          lng.case = ['']
  32.      else:
  33.          lng.case = [''] + case.split(' ')

Comments