mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-22 06:39:41 +02:00
add nuxt localization
This commit is contained in:
parent
695d7e96ae
commit
c13fb6743c
3 changed files with 116 additions and 5 deletions
38
dev/scripts/generate_nuxt_locales.py
Normal file
38
dev/scripts/generate_nuxt_locales.py
Normal file
|
@ -0,0 +1,38 @@
|
|||
from pathlib import Path
|
||||
from pprint import pprint
|
||||
|
||||
PROJECT_DIR = Path(__file__).parent.parent.parent
|
||||
|
||||
|
||||
datetime_dir = PROJECT_DIR / "frontend" / "lang" / "dateTimeFormats"
|
||||
locales_dir = PROJECT_DIR / "datetime" / "lang" / "messages"
|
||||
|
||||
|
||||
"""
|
||||
{
|
||||
code: "en-US",
|
||||
file: "en-US.json",
|
||||
}
|
||||
|
||||
"en-US": require("./lang/dateTimeFormats/en-US.json"),
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def main():
|
||||
print("Starting...")
|
||||
|
||||
all_langs = []
|
||||
for match in datetime_dir.glob("*.json"):
|
||||
print(f'"{match.stem}": require("./lang/dateTimeFormats/{match.name}"),')
|
||||
|
||||
all_langs.append({"code": match.stem, "file": match.name})
|
||||
|
||||
print("\n\n\n--------- All Languages -----------")
|
||||
pprint(all_langs)
|
||||
|
||||
print("Finished...")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue