feat: setting default locale for instance

This commit is contained in:
frosty
2026-04-06 01:56:11 -04:00
parent e0c209c974
commit f6c8242e72
10 changed files with 27 additions and 5 deletions

View File

@@ -6,7 +6,7 @@
int home_handler(UrlParams *params) {
(void)params;
char *theme = get_theme("");
char *locale = get_locale("en_gb");
char *locale = get_locale(NULL);
TemplateContext ctx = new_context();
context_set(&ctx, "theme", theme);

View File

@@ -63,7 +63,7 @@ int images_handler(UrlParams *params) {
context_set(&ctx, "theme", theme);
free(theme);
char *locale = get_locale("en_gb");
char *locale = get_locale(NULL);
beaker_set_locale(&ctx, locale);
const char *rate_limit_msg = beaker_get_locale_value(locale, "rate_limit");

View File

@@ -461,7 +461,7 @@ int results_handler(UrlParams *params) {
context_set(&ctx, "theme", theme);
free(theme);
char *locale = get_locale("en_gb");
char *locale = get_locale(NULL);
beaker_set_locale(&ctx, locale);
const char *rate_limit_msg = beaker_get_locale_value(locale, "rate_limit");

View File

@@ -16,7 +16,7 @@ int settings_handler(UrlParams *params) {
}
char *theme = get_theme("system");
char *locale = get_locale("en_gb");
char *locale = get_locale(NULL);
LocaleInfo locales[32];
int locale_count = beaker_get_all_locales(locales, 32);