Raspberry Pi Weighting Control System
This project serves as a simple weighting control system, that was realized as a Bachelor Thesis
|
#include "localisation.h"
#include <unordered_map>
#include <string>
#include <fstream>
#include <exception>
#include <spdlog/spdlog.h>
#include "app_workspace.h"
#include "utility.h"
Go to the source code of this file.
Functions | |
const char * | get_localized_text (const char *key) |
Get the localized text object. More... | |
int | load_default_dict () |
Loads default language dictionary. More... | |
int | load_current_dict () |
Loads current language dictionary. This could be called with an action during runtime to change the app language. More... | |
Variables | |
std::unordered_map< std::string, std::string > | default_dict |
std::unordered_map< std::string, std::string > | current_dict |
const char * | err_string = "ERR_TXT" |
const char* get_localized_text | ( | const char * | key | ) |
Get the localized text object.
Not doing any eror cheking. Programmer MUST ensure all languages are in switch and every key has a translation in map.
key | string key |
Definition at line 18 of file localisation.cpp.
int load_current_dict | ( | ) |
Loads current language dictionary. This could be called with an action during runtime to change the app language.
Definition at line 65 of file localisation.cpp.
int load_default_dict | ( | ) |
Loads default language dictionary.
Definition at line 37 of file localisation.cpp.
std::unordered_map<std::string, std::string> current_dict |
Unordered map of current language dict, application currently doesn't have function to use this (can't set current language during runtime)
Definition at line 15 of file localisation.cpp.
std::unordered_map<std::string, std::string> default_dict |
Unordered of default language dictionary
Definition at line 12 of file localisation.cpp.
const char* err_string = "ERR_TXT" |
Definition at line 16 of file localisation.cpp.