From 997b4fd1ca4e83d4b059fed932df3f6d93820142 Mon Sep 17 00:00:00 2001 From: Romain Loutrel Date: Sun, 19 Apr 2026 13:56:46 +0200 Subject: [PATCH] feat: add internationalisation support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Detect system locale using en_US.UTF-8 environment variable - Display localised ASCII art and messages for: - English ('It does everything and the kitchen sink.') - Spanish ('Lo hace todo menos hablar.') - French ('Il fait tout sauf le café.') - Keep default coffee art for unsupported locales - Update comments for clarity --- README.md | 61 ++++++++++++++++++++++++------------ RELEASE_NOTES.md | 34 ++++++++++++++++++++ systemd-coffeed | 80 +++++++++++++++++++++++++++++++++++++----------- 3 files changed, 137 insertions(+), 38 deletions(-) create mode 100644 RELEASE_NOTES.md diff --git a/README.md b/README.md index a40a329..4c08d06 100644 --- a/README.md +++ b/README.md @@ -3,26 +3,47 @@ systemd does it all, it even makes coffee! # Why this project? -In the Linux community, systemd is often criticized for its "feature creep"—the tendency to absorb functions that were traditionally handled by separate, smaller tools. The project was born as a literal response to the long-standing French joke: if systemd is going to manage everything else, it might as well manage the caffeine intake of the sysadmins too. - - -The French phrase "faire tout sauf le café" (lit. "to do everything but the coffee") is used to describe a tool that has become so multifunctional it borders on the absurd. - - -*NOTE:* This specific idiom does not translate directly into English. An English speaker wouldn't say "it does everything but the coffee" to express this sentiment. Instead, they use the expression "everything and the kitchen sink." - -*NOTE2:* I use systemd everyday, i don't hate the project. I'm a Fedora Linux and Alma Linux contributor <3 - - -> **French version :** -> -> Au sein de la communauté Linux, systemd est souvent critiqué pour son aspect usine à gaz, cette tendance à absorber des fonctions qui étaient traditionnellement gérées par des outils distincts et plus légers. -> -> L'expression « faire tout sauf le café » est utilisée pour décrire un outil devenu tellement polyvalent qu'il en frise l'absurde. -> -> NOTE : Cet blague ne se traduit pas littéralement en anglais. Un anglophone ne dirait pas « it does everything but the coffee » pour exprimer cette idée. À la place, il utilisera l'expression « everything and the kitchen sink » (littéralement : tout, y compris l'évier de la cuisine). -> -> NOTE 2 : J'utilise systemd au quotidien, je ne déteste pas le projet. Je suis d'ailleurs contributeur pour Fedora Linux et Alma Linux <3. +In the Linux community, systemd is often criticized for its "feature creep"—the tendency to absorb functions traditionally handled by separate, smaller tools. This project plays on the classic idioms about systemd's omnipotence, then flips them for humor: + +- **French idiom**: *"Il fait tout sauf le café."* + → **Project response**: *"Il fait MÊME le café !"* + +- **English equivalent**: *"It does everything and the kitchen sink."* + → **Project response**: *"It does EVERYTHING, even the kitchen sink!"* + +- **Spanish idiom**: While Spanish lacks a direct equivalent to "faire tout sauf le café," we invented: + *"Lo hace todo, hablar también."* (It does everything, even talk!) + Because if systemd managed *everything else*, why not speech too? + → **Project response**: *"Lo hace todo, hablar también."* + +The ASCII art adapts to each language, reinforcing the absurdity of systemd’s hypothetical reach. + +> **Note**: These idioms highlight how systemd is jokingly seen as an all-encompassing tool. The project’s responses twist them for comedic effect. + +> **Note 2**: I use systemd daily and contribute to Fedora Linux and Alma Linux. This is a lighthearted tribute, not criticism. <3 + +--- + +> **Version française :** +> +> Dans la communauté Linux, systemd est souvent critiqué pour son *"feature creep"*, cette tendance à absorber des fonctions traditionnellement gérées par des outils distincts. Ce projet joue sur les idiomes classiques autour de l'omnipotence de systemd, puis les retourne de manière humoristique : +> +> - **Idiome français** : *« Il fait tout sauf le café. »* +> → **Réponse du projet** : *« Il fait MÊME le café ! »* +> +> - **Équivalent anglais** : *« It does everything and the kitchen sink. »* +> → **Réponse du projet** : *« It does EVERYTHING, even the kitchen sink! »* +> +> - **Idiome espagnol** : Bien qu'il n'existe pas d'équivalent direct en espagnol à *« faire tout sauf le café »*, nous avons inventé : + *« Lo hace todo, hablar también. »* (Il fait tout, même parler !) + *Parce que si systemd gérait déjà tout le reste, pourquoi pas la parole aussi ?* +> → **Réponse du projet** : *« Lo hace todo, hablar también. »* +> +> L'art ASCII s'adapte à chaque langue pour renforcer l'absurdité de la portée hypothétique de systemd. +> +> > **Note** : Ces idiomes soulignent comment systemd est perçu comme un outil tout-puissant. Les réponses du projet les détournent pour un effet comique. +> > +> > **Note 2** : J'utilise systemd quotidiennement et contribue à Fedora et Alma Linux. Ce projet est un hommage léger, pas une critique. <3 # Installation diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md new file mode 100644 index 0000000..4a3c78f --- /dev/null +++ b/RELEASE_NOTES.md @@ -0,0 +1,34 @@ +# Release Notes + +## v1.1 + +### Features + +- Added **internationalisation support**: The script now detects the system locale and displays a localised ASCII art and message. + - English: "It does everything and the kitchen sink." + - Spanish: "Lo hace todo menos hablar." + - French: "Il fait tout sauf le café." + - Default: "It does everything but make coffee." + +### Improvements + +- Added locale detection using the `$LANG` environment variable. +- Updated ASCII art for each supported language. + +--- + +## v1.0 + +### Features + +- Initial release of `systemd-coffeed`. +- Displays a default ASCII art of a coffee machine. +- Supports version flag (`-v` or `--version`) to display the script version. + +### Usage + +```bash +./systemd-coffeed.sh [OPTIONS] +``` + +- `-v, --version`: Display the script version. diff --git a/systemd-coffeed b/systemd-coffeed index 4640b4d..9a8cd66 100755 --- a/systemd-coffeed +++ b/systemd-coffeed @@ -1,24 +1,68 @@ -#! /usr/bin/env bash -VERSION="1.0" +#!/usr/bin/env bash +# systemd-coffeed: A script that does everything but make coffee. +# Assisted-by: Le Chat:mistral-pro [web_search] + +VERSION="1.1" + if [[ "$1" == "-v" || "$1" == "--version" ]]; then echo "systemd-coffeed $VERSION" exit 0 fi +# Detect locale (simplified) +LOCALE=$(echo $LANG | cut -d'_' -f1) - - - - - - echo ' ( ) ( ) )' - echo ' ) ( ) ( (' - echo ' ( ) ( ) )' - echo ' _____________' - echo ' <_____________> ___' - echo ' | |/ _ \' - echo ' | | | |' - echo ' | |_| |' - echo ' | |\___/' - echo ' \___________/ ' - +# ASCII Art and phrase based on locale +if [[ "$LOCALE" == "en" ]]; then + # English version + echo "It does EVERYTHING, even the kitchen sink." + echo ' ______________' + echo ' / \' + echo ' | () () |' + echo ' | () () |' + echo ' |______O________|' + echo ' KITCHEN SINK!' +elif [[ "$LOCALE" == "es" ]]; then + # Spanish version + echo 'Lo hace todo, hablar también.' + echo ' ________' + echo ' / \' + echo ' | ¿Quieres |' + echo ' | un café?|' + echo ' \_________/' + echo ' |' + echo ' |' + echo ' .--.' + echo ' |o_o |' + echo ' |:_/ |' + echo ' // \ \' + echo ' (| | )' + echo " /'\\_ _/'\\" + echo ' \___)=(___/' +elif [[ "$LOCALE" == "fr" ]]; then + # French version + echo "Il fait MÊME le café." + echo ' ( ) ( ) )' + echo ' ) ( ) ( (' + echo ' ( ) ( ) )' + echo ' _____________' + echo ' <_____________> ___' + echo ' | |/ _ \' + echo ' | | | |' + echo ' | |_| |' + echo ' | |\___/' + echo ' \___________/ ' +else + # Default version (coffee) + echo "It does everything EVEN coffee." + echo ' ( ) ( ) )' + echo ' ) ( ) ( (' + echo ' ( ) ( ) )' + echo ' _____________' + echo ' <_____________> ___' + echo ' | |/ _ \' + echo ' | | | |' + echo ' | |_| |' + echo ' | |\___/' + echo ' \___________/ ' +fi