Settings - font sizes

This commit is contained in:
2025-11-24 16:24:35 +01:00
parent 9befee44a5
commit aaeb793703
6 changed files with 201 additions and 45 deletions

39
tr.cpp
View File

@@ -1,5 +1,6 @@
#include "tr.h"
#include <stdarg.h>
#include <iostream>
void tr::add(const char *sentence, ...)
{
@@ -39,9 +40,12 @@ const char *tr::translate(const char *str)
{
std::unordered_map<std::string, Translations_t *>::iterator it;
if (_lang == "en") { return str; }
it = _translations.find(_lang);
if (it == _translations.end()) {
std::cerr << "No translation for: " << str << std::endl;
return str;
} else {
Translations_t *m = it->second;
@@ -49,6 +53,7 @@ const char *tr::translate(const char *str)
std::string s(str);
n_it = m->find(s);
if (n_it == m->end()) {
std::cerr << "No translation for: " << str << std::endl;
return str;
} else {
return n_it->second.c_str();
@@ -61,14 +66,36 @@ void tr::setLang(const std::string &l)
_lang = l;
}
#define nl(a, b) add(a, "nl:" b, nullptr)
#define en(a, b) add(a, "en:" b, nullptr)
tr::tr()
{
add("Quit", "nl:Beëindigen", nullptr);
add("New Note", "nl:Nieuwe Notitie", nullptr);
add("Show Notes", "nl:Notities Presenteren", nullptr);
add("Hide Notes", "nl:Notities Verbergen", nullptr);
add("Reload Notes", "nl:Notities opnieuw laden", nullptr);
add("Setup", "nl:Instellingen", nullptr);
nl("Quit", "Beëindigen");
nl("New Note", "Nieuwe Notitie");
nl("Show Notes", "Notities Presenteren");
nl("Hide Notes", "Notities Verbergen");
nl("Reload Notes", "Notities opnieuw laden");
nl("Setup", "Instellingen");
nl("Notes on desktop", "Noties naar achteren");
nl("Language:", "Taalinstelling:");
nl("Language:", "Taalinstelling:");
nl("Ok", "Ok");
nl("Yellownotes Setup", "Yellownotes Instellingen");
nl("Foreground Color", "Voorgrond kleur");
nl("Background Color", "Achtergrond kleur");
nl("Dark", "Donker");
nl("Yellow", "Geel");
nl("Orange", "Oranje");
nl("Blue", "Blauw");
nl("Cyan", "Cyaan");
nl("Green", "Groen");
nl("Red", "Rood");
nl("Grey", "Grijs");
nl("Font size:", "Lettertype Grootte:");
nl("Actual Font Size in Note", "Werkelijke lettertype grootte in de notitie");
_lang = "en";
}