diff options
| author | garder500 <jeremy27.clara22@gmail.com> | 2025-05-01 17:34:02 +0200 |
|---|---|---|
| committer | garder500 <jeremy27.clara22@gmail.com> | 2025-05-01 17:34:02 +0200 |
| commit | 43e9b83e1f812300fa5d0d7d4e38ec175652ea9c (patch) | |
| tree | 8dd08d641e9c763cca5e41001d5d5e83d2949a2b /bot/include/utils.hpp | |
| parent | 1aa7ec4539170739986bcbb4d542f5432f98bea5 (diff) | |
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.
Diffstat (limited to 'bot/include/utils.hpp')
| -rw-r--r-- | bot/include/utils.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
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 <algorithm> 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 |
