Loading

Paste #plu1nyid8

  1. diff --git a/webtranslate/data.py b/webtranslate/data.py
  2. --- a/webtranslate/data.py
  3. +++ b/webtranslate/data.py
  4. @@ -365,7 +365,7 @@ class JsonLoader:
  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 @@ def load_language_json(projtype, node):
  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,10 +1177,10 @@ def load_language_json(projtype, node):
  25.      else:
  26.          lng.gender = node['gender'].split(' ')
  27.  
  28. -    if not projtype.allow_case or 'case' not in node or node['case'] == '':
  29. +    if not projtype.allow_case or 'cases' not in node or node['cases'] == '':
  30.          lng.case = ['']
  31.      else:
  32. -        lng.case = [''] + case.split(' ')
  33. +        lng.case = [''] + node['cases'].split(' ')
  34.  
  35.      assert isinstance(node['pragma'], list)
  36.      lng.custom_pragmas = dict(node['pragma'])

Comments