mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-02 06:26:10 -04: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
2da1174408
commit
94ce2a3e5d
5 changed files with 6 additions and 6 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue