summaryrefslogtreecommitdiff
path: root/src/locales
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2025-08-09 08:33:08 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2025-08-09 08:33:08 +0200
commit5d34aff5888d3f0c624251f15bedb96c347978d6 (patch)
tree69a49651271d645ca7eaa114cb1830bf759c0930 /src/locales
parentb94a7ae06b20d550c727d5192cea8baf3e8fb641 (diff)
refactors
Diffstat (limited to 'src/locales')
-rw-r--r--src/locales/locales.cpp29
-rw-r--r--src/locales/locales.hpp21
2 files changed, 0 insertions, 50 deletions
diff --git a/src/locales/locales.cpp b/src/locales/locales.cpp
deleted file mode 100644
index 6ec1233..0000000
--- a/src/locales/locales.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-#include "locales.hpp"
-
-locale_map locales[] = {
- {"en", en_locales, en_locale_count},
- // Add new locales here.
-};
-
-const int locale_map_count = sizeof(locales) / sizeof(locales[0]);
-
-locale_map g_locale = locales[0]; // Default to english.
-
-void set_locale(const char* key)
-{
- for (int i = 0; i < locale_map_count; ++i) {
- if (strcmp(locales[i].lang_code, key) == 0) {
- g_locale = locales[i];
- }
- }
-}
-
-const char* localize(const char* key)
-{
- for (int i = 0; i < g_locale.entry_count; ++i) {
- if (strcmp(g_locale.entries[i].key, key) == 0) {
- return g_locale.entries[i].value;
- }
- }
- return "[!MISSING!]";
-} \ No newline at end of file
diff --git a/src/locales/locales.hpp b/src/locales/locales.hpp
deleted file mode 100644
index 78bb682..0000000
--- a/src/locales/locales.hpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#pragma once
-
-#include <stdio.h>
-#include <string.h>
-
-typedef struct {
- const char* key;
- const char* value;
-} locale_entry;
-
-typedef struct {
- const char* lang_code;
- locale_entry* entries;
- int entry_count;
-} locale_map;
-
-extern locale_entry en_locales[];
-extern const int en_locale_count;
-
-void set_locale(const char key[2]);
-const char* localize(const char* key); \ No newline at end of file