Updated translation for conformity with yamllint

This commit is contained in:
Etienne G
2023-08-15 00:35:15 +10:00
parent 32794e09da
commit 353250f517
2 changed files with 49 additions and 5 deletions
+32
View File
@@ -0,0 +1,32 @@
# use pydoit to run the pipeline
# url: http://pydoit.org/
# install pydoit: pip install doit (or pipx)
import os
import glob
BUILDS = [
"grott",
"grott-edge",
]
TRANSLATIONS_FOLDER = "translations"
def task_copy_translations():
"""Copy translations from the source to the translations folder."""
translations = glob.glob(f"{TRANSLATIONS_FOLDER}/*.yaml")
for build in BUILDS:
for translation in translations:
# get the file basename
translation = os.path.basename(translation)
yield {
"name": f"copy {translation} to {build}",
"actions": [
f"mkdir -p {build}/translations",
f"cp {TRANSLATIONS_FOLDER}/{translation} {build}/translations/{translation}",
],
"file_dep": [f"{TRANSLATIONS_FOLDER}/{translation}"],
"targets": [f"{build}/translations/{translation}"],
}