mirror of
https://github.com/Huntereb/Awoo-Installer
synced 2024-11-22 19:53:07 +00:00
28 lines
No EOL
619 B
C++
Executable file
28 lines
No EOL
619 B
C++
Executable file
#pragma once
|
|
|
|
#include <string>
|
|
#include <sstream>
|
|
#include <fstream>
|
|
#include "json.hpp"
|
|
|
|
using json = nlohmann::json;
|
|
|
|
namespace Language {
|
|
void Load();
|
|
std::string LanguageEntry(std::string key);
|
|
std::string GetRandomMsg();
|
|
inline json GetRelativeJson(json j, std::string key) {
|
|
std::istringstream ss(key);
|
|
std::string token;
|
|
|
|
while (std::getline(ss, token, '.') && j != nullptr) {
|
|
j = j[token];
|
|
}
|
|
|
|
return j;
|
|
}
|
|
}
|
|
|
|
inline std::string operator ""_lang (const char* key, size_t size) {
|
|
return Language::LanguageEntry(std::string(key, size));
|
|
} |