From 353250f517bf2e4d3e223f80d5e4cd3d8d46564e Mon Sep 17 00:00:00 2001 From: Etienne G Date: Tue, 15 Aug 2023 00:35:15 +1000 Subject: [PATCH] Updated translation for conformity with yamllint --- dodo.py | 32 ++++++++++++++++++++++++++++++++ translations/en.yaml | 22 +++++++++++++++++----- 2 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 dodo.py diff --git a/dodo.py b/dodo.py new file mode 100644 index 0000000..99defcc --- /dev/null +++ b/dodo.py @@ -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}"], + } diff --git a/translations/en.yaml b/translations/en.yaml index af1dbf7..58f3f71 100644 --- a/translations/en.yaml +++ b/translations/en.yaml @@ -5,22 +5,34 @@ configuration: description: Enable the verbose mode. Useful for debugging retain: name: Activate MQTT retain - description: This allow to keep the values between reboot, prevent showing sensor values as unknown + description: >- + This allow to keep the values between reboot, prevent showing sensor + values as unknown gminrecl: name: Minimum record length description: The minimum packet length to be treated grott_mqtt: name: Enable grott MQTT - description: Allow grott to send MQTT messages. If your are using the grott_ha extension, you don't need this. If you are using the grott integration,m you need to enable it. + description: >- + Allow grott to send MQTT messages. If your are using + the grott_ha extension, you don't need this. + If you are using the grott integration, you need to enable it. ginvtype: name: Inverter type - description: "For changing the layout used for decoding (ex: sph, spf or tl3). Keep it on default if using inverter map." + description: >- + For changing the layout used for decoding + (ex: sph, spf or tl3). Keep it on default if using inverter map. ginvtypemap: name: Inverter mapping - description: 'An inverter mapping in the form {"SERIAL": "type"} e.g.: for an SPH6000 with serial "NWO00415E3" : {"NWO00415E3": "sph"}' + description: >- + An inverter mapping in the form {"SERIAL": "type"} + e.g.: for an SPH6000 with serial "NWO00415E3" : {"NWO00415E3": "sph"} ha_plugin: name: Home Assistant plugin - description: "Enable the Home Assistant plugin. This will send the data to Home Assistant via the grott HA plugin. Can be disabled if you are using the grott integration." + description: >- + Enable the Home Assistant plugin. + This will send the data to Home Assistant via the grott HA plugin. + Can be disabled if you are using the grott integration. network: 5279/TCP: This is the port used by grott to receive datalogger information.