fix: nom de variable en Locale
This commit is contained in:
@@ -8,23 +8,23 @@
|
||||
#include "game/options.hpp" // Para Options::console
|
||||
|
||||
// [SINGLETON]
|
||||
Locale* Locale::locale_ = nullptr;
|
||||
Locale* Locale::instance = nullptr;
|
||||
|
||||
// [SINGLETON] Crea el objeto con esta función estática
|
||||
void Locale::init(const std::string& file_path) {
|
||||
Locale::locale_ = new Locale();
|
||||
Locale::locale_->loadFromFile(file_path);
|
||||
Locale::instance = new Locale();
|
||||
Locale::instance->loadFromFile(file_path);
|
||||
}
|
||||
|
||||
// [SINGLETON] Destruye el objeto con esta función estática
|
||||
void Locale::destroy() {
|
||||
delete Locale::locale_;
|
||||
Locale::locale_ = nullptr;
|
||||
delete Locale::instance;
|
||||
Locale::instance = nullptr;
|
||||
}
|
||||
|
||||
// [SINGLETON] Con este método obtenemos el objeto y podemos trabajar con él
|
||||
auto Locale::get() -> Locale* {
|
||||
return Locale::locale_;
|
||||
return Locale::instance;
|
||||
}
|
||||
|
||||
// Devuelve la traducción de la clave o la clave como fallback
|
||||
|
||||
@@ -21,6 +21,6 @@ class Locale {
|
||||
void loadFromFile(const std::string& file_path);
|
||||
void flatten(const void* node_ptr, const std::string& prefix); // Aplana nodos YAML anidados
|
||||
|
||||
static Locale* locale_;
|
||||
static Locale* instance;
|
||||
std::unordered_map<std::string, std::string> strings_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user