From 43e9b83e1f812300fa5d0d7d4e38ec175652ea9c Mon Sep 17 00:00:00 2001 From: garder500 Date: Thu, 1 May 2025 17:34:02 +0200 Subject: Refactor la gestion des locales : mise à jour de la fonction get_available_locale pour retourner un enum Lang et simplification de la logique de vérification des locales. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot/include/utils.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bot/include/utils.hpp') diff --git a/bot/include/utils.hpp b/bot/include/utils.hpp index 801006a..b0482dd 100644 --- a/bot/include/utils.hpp +++ b/bot/include/utils.hpp @@ -12,7 +12,10 @@ #include using namespace dpp; -enum class Lang { en, fr }; +enum class Lang { + en, + fr, +}; namespace app { @@ -90,7 +93,7 @@ namespace app * @param locale The locale string to check * @return std::string The available locale or "en" if not found */ - std::string get_available_locale(std::string locale); + Lang get_available_locale(std::string locale); /** * @brienf translate a string from a locale, optionnal parameters and a default value -- cgit v1.2.3