diff options
| author | frosty <gabriel@bwaaa.monster> | 2026-04-01 00:37:15 +0300 |
|---|---|---|
| committer | frosty <gabriel@bwaaa.monster> | 2026-04-01 00:37:15 +0300 |
| commit | c41ab84738ddfc71d6062e0d173afa33ac2c35a6 (patch) | |
| tree | fa3f377277a99877fda4415f30cbff56468031db /src/Utility | |
| parent | 335b6f46837f3496467da50de2d9bce0c5ef6a1a (diff) | |
| download | omnisearch-c41ab84738ddfc71d6062e0d173afa33ac2c35a6.tar.gz | |
feat: begin working on localisation
Diffstat (limited to 'src/Utility')
| -rw-r--r-- | src/Utility/Utility.c | 9 | ||||
| -rw-r--r-- | src/Utility/Utility.h | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/Utility/Utility.c b/src/Utility/Utility.c index b4ad91d..0d7a28e 100644 --- a/src/Utility/Utility.c +++ b/src/Utility/Utility.c @@ -23,3 +23,12 @@ char *get_theme(const char *default_theme) { free(cookie); return strdup(default_theme); } + +char *get_locale(const char *default_locale) { + char *cookie = get_cookie("locale"); + if (cookie && beaker_get_locale_meta(cookie) != NULL) { + return cookie; + } + free(cookie); + return strdup(default_locale); +} diff --git a/src/Utility/Utility.h b/src/Utility/Utility.h index e67282f..387aae0 100644 --- a/src/Utility/Utility.h +++ b/src/Utility/Utility.h @@ -1,7 +1,10 @@ #ifndef UTILITY_H #define UTILITY_H +#include <beaker.h> + int hex_to_int(char c); char *get_theme(const char *default_theme); +char *get_locale(const char *default_locale); #endif |
