UNIVERSAL-UPDATER IS BACK! Lmao.

This commit is contained in:
VoltZ
2019-10-31 03:23:05 +01:00
committed by GitHub
parent f64ab53907
commit c548cca57a
35 changed files with 25521 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#include "lang/lang.hpp"
#include <stdio.h>
nlohmann::json appJson;
std::string Lang::get(const std::string &key) {
if(!appJson.contains(key)) {
return "MISSING: " + key;
}
return appJson.at(key).get_ref<const std::string&>();
}
std::string langs[] = {"de", "en", "es", "fr", "it", "jp", "lt", "pt"};
void Lang::load(int lang) {
FILE* values;
values = fopen(("romfs:/lang/"+langs[lang]+"/app.json").c_str(), "rt");
if(values) appJson = nlohmann::json::parse(values, nullptr, false);
fclose(values);
}