mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-04 22:40:12 +01:00
Merge branch 'fix_categories' into 'master'
Add default locale for generated categories See merge request fdroid/fdroidserver!1390
This commit is contained in:
commit
c02a194978
@ -746,7 +746,7 @@ def make_v2(apps, packages, repodir, repodict, requestsdict, fdroid_signing_key_
|
||||
# include definitions for "auto-defined" categories, e.g. just used in app metadata
|
||||
for category in sorted(categories_used_by_apps):
|
||||
if category not in output['repo'][CATEGORIES_CONFIG_NAME]:
|
||||
output['repo'][CATEGORIES_CONFIG_NAME][category] = dict()
|
||||
output['repo'][CATEGORIES_CONFIG_NAME][category] = {"name": {DEFAULT_LOCALE: category}}
|
||||
# do not include defined categories if no apps use them
|
||||
for category in list(output['repo'].get(CATEGORIES_CONFIG_NAME, list())):
|
||||
if category not in categories_used_by_apps:
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": 20002,
|
||||
"index": {
|
||||
"name": "/index-v2.json",
|
||||
"sha256": "5e3c0eaafd99d3518da2bb2bc7565b2ebcb17775a2f4ccc33b7336901ec71a6f",
|
||||
"sha256": "72146bc3bbbfd49c4e23435ca8ba13d58673a83fa4634f7ce2ea465616860293",
|
||||
"size": 53283,
|
||||
"numPackages": 10
|
||||
},
|
||||
|
@ -534,9 +534,21 @@
|
||||
"en-US": "System"
|
||||
}
|
||||
},
|
||||
"1": {},
|
||||
"2.0": {},
|
||||
"tests": {}
|
||||
"1": {
|
||||
"name": {
|
||||
"en-US": "1"
|
||||
}
|
||||
},
|
||||
"2.0": {
|
||||
"name": {
|
||||
"en-US": "2.0"
|
||||
}
|
||||
},
|
||||
"tests": {
|
||||
"name": {
|
||||
"en-US": "tests"
|
||||
}
|
||||
}
|
||||
},
|
||||
"requests": {
|
||||
"install": [
|
||||
|
@ -1842,7 +1842,7 @@ class UpdateTest(unittest.TestCase):
|
||||
with open('repo/index-v2.json') as fp:
|
||||
index = json.load(fp)
|
||||
self.assertEqual(
|
||||
{'Time': dict()},
|
||||
{'Time': {'name': {'en-US': 'Time'}}},
|
||||
index['repo'][CATEGORIES_CONFIG_NAME],
|
||||
)
|
||||
|
||||
@ -1867,7 +1867,7 @@ class UpdateTest(unittest.TestCase):
|
||||
with open('repo/index-v2.json') as fp:
|
||||
index = json.load(fp)
|
||||
self.assertEqual(
|
||||
{'bar': dict(), 'foo': dict()},
|
||||
{'bar': {'name': {'en-US': 'bar'}}, 'foo': {'name': {'en-US': 'foo'}}},
|
||||
index['repo'][CATEGORIES_CONFIG_NAME],
|
||||
)
|
||||
|
||||
@ -1894,7 +1894,7 @@ class UpdateTest(unittest.TestCase):
|
||||
with open('repo/index-v2.json') as fp:
|
||||
index = json.load(fp)
|
||||
self.assertEqual(
|
||||
{'System': {'name': {'en-US': 'System Apps'}}, 'Time': dict()},
|
||||
{'System': {'name': {'en-US': 'System Apps'}}, 'Time': {'name': {'en-US': 'Time'}}},
|
||||
index['repo'][CATEGORIES_CONFIG_NAME],
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user