diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 03c1086..b18f8d8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -15,7 +15,7 @@ jobs: run: actionlint -ignore 'label "CI-CD" is unknown' .github/workflows/CI.yml - name: Run codespell - run: codespell --skip="README-fr.md,./doc/man/fr" --enable-colors + run: codespell --skip="README-fr.md,./doc/man/fr,./po" --enable-colors - name: Run mdl run: mdl --style .github/workflows/mdl_style.rb . diff --git a/Makefile b/Makefile index 1d0c018..733e0e7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ pkgname=arch-update +_pkgname=Arch-Update PREFIX ?= /usr/local @@ -7,19 +8,30 @@ PREFIX ?= /usr/local all: install: + # Install the main script install -Dm 755 "src/script/${pkgname}.sh" "${DESTDIR}${PREFIX}/bin/${pkgname}" - - install -Dm 666 "src/icons/${pkgname}.svg" "${DESTDIR}/usr/share/icons/${pkgname}/${pkgname}.svg" - install -Dm 666 "src/icons/${pkgname}_checking.svg" "${DESTDIR}/usr/share/icons/${pkgname}/${pkgname}_checking.svg" - install -Dm 666 "src/icons/${pkgname}_installing.svg" "${DESTDIR}/usr/share/icons/${pkgname}/${pkgname}_installing.svg" - install -Dm 666 "src/icons/${pkgname}_up-to-date.svg" "${DESTDIR}/usr/share/icons/${pkgname}/${pkgname}_up-to-date.svg" - install -Dm 666 "src/icons/${pkgname}_updates-available.svg" "${DESTDIR}/usr/share/icons/${pkgname}/${pkgname}_updates-available.svg" - + + # Install icons + install -Dm 666 "src/icons/${pkgname}.svg" "${DESTDIR}${PREFIX}/share/icons/${pkgname}/${pkgname}.svg" + install -Dm 666 "src/icons/${pkgname}_checking.svg" "${DESTDIR}${PREFIX}/share/icons/${pkgname}/${pkgname}_checking.svg" + install -Dm 666 "src/icons/${pkgname}_installing.svg" "${DESTDIR}${PREFIX}/share/icons/${pkgname}/${pkgname}_installing.svg" + install -Dm 666 "src/icons/${pkgname}_up-to-date.svg" "${DESTDIR}${PREFIX}/share/icons/${pkgname}/${pkgname}_up-to-date.svg" + install -Dm 666 "src/icons/${pkgname}_updates-available.svg" "${DESTDIR}${PREFIX}/share/icons/${pkgname}/${pkgname}_updates-available.svg" + + # Install the .desktop file install -Dm 644 "res/desktop/${pkgname}.desktop" "${DESTDIR}${PREFIX}/share/applications/${pkgname}.desktop" - + + # Install systemd units install -Dm 644 "res/systemd/${pkgname}.service" "${DESTDIR}${PREFIX}/lib/systemd/user/${pkgname}.service" install -Dm 644 "res/systemd/${pkgname}.timer" "${DESTDIR}${PREFIX}/lib/systemd/user/${pkgname}.timer" + # Generate and install .mo files for translations + # .mo files are installed as "Arch-Update.mo" to avoid conflicting with the "arch-update.mo" files shipped by the arch-update Gnome extension (https://extensions.gnome.org/extension/1010/archlinux-updates-indicator/) + msgfmt po/fr.po -o po/fr.mo + install -Dm 644 po/fr.mo "${DESTDIR}${PREFIX}/share/locale/fr/LC_MESSAGES/${_pkgname}.mo" + rm -f po/fr.mo + + # Archive and install man pages gzip -c "doc/man/${pkgname}.1" > "doc/man/${pkgname}.1.gz" gzip -c "doc/man/${pkgname}.conf.5" > "doc/man/${pkgname}.conf.5.gz" gzip -c "doc/man/fr/${pkgname}.1" > "doc/man/fr/${pkgname}.1.gz" @@ -32,25 +44,37 @@ install: rm -f "doc/man/${pkgname}.conf.5.gz" rm -f "doc/man/fr/${pkgname}.1.gz" rm -f "doc/man/fr/${pkgname}.conf.5.gz" - + + # Install documentation install -Dm 644 README.md "${DESTDIR}${PREFIX}/share/doc/${pkgname}/README.md" + install -Dm 644 README-fr.md "${DESTDIR}${PREFIX}/share/doc/${pkgname}/fr/README-fr.md" uninstall: + # Delete the main script rm -f "${DESTDIR}${PREFIX}/bin/${pkgname}" - rm -rf "${DESTDIR}/usr/share/icons/${pkgname}/" + # Delete icons + rm -rf "${DESTDIR}${PREFIX}/share/icons/${pkgname}/" + # Delete the .desktop file rm -f "${DESTDIR}${PREFIX}/share/applications/${pkgname}.desktop" + # Delete systemd units rm -f "${DESTDIR}${PREFIX}/lib/systemd/user/${pkgname}.service" rm -f "${DESTDIR}${PREFIX}/lib/systemd/user/${pkgname}.timer" + # Delete .mo files + rm -f "${DESTDIR}${PREFIX}/usr/share/locale/fr/LC_MESSAGES/${_pkgname}.mo" + + # Delete man pages rm -f "${DESTDIR}${PREFIX}/share/man/man1/${pkgname}.1.gz" rm -f "${DESTDIR}${PREFIX}/share/man/man5/${pkgname}.conf.5.gz" rm -f "${DESTDIR}${PREFIX}/share/man/fr/man1/${pkgname}.1.gz" rm -f "${DESTDIR}${PREFIX}/share/man/fr/man5/${pkgname}.conf.5.gz" - + + # Delete documentation rm -rf "${DESTDIR}${PREFIX}/share/doc/${pkgname}/" test: + # Run the help function of the main script as a simple test "src/script/${pkgname}.sh" --help diff --git a/README-fr.md b/README-fr.md index 7c846ec..cf08deb 100644 --- a/README-fr.md +++ b/README-fr.md @@ -83,7 +83,9 @@ Pour le démarrer automatiquement **au démarrage du système puis une fois tout systemctl --user enable --now arch-update.timer ``` -### Capture d'écran +### Captures d'écran + +*Les captures d'écran montrent le retour du script en anglais, mais `Arch-Update` possède désormais une **traduction française** !* Personnellement, j'ai intégré l'icône .desktop dans ma barre supérieure. C'est la première icône en partant de la gauche. @@ -108,7 +110,7 @@ Lorsque l'on clique sur l'icône, cela lance la série de fonctions adéquates p ![listing-packages](https://github.com/Antiz96/arch-update/assets/53110319/43a990c8-ed93-420f-8c46-d50d60bff03f) Une fois que vous avez donné la confirmation pour procéder, `arch-update` propose d'afficher les dernières Arch news. -Les Arch news publiées au cours des 15 derniers jours sont étiquetées comme « [NEW] ». +Les Arch news publiées au cours des 15 derniers jours sont étiquetées comme « [NOUVEAU] ». Sélectionnez la news à lire en tapant le numéro associé. Après avoir lu une news, `arch-update` vous proposera à nouveau d'afficher les dernières Arch news, afin que vous puissiez lire plusieurs news à la fois. Appuyez simplement sur « Entrée » sans saisir de chiffre pour procéder à la mise à jour : diff --git a/po/arch-update.pot b/po/arch-update.pot new file mode 100644 index 0000000..4a871aa --- /dev/null +++ b/po/arch-update.pot @@ -0,0 +1,413 @@ +# Arch-Update translation template +# Copyright (C) 2024 Robin Candau +# This file is distributed under the same license as the Arch-Update package. +# +# Translators: +# AUTHOR , YEAR +msgid "" +msgstr "" +"Project-Id-Version: Arch-Update 1.10.1\n" +"Report-Msgid-Bugs-To: https://github.com/Antiz96/arch-update/issues\n" +"POT-Creation-Date: 2024-02-09 01:21+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/script/arch-update.sh:88 +#, sh-format +msgid "Press \"enter\" to continue " +msgstr "" + +#: src/script/arch-update.sh:94 +#, sh-format +msgid "Press \"enter\" to quit " +msgstr "" + +#: src/script/arch-update.sh:104 +#, sh-format +msgid "" +"A privilege elevation method is required\\nPlease, install sudo or doas\\n" +msgstr "" + +#: src/script/arch-update.sh:126 +#, sh-format +msgid "" +"An update notifier/applier for Arch Linux that assists you with important " +"pre/post update tasks." +msgstr "" + +#: src/script/arch-update.sh:128 +#, sh-format +msgid "Run ${name} to perform the main 'update' function:" +msgstr "" + +#: src/script/arch-update.sh:129 +#, sh-format +msgid "" +"Print the list of packages available for update, then ask for the user's " +"confirmation to proceed with the installation." +msgstr "" + +#: src/script/arch-update.sh:130 +#, sh-format +msgid "" +"Before performing the update, offer to print the latest Arch Linux news." +msgstr "" + +#: src/script/arch-update.sh:131 +#, sh-format +msgid "" +"Post update, check for orphan/unused packages, old cached packages, pacnew/" +"pacsave files and pending kernel update and, if there are, offers to process " +"them." +msgstr "" + +#: src/script/arch-update.sh:133 +#, sh-format +msgid "Options:" +msgstr "" + +#: src/script/arch-update.sh:134 +#, sh-format +msgid "" +" -c, --check Check for available updates, send a desktop notification " +"containing the number of available updates (if libnotify is installed)" +msgstr "" + +#: src/script/arch-update.sh:135 +#, sh-format +msgid " -h, --help Display this message and exit" +msgstr "" + +#: src/script/arch-update.sh:136 +#, sh-format +msgid " -V, --version Display version information and exit" +msgstr "" + +#: src/script/arch-update.sh:138 +#, sh-format +msgid "For more information, see the ${name}(1) man page." +msgstr "" + +#: src/script/arch-update.sh:139 +#, sh-format +msgid "" +"Certain options can be enabled/disabled or modified via the ${name}.conf " +"configuration file, see the ${name}.conf(5) man page." +msgstr "" + +#: src/script/arch-update.sh:150 +#, sh-format +msgid "" +"${name}: invalid option -- '${option}'\\nTry '${name} --help' for more " +"information." +msgstr "" + +#: src/script/arch-update.sh:206 +#, sh-format +msgid "${update_number} update available" +msgstr "" + +#: src/script/arch-update.sh:208 +#, sh-format +msgid "${update_number} updates available" +msgstr "" + +#: src/script/arch-update.sh:244 +#, sh-format +msgid "Packages:" +msgstr "" + +#: src/script/arch-update.sh:249 +#, sh-format +msgid "AUR Packages:" +msgstr "" + +#: src/script/arch-update.sh:254 +#, sh-format +msgid "Flatpak Packages:" +msgstr "" + +#: src/script/arch-update.sh:260 +#, sh-format +msgid "No update available\\n" +msgstr "" + +#: src/script/arch-update.sh:263 +#, sh-format +msgid "Proceed with update? [Y/n]" +msgstr "" + +#: src/script/arch-update.sh:266 src/script/arch-update.sh:388 +#: src/script/arch-update.sh:421 src/script/arch-update.sh:463 +#: src/script/arch-update.sh:530 src/script/arch-update.sh:560 +#, sh-format +msgid "Y" +msgstr "" + +#: src/script/arch-update.sh:266 src/script/arch-update.sh:388 +#: src/script/arch-update.sh:421 src/script/arch-update.sh:463 +#: src/script/arch-update.sh:530 src/script/arch-update.sh:560 +#, sh-format +msgid "y" +msgstr "" + +#: src/script/arch-update.sh:270 +#, sh-format +msgid "The update has been aborted\\n" +msgstr "" + +#: src/script/arch-update.sh:287 +#, sh-format +msgid "Arch News:" +msgstr "" + +#: src/script/arch-update.sh:292 +#, sh-format +msgid "[NEW]" +msgstr "" + +#: src/script/arch-update.sh:301 +#, sh-format +msgid "" +"Select the news to read (or just press \"enter\" to proceed with update):" +msgstr "" + +#: src/script/arch-update.sh:312 +#, sh-format +msgid "Title:" +msgstr "" + +#: src/script/arch-update.sh:313 +#, sh-format +msgid "Author:" +msgstr "" + +#: src/script/arch-update.sh:314 +#, sh-format +msgid "Publication date:" +msgstr "" + +#: src/script/arch-update.sh:315 +#, sh-format +msgid "URL:" +msgstr "" + +#: src/script/arch-update.sh:331 +#, sh-format +msgid "Updating Packages...\\n" +msgstr "" + +#: src/script/arch-update.sh:336 src/script/arch-update.sh:348 +#: src/script/arch-update.sh:359 +#, sh-format +msgid "" +"An error has occurred during the update process\\nThe update has been " +"aborted\\n" +msgstr "" + +#: src/script/arch-update.sh:343 +#, sh-format +msgid "Updating AUR Packages...\\n" +msgstr "" + +#: src/script/arch-update.sh:355 +#, sh-format +msgid "Updating Flatpak Packages...\\n" +msgstr "" + +#: src/script/arch-update.sh:366 +#, sh-format +msgid "The update has been applied\\n" +msgstr "" + +#: src/script/arch-update.sh:378 +#, sh-format +msgid "Orphan Packages:" +msgstr "" + +#: src/script/arch-update.sh:382 +#, sh-format +msgid "" +"Would you like to remove this orphan package (and its potential " +"dependencies) now? [y/N]" +msgstr "" + +#: src/script/arch-update.sh:384 +#, sh-format +msgid "" +"Would you like to remove these orphan packages (and their potential " +"dependencies) now? [y/N]" +msgstr "" + +#: src/script/arch-update.sh:390 +#, sh-format +msgid "Removing Orphan Packages...\\n" +msgstr "" + +#: src/script/arch-update.sh:394 src/script/arch-update.sh:427 +#: src/script/arch-update.sh:470 src/script/arch-update.sh:480 +#: src/script/arch-update.sh:490 src/script/arch-update.sh:499 +#, sh-format +msgid "" +"An error has occurred during the removal process\\nThe removal has been " +"aborted\\n" +msgstr "" + +#: src/script/arch-update.sh:397 src/script/arch-update.sh:430 +#, sh-format +msgid "The removal has been applied\\n" +msgstr "" + +#: src/script/arch-update.sh:402 src/script/arch-update.sh:434 +#: src/script/arch-update.sh:507 +#, sh-format +msgid "The removal hasn't been applied\\n" +msgstr "" + +#: src/script/arch-update.sh:406 +#, sh-format +msgid "No orphan package found\\n" +msgstr "" + +#: src/script/arch-update.sh:411 +#, sh-format +msgid "Flatpak Unused Packages:" +msgstr "" + +#: src/script/arch-update.sh:415 +#, sh-format +msgid "Would you like to remove this Flatpak unused package now? [y/N]" +msgstr "" + +#: src/script/arch-update.sh:417 +#, sh-format +msgid "Would you like to remove these Flatpak unused packages now? [y/N]" +msgstr "" + +#: src/script/arch-update.sh:423 +#, sh-format +msgid "Removing Flatpak Unused Packages..." +msgstr "" + +#: src/script/arch-update.sh:438 +#, sh-format +msgid "No Flatpak unused package found\\n" +msgstr "" + +#: src/script/arch-update.sh:455 +#, sh-format +msgid "Cached Packages:\\nThere's an old or uninstalled cached package\\n" +msgstr "" + +#: src/script/arch-update.sh:456 +#, sh-format +msgid "Would you like to remove it from the cache now? [Y/n]" +msgstr "" + +#: src/script/arch-update.sh:458 +#, sh-format +msgid "Cached Packages:\\nThere are old and/or uninstalled cached packages\\n" +msgstr "" + +#: src/script/arch-update.sh:459 +#, sh-format +msgid "Would you like to remove them from the cache now? [Y/n]" +msgstr "" + +#: src/script/arch-update.sh:466 src/script/arch-update.sh:486 +#, sh-format +msgid "Removing old cached packages..." +msgstr "" + +#: src/script/arch-update.sh:476 src/script/arch-update.sh:495 +#, sh-format +msgid "Removing uninstalled cached packages..." +msgstr "" + +#: src/script/arch-update.sh:511 +#, sh-format +msgid "No old or uninstalled cached package found\\n" +msgstr "" + +#: src/script/arch-update.sh:520 +#, sh-format +msgid "Pacnew Files:" +msgstr "" + +#: src/script/arch-update.sh:524 +#, sh-format +msgid "Would you like to process this file now? [Y/n]" +msgstr "" + +#: src/script/arch-update.sh:526 +#, sh-format +msgid "Would you like to process these files now? [Y/n]" +msgstr "" + +#: src/script/arch-update.sh:532 +#, sh-format +msgid "Processing Pacnew Files...\\n" +msgstr "" + +#: src/script/arch-update.sh:536 +#, sh-format +msgid "The pacnew file(s) processing has been applied\\n" +msgstr "" + +#: src/script/arch-update.sh:539 +#, sh-format +msgid "The pacnew file(s) processing hasn't been applied\\n" +msgstr "" + +#: src/script/arch-update.sh:543 +#, sh-format +msgid "No pacnew file found\\n" +msgstr "" + +#: src/script/arch-update.sh:556 +#, sh-format +msgid "" +"Reboot required:\\nThere's a pending kernel update on your system requiring " +"a reboot to be applied\\n" +msgstr "" + +#: src/script/arch-update.sh:557 +#, sh-format +msgid "Would you like to reboot now? [y/N]" +msgstr "" + +#: src/script/arch-update.sh:562 +#, sh-format +msgid "Rebooting in 5 seconds...\\nPress ctrl+c to abort" +msgstr "" + +#: src/script/arch-update.sh:566 +#, sh-format +msgid "" +"An error has occurred during the reboot process\\nThe reboot has been " +"aborted\\n" +msgstr "" + +#: src/script/arch-update.sh:574 +#, sh-format +msgid "" +"The reboot hasn't been performed\\nPlease, consider rebooting to finalize " +"the pending kernel update\\n" +msgstr "" + +#: src/script/arch-update.sh:578 +#, sh-format +msgid "No pending kernel update found\\n" +msgstr "" + +#: src/script/arch-update.sh:591 +#, sh-format +msgid "" +"NoNews option detected\\nPlease, keep in mind that users are expected to " +"check the latest Arch news before updating their system, to be aware of " +"eventual required manual interventions" +msgstr "" diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 0000000..adfedd7 --- /dev/null +++ b/po/fr.po @@ -0,0 +1,446 @@ +# Arch-Update French translation +# Copyright (C) 2024 Robin Candau +# This file is distributed under the same license as the Arch-Update package. +# +# Translators: +# Robin Candau , 2024 +msgid "" +msgstr "" +"Project-Id-Version: Arch-Update 1.10.1\n" +"Report-Msgid-Bugs-To: https://github.com/Antiz96/arch-update/issues\n" +"POT-Creation-Date: 2024-02-09 01:21+0100\n" +"PO-Revision-Date: 2024-02-09 09:07+0100\n" +"Last-Translator: Robin Candau \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/script/arch-update.sh:88 +#, sh-format +msgid "Press \"enter\" to continue " +msgstr "Appuyez sur \"entrée\" pour continuer " + +#: src/script/arch-update.sh:94 +#, sh-format +msgid "Press \"enter\" to quit " +msgstr "Appuyez sur \"entrée\" pour quitter " + +#: src/script/arch-update.sh:104 +#, sh-format +msgid "" +"A privilege elevation method is required\\nPlease, install sudo or doas\\n" +msgstr "" +"Une méthode d'élévation de privilège est requise\\nVeuillez installer sudo ou doas\\n" + +#: src/script/arch-update.sh:126 +#, sh-format +msgid "" +"An update notifier/applier for Arch Linux that assists you with important " +"pre/post update tasks." +msgstr "" +"Un notificateur/applicateur de mises à jour pour Arch Linux qui vous assiste dans les " +"tâches importantes d'avant/après mise à jour." + +#: src/script/arch-update.sh:128 +#, sh-format +msgid "Run ${name} to perform the main 'update' function:" +msgstr "Lancez ${name} pour exécuter la fonction principale 'update' :" + +#: src/script/arch-update.sh:129 +#, sh-format +msgid "" +"Print the list of packages available for update, then ask for the user's " +"confirmation to proceed with the installation." +msgstr "" +"Afficher la liste des paquets disponibles pour mise à jour, puis demander la confirmation de l'utilisateur " +"pour procéder à l'installation." + +#: src/script/arch-update.sh:130 +#, sh-format +msgid "" +"Before performing the update, offer to print the latest Arch Linux news." +msgstr "" +"Avant d'effectuer la mise à jour, propose d'afficher les dernières news d'Arch Linux." + +#: src/script/arch-update.sh:131 +#, sh-format +msgid "" +"Post update, check for orphan/unused packages, old cached packages, pacnew/" +"pacsave files and pending kernel update and, if there are, offers to process " +"them." +msgstr "" +"Après la mise à jour, vérification de la présence de paquets orphelins/inutilisés, d'anciens paquets mis en cache, de fichiers pacnew/" +"pacsave et de mise à jour du noyau en attente et, s'il y en a, " +"propose de les traiter." + +#: src/script/arch-update.sh:133 +#, sh-format +msgid "Options:" +msgstr "Options :" + +#: src/script/arch-update.sh:134 +#, sh-format +msgid "" +" -c, --check Check for available updates, send a desktop notification " +"containing the number of available updates (if libnotify is installed)" +msgstr "" +" -c, --check Vérifier les mises à jour disponibles, envoyer une notification de bureau " +"contenant le nombre de mises à jour disponibles (si libnotify est installé)" + +#: src/script/arch-update.sh:135 +#, sh-format +msgid " -h, --help Display this message and exit" +msgstr " -h, --help Afficher ce message et quitter" + +#: src/script/arch-update.sh:136 +#, sh-format +msgid " -V, --version Display version information and exit" +msgstr " -V, --version Afficher les informations de version et quitter" + +#: src/script/arch-update.sh:138 +#, sh-format +msgid "For more information, see the ${name}(1) man page." +msgstr "Pour plus d'informations, consultez la page de manuel ${name}(1)." + +#: src/script/arch-update.sh:139 +#, sh-format +msgid "" +"Certain options can be enabled/disabled or modified via the ${name}.conf " +"configuration file, see the ${name}.conf(5) man page." +msgstr "" +"Certaines options peuvent être activées/désactivées ou modifiées via le fichier de configuration ${name}.conf, " +"voir la page de manuel ${name}.conf(5)." + +#: src/script/arch-update.sh:150 +#, sh-format +msgid "" +"${name}: invalid option -- '${option}'\\nTry '${name} --help' for more " +"information." +msgstr "" +"${name}: option invalide -- '${option}'\\nEssayez '${name} --help' pour plus " +"d'informations." + +#: src/script/arch-update.sh:206 +#, sh-format +msgid "${update_number} update available" +msgstr "${update_number} mise à jour disponible" + +#: src/script/arch-update.sh:208 +#, sh-format +msgid "${update_number} updates available" +msgstr "${update_number} mises à jour disponibles" + +#: src/script/arch-update.sh:244 +#, sh-format +msgid "Packages:" +msgstr "Paquets :" + +#: src/script/arch-update.sh:249 +#, sh-format +msgid "AUR Packages:" +msgstr "Paquets AUR :" + +#: src/script/arch-update.sh:254 +#, sh-format +msgid "Flatpak Packages:" +msgstr "Paquets Flatpak :" + +#: src/script/arch-update.sh:260 +#, sh-format +msgid "No update available\\n" +msgstr "Aucune mise à jour disponible\\n" + +#: src/script/arch-update.sh:263 +#, sh-format +msgid "Proceed with update? [Y/n]" +msgstr "Procéder à la mise à jour ? [O/n]" + +#: src/script/arch-update.sh:266 src/script/arch-update.sh:388 +#: src/script/arch-update.sh:421 src/script/arch-update.sh:463 +#: src/script/arch-update.sh:530 src/script/arch-update.sh:560 +#, sh-format +msgid "Y" +msgstr "O" + +#: src/script/arch-update.sh:266 src/script/arch-update.sh:388 +#: src/script/arch-update.sh:421 src/script/arch-update.sh:463 +#: src/script/arch-update.sh:530 src/script/arch-update.sh:560 +#, sh-format +msgid "y" +msgstr "o" + +#: src/script/arch-update.sh:270 +#, sh-format +msgid "The update has been aborted\\n" +msgstr "La mise à jour a été abandonnée\\n" + +#: src/script/arch-update.sh:287 +#, sh-format +msgid "Arch News:" +msgstr "Arch News :" + +#: src/script/arch-update.sh:292 +#, sh-format +msgid "[NEW]" +msgstr "[NOUVEAU]" + +#: src/script/arch-update.sh:301 +#, sh-format +msgid "" +"Select the news to read (or just press \"enter\" to proceed with update):" +msgstr "" +"Sélectionnez la news à lire (ou appuyez simplement sur \"entrée\" pour procéder à la mise à jour) :" + +#: src/script/arch-update.sh:312 +#, sh-format +msgid "Title:" +msgstr "Titre :" + +#: src/script/arch-update.sh:313 +#, sh-format +msgid "Author:" +msgstr "Auteur :" + +#: src/script/arch-update.sh:314 +#, sh-format +msgid "Publication date:" +msgstr "Date de publication :" + +#: src/script/arch-update.sh:315 +#, sh-format +msgid "URL:" +msgstr "URL :" + +#: src/script/arch-update.sh:331 +#, sh-format +msgid "Updating Packages...\\n" +msgstr "Mise à jour des paquets...\\n" + +#: src/script/arch-update.sh:336 src/script/arch-update.sh:348 +#: src/script/arch-update.sh:359 +#, sh-format +msgid "" +"An error has occurred during the update process\\nThe update has been " +"aborted\\n" +msgstr "" +"Une erreur est survenue pendant le processus de mise à jour\\nLa mise à jour a été " +"abandonnée\\n" + +#: src/script/arch-update.sh:343 +#, sh-format +msgid "Updating AUR Packages...\\n" +msgstr "Mise à jour des paquets AUR...\\n" + +#: src/script/arch-update.sh:355 +#, sh-format +msgid "Updating Flatpak Packages...\\n" +msgstr "Mise à jour des paquets Flatpak...\\n" + +#: src/script/arch-update.sh:366 +#, sh-format +msgid "The update has been applied\\n" +msgstr "La mise à jour a été appliquée\\n" + +#: src/script/arch-update.sh:378 +#, sh-format +msgid "Orphan Packages:" +msgstr "Paquets orphelins :" + +#: src/script/arch-update.sh:382 +#, sh-format +msgid "" +"Would you like to remove this orphan package (and its potential " +"dependencies) now? [y/N]" +msgstr "" +"Voulez-vous supprimer ce paquet orphelin (et ses potentielles " +"dépendances) maintenant ? [o/N]" + +#: src/script/arch-update.sh:384 +#, sh-format +msgid "" +"Would you like to remove these orphan packages (and their potential " +"dependencies) now? [y/N]" +msgstr "" +"Voulez-vous supprimer ces paquets orphelins (et leurs potentielles " +"dépendances) maintenant ? [o/N]" + +#: src/script/arch-update.sh:390 +#, sh-format +msgid "Removing Orphan Packages...\\n" +msgstr "Suppression des paquets orphelins...\\n" + +#: src/script/arch-update.sh:394 src/script/arch-update.sh:427 +#: src/script/arch-update.sh:470 src/script/arch-update.sh:480 +#: src/script/arch-update.sh:490 src/script/arch-update.sh:499 +#, sh-format +msgid "" +"An error has occurred during the removal process\\nThe removal has been " +"aborted\\n" +msgstr "" +"Une erreur est survenue pendant le processus de suppression\\nLa suppression a été " +"abandonnée\\n" + +#: src/script/arch-update.sh:397 src/script/arch-update.sh:430 +#, sh-format +msgid "The removal has been applied\\n" +msgstr "La suppression a été appliquée\\n" + +#: src/script/arch-update.sh:402 src/script/arch-update.sh:434 +#: src/script/arch-update.sh:507 +#, sh-format +msgid "The removal hasn't been applied\\n" +msgstr "La suppression n'a pas été appliquée\\n" + +#: src/script/arch-update.sh:406 +#, sh-format +msgid "No orphan package found\\n" +msgstr "Aucun paquet orphelin n'a été trouvé\\n" + +#: src/script/arch-update.sh:411 +#, sh-format +msgid "Flatpak Unused Packages:" +msgstr "Paquets Flatpak inutilisés :" + +#: src/script/arch-update.sh:415 +#, sh-format +msgid "Would you like to remove this Flatpak unused package now? [y/N]" +msgstr "Voulez-vous supprimer ce paquet Flatpak inutilisé maintenant ? [o/N]" + +#: src/script/arch-update.sh:417 +#, sh-format +msgid "Would you like to remove these Flatpak unused packages now? [y/N]" +msgstr "Voulez-vous supprimer ces paquets Flatpak inutilisés maintenant ? [o/N]" + +#: src/script/arch-update.sh:423 +#, sh-format +msgid "Removing Flatpak Unused Packages..." +msgstr "Suppression des paquets Flatpak inutilisés..." + +#: src/script/arch-update.sh:438 +#, sh-format +msgid "No Flatpak unused package found\\n" +msgstr "Aucun paquet Flatpak inutilisé n'a été trouvé\\n" + +#: src/script/arch-update.sh:455 +#, sh-format +msgid "Cached Packages:\\nThere's an old or uninstalled cached package\\n" +msgstr "Paquets mis en cache :\\nIl y a un paquet ancien ou désinstallé mis en cache\\n" + +#: src/script/arch-update.sh:456 +#, sh-format +msgid "Would you like to remove it from the cache now? [Y/n]" +msgstr "Voulez-vous le supprimer du cache maintenant ? [O/n]" + +#: src/script/arch-update.sh:458 +#, sh-format +msgid "Cached Packages:\\nThere are old and/or uninstalled cached packages\\n" +msgstr "Paquets mis en cache :\\nIl y a plusieurs paquets anciens ou désinstallés mis en cache\\n" + +#: src/script/arch-update.sh:459 +#, sh-format +msgid "Would you like to remove them from the cache now? [Y/n]" +msgstr "Voulez-vous les supprimer du cache maintenant ? [O/n]" + +#: src/script/arch-update.sh:466 src/script/arch-update.sh:486 +#, sh-format +msgid "Removing old cached packages..." +msgstr "Suppression des anciens paquets mis en cache..." + +#: src/script/arch-update.sh:476 src/script/arch-update.sh:495 +#, sh-format +msgid "Removing uninstalled cached packages..." +msgstr "Suppression des paquets désinstallés mis en cache..." + +#: src/script/arch-update.sh:511 +#, sh-format +msgid "No old or uninstalled cached package found\\n" +msgstr "Aucun paquet ancien ou désinstallé mis en cache n'a été trouvé\\n" + +#: src/script/arch-update.sh:520 +#, sh-format +msgid "Pacnew Files:" +msgstr "Fichiers Pacnew :" + +#: src/script/arch-update.sh:524 +#, sh-format +msgid "Would you like to process this file now? [Y/n]" +msgstr "Voulez-vous traiter ce fichier maintenant ? [O/n]" + +#: src/script/arch-update.sh:526 +#, sh-format +msgid "Would you like to process these files now? [Y/n]" +msgstr "Voulez-vous traiter ces fichiers maintenant ? [O/n]" + +#: src/script/arch-update.sh:532 +#, sh-format +msgid "Processing Pacnew Files...\\n" +msgstr "Traitement des fichiers pacnew...\\n" + +#: src/script/arch-update.sh:536 +#, sh-format +msgid "The pacnew file(s) processing has been applied\\n" +msgstr "Le traitement des fichiers pacnew a été appliqué\\n" + +#: src/script/arch-update.sh:539 +#, sh-format +msgid "The pacnew file(s) processing hasn't been applied\\n" +msgstr "Le traitement des fichiers pacnew n'a pas été appliqué\\n" + +#: src/script/arch-update.sh:543 +#, sh-format +msgid "No pacnew file found\\n" +msgstr "Aucun fichier pacnew n'a été trouvé\\n" + +#: src/script/arch-update.sh:556 +#, sh-format +msgid "" +"Reboot required:\\nThere's a pending kernel update on your system requiring " +"a reboot to be applied\\n" +msgstr "" +"Redémarrage nécessaire :\\nIl y a une mise à jour du noyau en attente sur votre système qui nécessite " +"un redémarrage pour être appliquée\\n" + +#: src/script/arch-update.sh:557 +#, sh-format +msgid "Would you like to reboot now? [y/N]" +msgstr "Voulez-vous redémarrer votre système maintenant ? [o/N]" + +#: src/script/arch-update.sh:562 +#, sh-format +msgid "Rebooting in 5 seconds...\\nPress ctrl+c to abort" +msgstr "Redémarrage dans 5 secondes...\\nAppuyez sur ctrl+c pour annuler" + +#: src/script/arch-update.sh:566 +#, sh-format +msgid "" +"An error has occurred during the reboot process\\nThe reboot has been " +"aborted\\n" +msgstr "" +"Une erreur est survenue pendant le processus de redémarrage\\nLe redémarrage a été " +"abandonné\\n" + +#: src/script/arch-update.sh:574 +#, sh-format +msgid "" +"The reboot hasn't been performed\\nPlease, consider rebooting to finalize " +"the pending kernel update\\n" +msgstr "" +"Le redémarrage n'a pas été effectué\\nVeuillez considérer redémarrer votre système pour finaliser " +"la mise à jour du noyau en attente\\n" + +#: src/script/arch-update.sh:578 +#, sh-format +msgid "No pending kernel update found\\n" +msgstr "Aucune mise à jour du noyau en attente n'a été trouvée\\n" + +#: src/script/arch-update.sh:591 +#, sh-format +msgid "" +"NoNews option detected\\nPlease, keep in mind that users are expected to " +"check the latest Arch news before updating their system, to be aware of " +"eventual required manual interventions" +msgstr "" +"Option NoNews détectée\\nVeuillez garder à l'esprit que les utilisateurs sont sensés " +"vérifier les dernières Arch news avant de mettre à jour leur système, afin d'être au courant des " +"éventuelles interventions manuelles nécessaires" diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index 49dc210..a5d8dd7 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -6,9 +6,18 @@ # General variables name="arch-update" +_name="Arch-Update" version="1.10.1" option="${1}" +# Declare necessary parameters for translations +# shellcheck disable=SC1091 +. gettext.sh +export TEXTDOMAIN="${_name}" # Using "Arch-Update" as TEXTDOMAIN to avoid conflicting with the "arch-update" TEXTDOMAIN used by the arch-update Gnome extension (https://extensions.gnome.org/extension/1010/archlinux-updates-indicator/) +if find /usr/local/share/locale/*/LC_MESSAGES/"${_name}".mo &> /dev/null; then + export TEXTDOMAINDIR="/usr/local/share/locale" +fi + # Checking options in arch-update.conf if grep -Eq '^[[:space:]]*NoColor[[:space:]]*$' "${XDG_CONFIG_HOME:-${HOME}/.config}/${name}/${name}.conf" 2> /dev/null; then no_color="y" @@ -76,12 +85,14 @@ error_msg() { # Definition of the continue_msg function: Print the continue message continue_msg() { - read -n 1 -r -s -p $"$(info_msg "Press \"enter\" to continue ")" && echo + msg="$(eval_gettext "Press \"enter\" to continue ")" + read -n 1 -r -s -p $"$(info_msg "${msg}")" && echo } # Definition of the quit_msg function: Print the quit message quit_msg() { - read -n 1 -r -s -p $"$(info_msg "Press \"enter\" to quit ")" && echo + msg="$(eval_gettext "Press \"enter\" to quit ")" + read -n 1 -r -s -p $"$(info_msg "${msg}")" && echo } # Definition of the evelation method to use (depending on which one is installed on the system) @@ -90,7 +101,7 @@ if command -v sudo > /dev/null; then elif command -v doas > /dev/null; then su_cmd="doas" else - error_msg "A privilege elevation method is required\nPlease, install sudo or doas\n" && quit_msg + error_msg "$(eval_gettext "A privilege elevation method is required\nPlease, install sudo or doas\n")" && quit_msg exit 2 fi @@ -112,20 +123,20 @@ help() { cat <&2 "${name}: invalid option -- '${option}'\nTry '${name} --help' for more information." + echo -e >&2 "$(eval_gettext "\${name}: invalid option -- '\${option}'\nTry '\${name} --help' for more information.")" exit 1 } +# Definition of the icon directory +icon_dir="/usr/share/icons/${name}" +[ -d "/usr/local/share/icons/${name}" ] && icon_dir="/usr/local/share/icons/${name}" + # Definition of the icon_checking function: Change icon to "checking" icon_checking() { - cp -f /usr/share/icons/arch-update/arch-update_checking.svg /usr/share/icons/arch-update/arch-update.svg || exit 3 + cp -f "${icon_dir}/${name}_checking.svg" "${icon_dir}/${name}.svg" || exit 3 } # Definition of the icon_updates_available function: Change icon to "updates-available" icon_updates_available() { - cp -f /usr/share/icons/arch-update/arch-update_updates-available.svg /usr/share/icons/arch-update/arch-update.svg || exit 3 + cp -f "${icon_dir}/${name}_updates-available.svg" "${icon_dir}/${name}.svg" || exit 3 } # Definition of the icon_installing function: Change icon to "installing" icon_installing() { - cp -f /usr/share/icons/arch-update/arch-update_installing.svg /usr/share/icons/arch-update/arch-update.svg || exit 3 + cp -f "${icon_dir}/${name}_installing.svg" "${icon_dir}/${name}.svg" || exit 3 } # Definition of the icon_up_to_date function: Change icon to "up to date" icon_up_to_date() { - cp -f /usr/share/icons/arch-update/arch-update_up-to-date.svg /usr/share/icons/arch-update/arch-update.svg || exit 3 + cp -f "${icon_dir}/${name}_up-to-date.svg" "${icon_dir}/${name}.svg" || exit 3 } # Definition of the check function: Check for available updates, change the icon accordingly and send a desktop notification containing the number of available updates @@ -188,9 +203,9 @@ check() { if ! diff "${statedir}/current_check" "${statedir}/last_check" &> /dev/null; then update_number=$(wc -l "${statedir}/current_check" | awk '{print $1}') if [ "${update_number}" -eq 1 ]; then - notify-send -i /usr/share/icons/arch-update/arch-update_updates-available.svg "Arch-Update" "${update_number} update available" + notify-send -i "${icon_dir}/${name}_updates-available.svg" "${_name}" "$(eval_gettext "\${update_number} update available")" else - notify-send -i /usr/share/icons/arch-update/arch-update_updates-available.svg "Arch-Update" "${update_number} updates available" + notify-send -i "${icon_dir}/${name}_updates-available.svg" "${_name}" "$(eval_gettext "\${update_number} updates available")" fi fi fi @@ -226,33 +241,33 @@ list_packages() { fi if [ -n "${packages}" ]; then - main_msg "Packages:" + main_msg "$(eval_gettext "Packages:")" echo -e "${packages}\n" fi if [ -n "${aur_packages}" ]; then - main_msg "AUR Packages:" + main_msg "$(eval_gettext "AUR Packages:")" echo -e "${aur_packages}\n" fi if [ -n "${flatpak_packages}" ]; then - main_msg "Flatpak Packages:" + main_msg "$(eval_gettext "Flatpak Packages:")" echo -e "${flatpak_packages}\n" fi if [ -z "${packages}" ] && [ -z "${aur_packages}" ] && [ -z "${flatpak_packages}" ]; then icon_up_to_date - info_msg "No update available\n" + info_msg "$(eval_gettext "No update available\n")" else icon_updates_available - ask_msg "Proceed with update? [Y/n]" + ask_msg "$(eval_gettext "Proceed with update? [Y/n]")" case "${answer}" in - [Yy]|"") + "$(eval_gettext "Y")"|"$(eval_gettext "y")"|"") proceed_with_update="y" ;; *) - error_msg "The update has been aborted\n" && quit_msg + error_msg "$(eval_gettext "The update has been aborted\n")" && quit_msg exit 4 ;; esac @@ -269,12 +284,13 @@ list_news() { mapfile -t news_dates < <(echo "${news}" | htmlq td | grep -v "class" | grep "[0-9]" | sed "s/<[^>]*>//g" | head -5 | xargs -I{} date -d "{}" "+%s") echo - main_msg "Arch News:" + main_msg "$(eval_gettext "Arch News:")" i=1 while IFS= read -r line; do if [ "${news_dates["${i}-1"]}" -ge "$(date -d "$(date "+%Y-%m-%d" -d "15 days ago")" "+%s")" ]; then - echo -e "${i} - ${line} ${green}[NEW]${color_off}" + new_tag="$(eval_gettext "[NEW]")" + echo -e "${i} - ${line} ${green}${new_tag}${color_off}" else echo "${i} - ${line}" fi @@ -282,7 +298,7 @@ list_news() { done < <(printf '%s\n' "${news_titles}") echo - ask_msg "Select the news to read (or just press \"enter\" to proceed with update):" + ask_msg "$(eval_gettext "Select the news to read (or just press \"enter\" to proceed with update):")" case "${answer}" in 1|2|3|4|5) @@ -293,7 +309,11 @@ list_news() { news_author=$(echo "${news_content}" | htmlq -t .article-info | cut -f3- -d " ") news_date=$(echo "${news_content}" | htmlq -t .article-info | cut -f1 -d " ") news_article=$(echo "${news_content}" | htmlq -t .article-content) - echo -e "\n${blue}---${color_off}\n${bold}Title:${color_off} ${news_selected}\n${bold}Author:${color_off} ${news_author}\n${bold}Publication date:${color_off} ${news_date}\n${bold}URL:${color_off} ${news_url}\n${blue}---${color_off}\n\n${news_article}\n" && continue_msg + title_tag="$(eval_gettext "Title:")" + author_tag="$(eval_gettext "Author:")" + publication_date_tag="$(eval_gettext "Publication date:")" + url_tag="$(eval_gettext "URL:")" + echo -e "\n${blue}---${color_off}\n${bold}${title_tag}${color_off} ${news_selected}\n${bold}${author_tag}${color_off} ${news_author}\n${bold}${publication_date_tag}${color_off} ${news_date}\n${bold}${url_tag}${color_off} ${news_url}\n${blue}---${color_off}\n\n${news_article}\n" && continue_msg ;; *) redo="n" @@ -308,42 +328,42 @@ update() { if [ -n "${packages}" ]; then echo - main_msg "Updating Packages...\n" + main_msg "$(eval_gettext "Updating Packages...\n")" if ! "${su_cmd}" pacman -Syu; then icon_updates_available echo - error_msg "An error has occurred during the update process\nThe update has been aborted\n" && quit_msg + error_msg "$(eval_gettext "An error has occurred during the update process\nThe update has been aborted\n")" && quit_msg exit 5 fi fi if [ -n "${aur_packages}" ]; then echo - main_msg "Updating AUR Packages...\n" + main_msg "$(eval_gettext "Updating AUR Packages...\n")" if ! "${aur_helper}" -Syu; then icon_updates_available echo - error_msg "An error has occurred during the update process\nThe update has been aborted\n" && quit_msg + error_msg "$(eval_gettext "An error has occurred during the update process\nThe update has been aborted\n")" && quit_msg exit 5 fi fi if [ -n "${flatpak_packages}" ]; then echo - main_msg "Updating Flatpak Packages...\n" + main_msg "$(eval_gettext "Updating Flatpak Packages...\n")" if ! flatpak update; then icon_updates_available - error_msg "An error has occurred during the update process\nThe update has been aborted\n" && quit_msg + error_msg "$(eval_gettext "An error has occurred during the update process\nThe update has been aborted\n")" && quit_msg exit 5 fi fi icon_up_to_date echo - info_msg "The update has been applied\n" + info_msg "$(eval_gettext "The update has been applied\n")" } # Definition of the orphan_packages function: Print orphan packages and offer to remove them if there are @@ -355,67 +375,67 @@ orphan_packages() { fi if [ -n "${orphan_packages}" ]; then - main_msg "Orphan Packages:" + main_msg "$(eval_gettext "Orphan Packages:")" echo -e "${orphan_packages}\n" if [ "$(echo "${orphan_packages}" | wc -l)" -eq 1 ]; then - ask_msg "Would you like to remove this orphan package (and its potential dependencies) now? [y/N]" + ask_msg "$(eval_gettext "Would you like to remove this orphan package (and its potential dependencies) now? [y/N]")" else - ask_msg "Would you like to remove these orphan packages (and their potential dependencies) now? [y/N]" + ask_msg "$(eval_gettext "Would you like to remove these orphan packages (and their potential dependencies) now? [y/N]")" fi case "${answer}" in - [Yy]) + "$(eval_gettext "Y")"|"$(eval_gettext "y")") echo - main_msg "Removing Orphan Packages...\n" + main_msg "$(eval_gettext "Removing Orphan Packages...\n")" if ! pacman -Qtdq | "${su_cmd}" pacman -Rns -; then echo - error_msg "An error has occurred during the removal process\nThe removal has been aborted\n" + error_msg "$(eval_gettext "An error has occurred during the removal process\nThe removal has been aborted\n")" else echo - info_msg "The removal has been applied\n" + info_msg "$(eval_gettext "The removal has been applied\n")" fi ;; *) echo - info_msg "The removal hasn't been applied\n" + info_msg "$(eval_gettext "The removal hasn't been applied\n")" ;; esac else - info_msg "No orphan package found\n" + info_msg "$(eval_gettext "No orphan package found\n")" fi if [ -n "${flatpak}" ]; then if [ -n "${flatpak_unused}" ]; then - main_msg "Flatpak Unused Packages:" + main_msg "$(eval_gettext "Flatpak Unused Packages:")" echo -e "${flatpak_unused}\n" if [ "$(echo "${flatpak_unused}" | wc -l)" -eq 1 ]; then - ask_msg "Would you like to remove this Flatpak unused package now? [y/N]" + ask_msg "$(eval_gettext "Would you like to remove this Flatpak unused package now? [y/N]")" else - ask_msg "Would you like to remove these Flatpak unused packages now? [y/N]" + ask_msg "$(eval_gettext "Would you like to remove these Flatpak unused packages now? [y/N]")" fi case "${answer}" in - [Yy]) + "$(eval_gettext "Y")"|"$(eval_gettext "y")") echo - main_msg "Removing Flatpak Unused Packages..." + main_msg "$(eval_gettext "Removing Flatpak Unused Packages...")" if ! flatpak remove --unused; then echo - error_msg "An error has occurred the removal process\nThe removal has been aborted\n" + error_msg "$(eval_gettext "An error has occurred during the removal process\nThe removal has been aborted\n")" else echo - info_msg "The removal has been applied\n" + info_msg "$(eval_gettext "The removal has been applied\n")" fi ;; *) - info_msg "The removal hasn't been applied\n" + info_msg "$(eval_gettext "The removal hasn't been applied\n")" ;; esac else - info_msg "No Flatpak unused package found\n" + info_msg "$(eval_gettext "No Flatpak unused package found\n")" fi fi } @@ -432,51 +452,51 @@ packages_cache() { if [ "${pacman_cache_total}" -gt 0 ]; then if [ "${pacman_cache_total}" -eq 1 ]; then - main_msg "Cached Packages:\nThere's an old or uninstalled cached package\n" - ask_msg "Would you like to remove it from the cache now? [Y/n]" + main_msg "$(eval_gettext "Cached Packages:\nThere's an old or uninstalled cached package\n")" + ask_msg "$(eval_gettext "Would you like to remove it from the cache now? [Y/n]")" else - main_msg "Cached Packages:\nThere are old and/or uninstalled cached packages\n" - ask_msg "Would you like to remove them from the cache now? [Y/n]" + main_msg "$(eval_gettext "Cached Packages:\nThere are old and/or uninstalled cached packages\n")" + ask_msg "$(eval_gettext "Would you like to remove them from the cache now? [Y/n]")" fi case "${answer}" in - [Yy]|"") + "$(eval_gettext "Y")"|"$(eval_gettext "y")"|"") if [ "${pacman_cache_old}" -gt 0 ] && [ "${pacman_cache_uninstalled}" -eq 0 ]; then echo - main_msg "Removing old cached packages..." + main_msg "$(eval_gettext "Removing old cached packages...")" if ! "${su_cmd}" paccache -rk"${old_packages_num}"; then echo - error_msg "An error has occurred during the removal process\nThe removal has been aborted\n" + error_msg "$(eval_gettext "An error has occurred during the removal process\nThe removal has been aborted\n")" else echo fi elif [ "${pacman_cache_old}" -eq 0 ] && [ "${pacman_cache_uninstalled}" -gt 0 ]; then echo - main_msg "Removing uninstalled cached packages..." + main_msg "$(eval_gettext "Removing uninstalled cached packages...")" if ! "${su_cmd}" paccache -ruk"${uninstalled_packages_num}"; then echo - error_msg "An error has occurred during the removal process\nThe removal has been aborted\n" + error_msg "$(eval_gettext "An error has occurred during the removal process\nThe removal has been aborted\n")" else echo fi elif [ "${pacman_cache_old}" -gt 0 ] && [ "${pacman_cache_uninstalled}" -gt 0 ]; then echo - main_msg "Removing old cached packages..." + main_msg "$(eval_gettext "Removing old cached packages...")" if ! "${su_cmd}" paccache -rk"${old_packages_num}"; then echo - error_msg "An error has occurred during the removal process\nThe removal has been aborted\n" + error_msg "$(eval_gettext "An error has occurred during the removal process\nThe removal has been aborted\n")" else echo fi - main_msg "Removing uninstalled cached packages..." + main_msg "$(eval_gettext "Removing uninstalled cached packages...")" if ! "${su_cmd}" paccache -ruk"${uninstalled_packages_num}"; then echo - error_msg "An error has occurred during the removal process\nThe removal has been aborted\n" + error_msg "$(eval_gettext "An error has occurred during the removal process\nThe removal has been aborted\n")" else echo fi @@ -484,11 +504,11 @@ packages_cache() { ;; *) echo - info_msg "The removal hasn't been applied\n" + info_msg "$(eval_gettext "The removal hasn't been applied\n")" ;; esac else - info_msg "No old or uninstalled cached package found\n" + info_msg "$(eval_gettext "No old or uninstalled cached package found\n")" fi } @@ -497,30 +517,30 @@ pacnew_files() { pacnew_files=$(pacdiff -o) if [ -n "${pacnew_files}" ]; then - main_msg "Pacnew Files:" + main_msg "$(eval_gettext "Pacnew Files:")" echo -e "${pacnew_files}\n" if [ "$(echo "${pacnew_files}" | wc -l)" -eq 1 ]; then - ask_msg "Would you like to process this file now? [Y/n]" + ask_msg "$(eval_gettext "Would you like to process this file now? [Y/n]")" else - ask_msg "Would you like to process these files now? [Y/n]" + ask_msg "$(eval_gettext "Would you like to process these files now? [Y/n]")" fi case "${answer}" in - [Yy]|"") + "$(eval_gettext "Y")"|"$(eval_gettext "y")"|"") echo - main_msg "Processing Pacnew Files...\n" + main_msg "$(eval_gettext "Processing Pacnew Files...\n")" "${su_cmd}" pacdiff echo - info_msg "The pacnew file(s) processing has been applied\n" + info_msg "$(eval_gettext "The pacnew file(s) processing has been applied\n")" ;; *) - info_msg "The pacnew file(s) processing hasn't been applied\n" + info_msg "$(eval_gettext "The pacnew file(s) processing hasn't been applied\n")" ;; esac else - info_msg "No pacnew file found\n" + info_msg "$(eval_gettext "No pacnew file found\n")" fi } @@ -533,17 +553,17 @@ kernel_reboot() { fi if [ -z "${kernel_compare}" ]; then - main_msg "Reboot required:\nThere's a pending kernel update on your system requiring a reboot to be applied\n" - ask_msg "Would you like to reboot now? [y/N]" + main_msg "$(eval_gettext "Reboot required:\nThere's a pending kernel update on your system requiring a reboot to be applied\n")" + ask_msg "$(eval_gettext "Would you like to reboot now? [y/N]")" case "${answer}" in - [Yy]) + "$(eval_gettext "Y")"|"$(eval_gettext "y")") echo - main_msg "Rebooting in 5 seconds...\nPress ctrl+c to abort" + main_msg "$(eval_gettext "Rebooting in 5 seconds...\nPress ctrl+c to abort")" sleep 5 if ! reboot; then echo - error_msg "An error has occurred during the reboot process\nThe reboot has been aborted\n" && quit_msg + error_msg "$(eval_gettext "An error has occurred during the reboot process\nThe reboot has been aborted\n")" && quit_msg exit 6 else exit 0 @@ -551,11 +571,11 @@ kernel_reboot() { ;; *) echo - warning_msg "The reboot hasn't been performed\nPlease, consider rebooting to finalize the pending kernel update\n" + warning_msg "$(eval_gettext "The reboot hasn't been performed\nPlease, consider rebooting to finalize the pending kernel update\n")" ;; esac else - info_msg "No pending kernel update found\n" + info_msg "$(eval_gettext "No pending kernel update found\n")" fi } @@ -568,7 +588,7 @@ case "${option}" in list_news else echo - warning_msg "NoNews option detected\nPlease, keep in mind that users are expected to check the latest Arch news before updating their system, to be aware of eventual required manual interventions" + warning_msg "$(eval_gettext "NoNews option detected\nPlease, keep in mind that users are expected to check the latest Arch news before updating their system, to be aware of eventual required manual interventions")" fi update fi