diff --git a/readme.md b/readme.md index a083db2..b89f224 100644 --- a/readme.md +++ b/readme.md @@ -224,6 +224,9 @@ Handle project workflows in a unified way: * comment * drawing characters constants * handle errors +* locales + * set unicode C + * set unicode language * packages * configure * apk diff --git a/spcd/__init__.py b/spcd/__init__.py index 4cf789e..0c17d01 100644 --- a/spcd/__init__.py +++ b/spcd/__init__.py @@ -62,6 +62,7 @@ def install_python_packages() -> None: run("pip", "install", "--upgrade", "pip") split() packages = [ + "gitlint", "hatch", "mypy", "pelican", diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index b947698..acc54f0 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -176,8 +176,10 @@ _spcd_step_wipe() { # │ _ │ txt │ # ╰───┴─────╯ -_SPCD_TXT_LANGUAGE_ENGLISH="en" -_SPCD_TXT_LANGUAGE_FRENCH="fr" +_SPCD_TXT_CHARSET="utf8" +_SPCD_TXT_LANGUAGE_DEFAULT="C" +_SPCD_TXT_LANGUAGE_ENGLISH="en_US" +_SPCD_TXT_LANGUAGE_FRENCH="fr_FR" _spcd_txt_pick() { case "${SPCD_TXT_LANGUAGE}" in @@ -329,6 +331,33 @@ spcd_txt_get() { esac } +spcd_txt_locale() { + # LANGUAGE + if [ -n "${1}" ]; then + spcd_step__locale__value="${1}" + else + spcd_step__locale__value="${_SPCD_TXT_LANGUAGE_DEFAULT}" + fi + spcd_step__locale__value="${spcd_step__locale__value}.${_SPCD_TXT_CHARSET}" + set -- \ + "LANG" \ + "LC_CTYPE" \ + "LC_NUMERIC" \ + "LC_TIME" \ + "LC_COLLATE" \ + "LC_MONETARY" \ + "LC_MESSAGES" \ + "LC_PAPER" \ + "LC_NAME" \ + "LC_ADDRESS" \ + "LC_TELEPHONE" \ + "LC_MEASUREMENT" \ + "LC_IDENTIFICATION" + for spcd_step__locale__name in "${@}"; do + export "${spcd_step__locale__name}=\"${spcd_step__locale__value}\"" + done +} + # ╭──────╮ # │ step │ # ╰──────╯ @@ -1324,6 +1353,8 @@ ${SPCD_PYTHON_ALIAS} / ${spcd_stp__name}" spcd_main() { # environment + spcd_txt_locale + # spcd_step_in "Environment" spcd_step_in "Defaults" spcd_step "Print defined"