From 9ed69a111b422d7189c0bd8a475eae3a58722cc1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 29 Aug 2024 12:58:08 +0200 Subject: [PATCH 1/5] readme/lang --- readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.md b/readme.md index d6dd50f..dd20729 100644 --- a/readme.md +++ b/readme.md @@ -276,4 +276,7 @@ Handle project workflows in a unified way: * automate versions fetching * handle openh264 repositories +* languages + * handle different ones + * translate to french * try to support nix From f920e596d9fe8a26d5ca3b6efa8149b5dece34ec Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 29 Aug 2024 16:11:30 +0200 Subject: [PATCH 2/5] disable SC2312 --- .shellcheckrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.shellcheckrc b/.shellcheckrc index 202d63d..fb50083 100644 --- a/.shellcheckrc +++ b/.shellcheckrc @@ -1,2 +1,3 @@ +disable=2312 enable=all shell=sh From 25dba9af1914f184f0586e99e7fefceb06516f8a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 29 Aug 2024 16:12:46 +0200 Subject: [PATCH 3/5] _/txt --- spcd/bootstrap.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 3a52dcd..f51acb9 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -172,6 +172,21 @@ _spcd_step_wipe() { "__SPCD_STEP_${__SPCD_STEP_LEVEL}_LABEL" } +# ╭───┬─────╮ +# │ _ │ txt │ +# ╰───┴─────╯ + +_SPCD_TXT_LANGUAGE_ENGLISH="en" +_SPCD_TXT_LANGUAGE_FRENCH="fr" + +_spcd_txt_pick() { + case "${SPCD_TXT_LANGUAGE}" in + "${_SPCD_TXT_LANGUAGE_ENGLISH}") echo "${2}" ;; + "${_SPCD_TXT_LANGUAGE_FRENCH}") echo "${1}" ;; + *) ;; + esac +} + # ╭───────────╮ # │ functions │ # ╰───────────╯ From 90527c0078b2ab6a0213c8103caec5e774069cfc Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 29 Aug 2024 16:14:25 +0200 Subject: [PATCH 4/5] default --- spcd/bootstrap.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index f51acb9..b08934c 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -356,6 +356,7 @@ spcd_step__environment_defaults_print() { "REF_FEATURE" \ "REF_RELEASE" \ "REF_STAGING" \ + "TXT_LANGUAGE" \ "URL_ALMA" \ "URL_ALPINE" \ "URL_ARCH" \ @@ -390,6 +391,8 @@ spcd_step__environment_defaults_set() { [ -n "${SPCD_REF_RELEASE}" ] || SPCD_REF_RELEASE="main" [ -n "${SPCD_REF_STAGING}" ] || SPCD_REF_STAGING="dev" + [ -n "${SPCD_TXT_LANGUAGE}" ] || SPCD_TXT_LANGUAGE="en" + [ -n "${SPCD_URL_ALMA}" ] || # /almalinux/$releasever/… # /vault/$releasever/… From d388d30d0c95fc8bf224e05ec6520680cfbf9e4c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 29 Aug 2024 16:17:04 +0200 Subject: [PATCH 5/5] txt/set --- spcd/bootstrap.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index b08934c..0a12e88 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -318,6 +318,17 @@ spcd_step_out() { __SPCD_STEP_LEVEL=$((__SPCD_STEP_LEVEL - 1)) } +# ╭───────────┬─────╮ +# │ functions │ txt │ +# ╰───────────┴─────╯ + +spcd_txt_get() { + case "${1}" in + "set") _spcd_txt_pick "Set" "Définir" ;; + *) ;; + esac +} + # ╭──────╮ # │ step │ # ╰──────╯ @@ -377,7 +388,7 @@ spcd_step__environment_defaults_print() { } spcd_step__environment_defaults_set() { - spcd_step "Set" + spcd_step "$(spcd_txt_get "set")" [ -n "${SPCD_CMD_SUM}" ] || SPCD_CMD_SUM="sha512sum" [ -n "${SPCD_DNS_1}" ] || SPCD_DNS_1="9.9.9.9"