Localized catalogs: fix name/description bug
This commit is contained in:
parent
e105274de4
commit
28de5426f2
@ -156,7 +156,13 @@ def extract_localized_strings(localized_node):
|
||||
|
||||
# iterate strings below <de> etc
|
||||
for s in lang.getChildren():
|
||||
strings[s.name] = strutils.simplify(s.value)
|
||||
# fix up the name/description confusion here
|
||||
if s.name == 'description':
|
||||
strings['name'] = strutils.simplify(s.value)
|
||||
elif s.name == 'long-description':
|
||||
strings['description'] = strutils.simplify(s.value)
|
||||
else:
|
||||
strings[s.name] = strutils.simplify(s.value)
|
||||
|
||||
if strings:
|
||||
result[lang.name] = strings
|
||||
|
@ -51,7 +51,7 @@ class UpdateCatalogTests(unittest.TestCase):
|
||||
self.assertEqual(authors.getValue('author[1]/name'), 'Orville Wright')
|
||||
|
||||
locDe = info['localized']['de']
|
||||
self.assertEqual(locDe["long-description"], "Describe the F16-A in German")
|
||||
self.assertEqual(locDe["description"], "Describe the F16-A in German")
|
||||
|
||||
|
||||
def test_scan_dir(self):
|
||||
@ -75,7 +75,7 @@ class UpdateCatalogTests(unittest.TestCase):
|
||||
self.assertEqual(f16b['primary-set'], False)
|
||||
|
||||
locFr = f16b['localized']['fr']
|
||||
self.assertEqual(locFr["long-description"], "Describe the F16-B in French")
|
||||
self.assertEqual(locFr["description"], "Describe the F16-B in French")
|
||||
|
||||
authorsArray = f16b['authors']
|
||||
self.assertNotIn('author', f16b)
|
||||
@ -156,7 +156,7 @@ class UpdateCatalogTests(unittest.TestCase):
|
||||
self.assertEqual(parsedPkgNode.getValue('rating/cockpit'), 2)
|
||||
self.assertEqual(parsedPkgNode.getValue('rating/model'), 5)
|
||||
|
||||
self.assertEqual(parsedPkgNode.getValue('localized/de/long-description'), "Describe the F16-A in German")
|
||||
self.assertEqual(parsedPkgNode.getValue('localized/de/description'), "Describe the F16-A in German")
|
||||
|
||||
# author data verification
|
||||
self.assertFalse(parsedPkgNode.hasChild('author'));
|
||||
@ -194,7 +194,7 @@ class UpdateCatalogTests(unittest.TestCase):
|
||||
self.assertEqual(author1.getValue("email"), "shatner@enterprise.com")
|
||||
self.assertEqual(author1.getValue("description"), "Everything")
|
||||
|
||||
self.assertEqual(pv.getValue('localized/de/long-description'), "Describe the F16-B in German")
|
||||
self.assertEqual(pv.getValue('localized/de/description'), "Describe the F16-B in German")
|
||||
|
||||
|
||||
def test_node_creation2(self):
|
||||
|
Loading…
Reference in New Issue
Block a user