mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-10 03:37:28 -03:00
Update countries-update-list.py to correct path, and run it to generate new country json files for other locales
This commit is contained in:
parent
e168080b77
commit
a582a06a4d
5 changed files with 6 additions and 6 deletions
1
desktop/onionshare/resources/countries/el.json
Normal file
1
desktop/onionshare/resources/countries/el.json
Normal file
File diff suppressed because one or more lines are too long
1
desktop/onionshare/resources/countries/fr.json
Normal file
1
desktop/onionshare/resources/countries/fr.json
Normal file
File diff suppressed because one or more lines are too long
1
desktop/onionshare/resources/countries/ja.json
Normal file
1
desktop/onionshare/resources/countries/ja.json
Normal file
File diff suppressed because one or more lines are too long
1
desktop/onionshare/resources/countries/pt_PT.json
Normal file
1
desktop/onionshare/resources/countries/pt_PT.json
Normal file
File diff suppressed because one or more lines are too long
|
@ -22,9 +22,7 @@ def main():
|
|||
available_locales = list(settings.available_locales)
|
||||
|
||||
# Make a dictionary that makes a language's ISO 3166-1 to its name in all enabled languages
|
||||
os.makedirs(
|
||||
os.path.join("src", "onionshare", "resources", "countries"), exist_ok=True
|
||||
)
|
||||
os.makedirs(os.path.join("onionshare", "resources", "countries"), exist_ok=True)
|
||||
for locale in available_locales:
|
||||
with open(os.path.join(repo_dir, "data", locale, "country.json")) as f:
|
||||
countries = json.loads(f.read())
|
||||
|
@ -34,9 +32,7 @@ def main():
|
|||
del countries[key]
|
||||
|
||||
with open(
|
||||
os.path.join(
|
||||
"src", "onionshare", "resources", "countries", f"{locale}.json"
|
||||
),
|
||||
os.path.join("onionshare", "resources", "countries", f"{locale}.json"),
|
||||
"w",
|
||||
) as f:
|
||||
f.write(json.dumps(countries))
|
||||
|
|
Loading…
Reference in a new issue