mirror of https://github.com/searxng/searxng.git
[fix] sort RTL_LOCALES before written into locales.json
To avoid unnecessary changes to the file, the list should be sorted before it is written to the file. You can test it by calling multiple times:: make data.locales and searx/data/locales.json should be unchanged. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
ed66ed758d
commit
894f164869
2
Makefile
2
Makefile
|
@ -75,7 +75,7 @@ test.shell:
|
||||||
# wrap ./manage script
|
# wrap ./manage script
|
||||||
|
|
||||||
MANAGE += weblate.translations.commit weblate.push.translations
|
MANAGE += weblate.translations.commit weblate.push.translations
|
||||||
MANAGE += data.all data.traits data.useragents
|
MANAGE += data.all data.traits data.useragents data.locales
|
||||||
MANAGE += docs.html docs.live docs.gh-pages docs.prebuild docs.clean
|
MANAGE += docs.html docs.live docs.gh-pages docs.prebuild docs.clean
|
||||||
MANAGE += docker.build docker.push docker.buildx
|
MANAGE += docker.build docker.push docker.buildx
|
||||||
MANAGE += gecko.driver
|
MANAGE += gecko.driver
|
||||||
|
|
|
@ -62,8 +62,8 @@
|
||||||
"zh-Hant-TW": "中文, 台灣 (Chinese, Taiwan)"
|
"zh-Hant-TW": "中文, 台灣 (Chinese, Taiwan)"
|
||||||
},
|
},
|
||||||
"RTL_LOCALES": [
|
"RTL_LOCALES": [
|
||||||
"fa-IR",
|
|
||||||
"ar",
|
"ar",
|
||||||
|
"fa-IR",
|
||||||
"he"
|
"he"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -58,7 +58,7 @@ def main():
|
||||||
|
|
||||||
content = {
|
content = {
|
||||||
"LOCALE_NAMES": LOCALE_NAMES,
|
"LOCALE_NAMES": LOCALE_NAMES,
|
||||||
"RTL_LOCALES": list(RTL_LOCALES),
|
"RTL_LOCALES": sorted(RTL_LOCALES),
|
||||||
}
|
}
|
||||||
|
|
||||||
with open(LOCALE_DATA_FILE, 'w', encoding='utf-8') as f:
|
with open(LOCALE_DATA_FILE, 'w', encoding='utf-8') as f:
|
||||||
|
|
Loading…
Reference in New Issue