Compare commits

...

2 Commits

Author SHA1 Message Date
caf47e87ea add basic localization framework
Some checks failed
build_test / build (push) Failing after 3m47s
2025-04-15 20:05:49 +02:00
d79047665e easy editor works 2025-04-15 18:25:28 +02:00
6 changed files with 461 additions and 215 deletions

View File

@ -1,8 +1,8 @@
# Compiler and flags # Compiler and flags
CPPC = g++ CPPC = g++
CPPC_FLAGS = -std=c++23 -s -O3 -Wall -Wextra -Wno-write-strings -lncurses -lmenu -lform -lcups CPPC_FLAGS = -std=c++23 -s -O3 -Wall -Wextra -lncurses -lmenu -lform -lcups
DEBUG_FLAGS = -ggdb -std=c++23 -Wall -Wextra -Wno-write-strings -lncurses -lmenu -lform -lcups DEBUG_FLAGS = -ggdb -std=c++23 -Wall -lncurses -lmenu -lform -lcups
DEBUG_ASANITIZE = -fsanitize=address -ggdb -fno-omit-frame-pointer -std=c++23 -lncurses -lmenu -lcups -Wall -Wextra -Wno-write-strings DEBUG_ASANITIZE = -fsanitize=address -ggdb -fno-omit-frame-pointer -std=c++23 -lncurses -lmenu -lcups -Wall -Wextra
SRC_PATH := src SRC_PATH := src

View File

@ -1,17 +1,22 @@
#include <form.h>
#include <ncurses.h>
#include <cstring> #include <cstring>
#include <ctime> #include <ctime>
#include <form.h> #include <format>
#include <format> // C++20/C++23 feature
#include <ncurses.h>
#include <string> #include <string>
#include <vector> #include <vector>
#include "gameske_funkce.h"
#include "memory.h"
#define WHITE_ON_BLUE 9 #define HEADER_COLOR_PAIR COLOR_RED
#define BLACK_ON_WHITE 10 #define FIELD_NAME_COLOR_PAIR 10
#define INPUT_COLOR_PAIR 11
std::vector<allocation> editor_easy_allocated;
[[nodiscard]] std::string vytvorTrestniOznameni() { [[nodiscard]] std::string vytvorTrestniOznameni() {
// Pomocná funkce pro ořezání mezer (ncurses vyplňuje pole mezerami) current_allocated = &editor_easy_allocated;
auto trim = [](const char *str) -> std::string { auto trim = [](const char* str) -> std::string {
std::string s(str); std::string s(str);
if (s.empty()) if (s.empty())
return s; return s;
@ -22,199 +27,214 @@
return s.substr(start, end - start + 1); return s.substr(start, end - start + 1);
}; };
init_pair(WHITE_ON_BLUE, COLOR_WHITE, COLOR_BLUE); curs_set(1);
init_pair(BLACK_ON_WHITE, COLOR_BLACK, COLOR_WHITE);
// Velikost terminalu // Minimální velikost terminálu
int max_y, max_x; const int MIN_WIDTH = 90;
getmaxyx(stdscr, max_y, max_x); const int MIN_HEIGHT = 28;
if (COLS < MIN_WIDTH || LINES < MIN_HEIGHT) {
endwin();
throw std::runtime_error("Minimální velikost terminálu: 90x28");
}
echo(); // Nastavení barev
start_color();
init_pair(FIELD_NAME_COLOR_PAIR, COLOR_BLACK, COLOR_CYAN); // Popisky
init_pair(INPUT_COLOR_PAIR, COLOR_WHITE, COLOR_BLACK); // Vstupní pole
// Nadpis // Hlavní okno s rámečkem
attron(COLOR_PAIR(WHITE_ON_BLUE)); WINDOW* main_win = newwin(LINES - 4, COLS - 4, 2, 2);
mvprintw(0, 0, "TRESTNÍ OZNÁMENÍ - ZADÁNÍ ÚDAJŮ"); box(main_win, 0, 0);
for (int i = strlen("TRESTNÍ OZNÁMENÍ - ZADÁNÍ ÚDAJŮ"); i < max_x; i++) wrefresh(main_win);
addch(' ');
attroff(COLOR_PAIR(WHITE_ON_BLUE));
// Vytvoření polí formuláře // Okno pro popisky
const int NUM_FIELDS = 10; WINDOW* label_win = derwin(main_win, LINES - 8, 30, 1, 1);
FIELD *fields[NUM_FIELDS + 1]; // +1 pro NULL terminátor wbkgd(label_win, COLOR_PAIR(FIELD_NAME_COLOR_PAIR));
// Definice popisků a vlastností polí // Okno pro vstupní pole
struct FieldInfo { WINDOW* field_win = derwin(main_win, LINES - 8, COLS - 38, 1, 32);
const char *label; wbkgd(field_win, COLOR_PAIR(INPUT_COLOR_PAIR));
keypad(field_win, TRUE);
// Definice polí
struct FieldConfig {
const char* label;
int height; int height;
int width; int width;
bool multiline; bool multiline;
}; };
FieldInfo field_info[NUM_FIELDS] = { FieldConfig field_configs[] = {{"Jméno podavatele:", 1, 40, false},
{"Jméno a příjmení:", 1, 40, false}, {"Adresa podavatele:", 1, 50, false},
{"Adresa:", 1, 50, false}, {"Telefon podavatele:", 1, 20, false},
{"Telefon:", 1, 20, false}, {"Email podavatele:", 1, 30, false},
{"Email:", 1, 30, false},
{"Místo činu:", 1, 40, false},
{"Datum činu (dd.mm.rrrr):", 1, 15, false},
{"Popis činu:", 5, 60, true},
{"Jméno pachatele (pokud známo):", 1, 40, false},
{"Důkazy:", 4, 60, true},
{"Další informace:", 3, 60, true}};
// Vytvoření polí {"Jméno pachatele:", 1, 40, false},
int row = 2; {"Adresa pachatele:", 1, 50, false},
for (int i = 0; i < NUM_FIELDS; i++) { {"Telefon pachatele:", 1, 20, false},
mvprintw(row, 2, "%s", field_info[i].label); {"Email pachatele:", 1, 30, false},
fields[i] = new_field(field_info[i].height, field_info[i].width, row, {"Místo činu:", 1, 40, false},
30, // Začátek pole po popisku {"Datum činu (dd.mm.rrrr):", 1, 15, false},
0, 0); {"Popis činu:", 4, 60, true},
{"Důkazy:", 4, 60, true},
{"Další informace:", 4, 60, true}};
// Nastavení vlastností pole // Vykreslení popisků
set_field_back(fields[i], A_UNDERLINE); int label_row = 0;
field_opts_off(fields[i], O_AUTOSKIP); for (const FieldConfig& cfg : field_configs) {
mvwprintw(label_win, label_row, 0, "%s", cfg.label);
// Pro víceřádková pole label_row += cfg.height + 1;
if (field_info[i].multiline) {
field_opts_off(fields[i], O_STATIC);
field_opts_on(fields[i], O_WRAP);
}
row += field_info[i].height + 1;
} }
fields[NUM_FIELDS] = NULL; wrefresh(label_win);
// Vytvoření formuláře // Vytvoření formuláře
FORM *form = new_form(fields); std::vector<FIELD*> fields;
int field_row = 0;
// Vytvoření oken pro formulář for (const FieldConfig& cfg : field_configs) {
WINDOW *win_body = newwin(max_y, max_x, 0, 0); FIELD* field = new_field(cfg.height, cfg.width, field_row, 0, 0, 0);
WINDOW *win_form = derwin(win_body, max_y - 5, max_x - 4, 1, 2); set_field_back(field, A_UNDERLINE | COLOR_PAIR(INPUT_COLOR_PAIR));
field_opts_off(field, O_AUTOSKIP | O_STATIC);
// Přiřazení oken k formuláři if (cfg.multiline) {
set_form_win(form, win_body); field_opts_on(field, O_WRAP);
set_form_sub(form, win_form); set_max_field(field, 500);
// Zobrazení formuláře
post_form(form);
// Zobrazení instrukcí
mvprintw(max_y - 3, 2,
"Navigace: šipky - pohyb | Tab - další pole | Enter - nový řádek | "
"F10 - uložit");
refresh();
wrefresh(win_body);
// Zpracování vstupu od uživatele
int ch;
while ((ch = getch()) != KEY_F(10)) {
switch (ch) {
case KEY_DOWN:
form_driver(form, REQ_NEXT_FIELD);
form_driver(form, REQ_END_LINE);
break;
case KEY_UP:
form_driver(form, REQ_PREV_FIELD);
form_driver(form, REQ_END_LINE);
break;
case KEY_LEFT:
form_driver(form, REQ_PREV_CHAR);
break;
case KEY_RIGHT:
form_driver(form, REQ_NEXT_CHAR);
break;
case KEY_BACKSPACE:
case 127:
form_driver(form, REQ_DEL_PREV);
break;
case KEY_DC:
form_driver(form, REQ_DEL_CHAR);
break;
case 10: // Enter key
case KEY_ENTER: {
int idx = field_index(current_field(form));
if (field_info[idx].multiline) {
form_driver(form, REQ_NEW_LINE);
} else {
form_driver(form, REQ_NEXT_FIELD);
form_driver(form, REQ_END_LINE);
}
} break;
case '\t':
form_driver(form, REQ_NEXT_FIELD);
form_driver(form, REQ_END_LINE);
break;
case KEY_BTAB:
form_driver(form, REQ_PREV_FIELD);
form_driver(form, REQ_END_LINE);
break;
case KEY_HOME:
form_driver(form, REQ_BEG_LINE);
break;
case KEY_END:
form_driver(form, REQ_END_LINE);
break;
default:
form_driver(form, ch);
break;
} }
wrefresh(win_form); fields.push_back(field);
wrefresh(win_body); field_row += cfg.height + 1;
}
fields.push_back(nullptr);
FORM* form = new_form(&fields[0]);
set_form_win(form, field_win);
set_form_sub(form, derwin(field_win, LINES - 10, COLS - 40, 1, 1));
post_form(form);
form_driver(form, REQ_FIRST_FIELD);
// Hlavička
attron(COLOR_PAIR(HEADER_COLOR_PAIR));
mvprintw(0, (COLS - 40) / 2, "TRESTNÍ OZNÁMENÍ - ZADÁNÍ ÚDAJŮ");
mvprintw(1, 2, "Vyplňte všechny údaje a stiskněte F10 pro dokončení");
refresh();
// Hlavní smyčka
int ch;
bool exit_loop = false;
while (!exit_loop && (ch = wgetch(field_win))) {
switch (ch) {
case KEY_F(10):
exit_loop = true;
break;
case KEY_DOWN:
form_driver(form, REQ_NEXT_FIELD);
form_driver(form, REQ_END_LINE);
break;
case KEY_UP:
form_driver(form, REQ_PREV_FIELD);
form_driver(form, REQ_END_LINE);
break;
case KEY_LEFT:
form_driver(form, REQ_PREV_CHAR);
break;
case KEY_RIGHT:
form_driver(form, REQ_NEXT_CHAR);
break;
case KEY_BACKSPACE:
case 127:
form_driver(form, REQ_DEL_PREV);
break;
case KEY_DC:
form_driver(form, REQ_DEL_CHAR);
break;
case 10: // Enter
if (field_configs[current_field(form)->index].multiline) {
form_driver(form, REQ_NEW_LINE);
} else {
form_driver(form, REQ_NEXT_FIELD);
}
break;
case '\t':
form_driver(form, REQ_NEXT_FIELD);
break;
case KEY_BTAB:
form_driver(form, REQ_PREV_FIELD);
break;
default:
form_driver(form, ch);
break;
}
// Ruční aktualizace všech oken
touchwin(main_win);
wrefresh(main_win);
wrefresh(label_win);
wrefresh(field_win);
} }
// Validace před čtením dat (důležité pro získání aktuálních hodnot)[1][5] // Získání dat
form_driver(form, REQ_VALIDATION); form_driver(form, REQ_VALIDATION);
// Sběr dat z formuláře
std::vector<std::string> field_values; std::vector<std::string> field_values;
for (int i = 0; i < NUM_FIELDS; i++) { for (size_t i = 0; i < ARRAY_SIZE(field_configs); i++) {
char *buffer = field_buffer(fields[i], 0); field_values.push_back(trim(field_buffer(fields[i], 0)));
field_values.push_back(trim(buffer));
} }
// Uvolnění prostředků // Úklid
unpost_form(form); unpost_form(form);
free_form(form); free_form(form);
for (int i = 0; i < NUM_FIELDS; i++) { for (fieldnode*& f : fields)
free_field(fields[i]); if (f)
} free_field(f);
delwin(win_form); delwin(label_win);
delwin(win_body); delwin(field_win);
endwin(); delwin(main_win);
curs_set(0);
clear();
// Aktuální datum // Aktuální datum
std::time_t t = std::time(nullptr); std::time_t t = std::time(nullptr);
std::tm *now = std::localtime(&t); std::tm* now = std::localtime(&t);
char date_str[100]; char date_str[100];
std::strftime(date_str, sizeof(date_str), "%d.%m.%Y", now); std::strftime(date_str, sizeof(date_str), "%d.%m.%Y", now);
// Formátování trestního oznámení pomocí std::format (C++20/C++23) // Formátování trestního oznámení pomocí std::format (C++20/C++23)
std::string complaint = std::string complaint = std::format(
std::format(R"( R"(
TRESTNÍ OZNÁMENÍ VÝZVA K UPUŠTĚNÍ OD PROTIPRÁVNÍHO JEDNÁNÍ
Policie České republiky
Krajské ředitelství policie
Obvodní oddělení
V {} dne {} V {} dne {}
Oznamovatel: Adresát:
Jméno a příjmení: {} Jméno a příjmení: {}
Adresa: {} Adresa: {}
Telefon: {} Telefon: {}
Email: {} Email: {}
Věc: Oznámení o skutečnostech nasvědčujících tomu, že byl spáchán trestný čin Odesílatel:
Jméno a příjmení: {}
Adresa: {}
Telefon: {}
Email: {}
Věc: Výzva k okamžitému upuštění od protiprávního jednání
{} {}
K trestnému činu došlo dne {} v {}. K protiprávnímu jednání došlo dne {} v {}.
Popis skutku: Popis protiprávního jednání:
{} {}
Důkazy: Důkazy:
@ -223,31 +243,43 @@ Důkazy:
Další informace: Další informace:
{} {}
S úctou, Pokud neupustíte od výše uvedeného jednání, budu nucen/a podniknout další právní kroky, včetně podání trestního oznámení a vymáhání náhrady škody.
S pozdravem,
............................ ............................
{} {}
(podpis oznamovatele) (podpis)
*Toto není právní dokument, ale pouze vzor pro informativní účely. Pro právní poradenství se obraťte na kvalifikovaného právníka.*
)", )",
field_values[4], // Místo field_values[4], // Místo
date_str, // Aktuální datum date_str, // Aktuální datum
field_values[0], // Jméno a příjmení field_values[7], // Jméno a příjmení adresáta
field_values[1], // Adresa field_values[10], // Adresa adresáta (přidejte do pole)
field_values[2], // Telefon field_values[11], // Telefon adresáta (přidejte do pole)
field_values[3], // Email field_values[12], // Email adresáta (přidejte do pole)
field_values[7].empty()
? "Tímto podávám trestní oznámení na neznámého pachatele " // Odesílatel
"pro podezření ze spáchání trestného činu." field_values[0], // Jméno a příjmení odesílatele
: std::format("Tímto podávám trestní oznámení na: {} pro " field_values[1], // Adresa odesílatele
"podezření ze spáchání trestného činu.", field_values[2], // Telefon odesílatele
field_values[7]), field_values[3], // Email odesílatele
field_values[5], // Datum činu
field_values[4], // Místo činu field_values[7].empty()
field_values[6], // Popis činu ? "Tímto Vás vyzývám, abyste okamžitě upustil/a od protiprávního "
field_values[8], // Důkazy "jednání."
field_values[9], // Další informace : std::format("Tímto Vás, {}, vyzývám, abyste okamžitě upustil/a od "
field_values[0] // Jméno pro podpis "protiprávního jednání.",
); field_values[7]),
noecho();
field_values[5], // Datum činu
field_values[4], // Místo činu
field_values[6], // Popis činu
field_values[8], // Důkazy
field_values[9], // Další informace
field_values[0] // Jméno pro podpis
);
return complaint; return complaint;
} }

View File

@ -2,10 +2,13 @@
#include <csignal> #include <csignal>
#include <cstdlib> #include <cstdlib>
#include <iostream> #include <iostream>
#include <locale>
#include <regex>
#include "color.h" #include "color.h"
#include "const.h" #include "const.h"
#include "menu.h" #include "menu.h"
#include "signal.h" #include "signal.h"
#include "strings.h"
void PrintHelp() { void PrintHelp() {
std::cout << RED R"( ____ ____ std::cout << RED R"( ____ ____
@ -37,6 +40,19 @@ int main(int argc, char* argv[]) {
// error signal handlers // error signal handlers
signal(SIGSEGV, safe_exit); signal(SIGSEGV, safe_exit);
// set locale
{
std::locale loc("");
std::regex czech_regex("czech|cz", std::regex_constants::icase |
std::regex_constants::ECMAScript);
if (std::regex_search(loc.name(), czech_regex)) {
loc_strings = &czech_strings;
} else {
loc_strings = &english_strings;
}
}
int opt; int opt;
while ((opt = getopt(argc, argv, "hV")) != -1) { while ((opt = getopt(argc, argv, "hV")) != -1) {
switch (opt) { switch (opt) {

View File

@ -1,32 +1,34 @@
#include <curses.h>
#include <menu.h>
#include <ncurses.h>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <locale>
#include "const.h" #include "const.h"
#include "cups.h" #include "cups.h"
#include "editor_easy.h" #include "editor_easy.h"
#include "gameske_funkce.h" #include "gameske_funkce.h"
#include "memory.h" #include "memory.h"
#include "types.h" #include "types.h"
#include <clocale>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <curses.h>
#include <menu.h>
#include <ncurses.h>
std::vector<allocation> main_menu_allocated; std::vector<allocation> main_menu_allocated;
const char *choices[] = {"paradox", "kompromis", "Stereotyp", "Žena"}; const char* choices[] = {"paradox", "kompromis", "Stereotyp", "Žena"};
const char *date[] = {"2023-10-01", "2023-10-02", "2023-10-03", "2023-10-04"}; const char* date[] = {"2023-10-01", "2023-10-02", "2023-10-03", "2023-10-04"};
const char *choices2[] = {"PRINT", "EDIT", "DELETE", "Žena"}; const char* choices2[] = {"PRINT", "EDIT", "DELETE", "Žena"};
void menu() { void menu() {
current_allocated = &main_menu_allocated; current_allocated = &main_menu_allocated;
/* Initialize curses */ /* Initialize curses */
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
initscr(); initscr();
start_color(); start_color();
cbreak(); cbreak();
noecho(); noecho();
curs_set(0); // Makes cursor invisible curs_set(0); // Makes cursor invisible
keypad(stdscr, TRUE); keypad(stdscr, TRUE);
for (uint8_t i = 0; i < 8; i++) { for (uint8_t i = 0; i < 8; i++) {
init_pair(i, i, COLOR_BLACK); init_pair(i, i, COLOR_BLACK);
@ -38,7 +40,7 @@ void menu() {
complete_menu main_menu = {nullptr, nullptr, 0, nullptr}; complete_menu main_menu = {nullptr, nullptr, 0, nullptr};
main_menu_allocated.push_back({COMPLETE_MENU_TYPE, &main_menu, 1}); main_menu_allocated.push_back({COMPLETE_MENU_TYPE, &main_menu, 1});
main_menu.items = new ITEM *[ARRAY_SIZE(choices) + 1]; main_menu.items = new ITEM*[ARRAY_SIZE(choices) + 1];
main_menu.items_size = ARRAY_SIZE(choices) + 1; main_menu.items_size = ARRAY_SIZE(choices) + 1;
for (size_t i = 0; i < n_choices; ++i) { for (size_t i = 0; i < n_choices; ++i) {
main_menu.items[i] = new_item(choices[i], date[i]); main_menu.items[i] = new_item(choices[i], date[i]);
@ -75,35 +77,37 @@ void menu() {
int c; int c;
while ((c = wgetch(main_menu.win)) != KEY_F(1)) { while ((c = wgetch(main_menu.win)) != KEY_F(1)) {
switch (c) { switch (c) {
case KEY_DOWN: case KEY_DOWN:
menu_driver(main_menu.menu, REQ_DOWN_ITEM); menu_driver(main_menu.menu, REQ_DOWN_ITEM);
break; break;
case KEY_UP: case KEY_UP:
menu_driver(main_menu.menu, REQ_UP_ITEM); menu_driver(main_menu.menu, REQ_UP_ITEM);
break; break;
case 10: case 10:
refresh(); refresh();
break;
case ':':
switch (hash_djb2a(spawncmd())) {
case "print"_sh:
case "p"_sh:
// DONT FORGET TO PRINT ACTUAL DOCUMENT
printDocument("test");
current_allocated = &main_menu_allocated;
break; break;
case "easy_edit"_sh: case ':':
case "ee"_sh: switch (hash_djb2a(spawncmd())) {
vytvorTrestniOznameni(); case "print"_sh:
break; case "p"_sh:
default: // DONT FORGET TO PRINT ACTUAL DOCUMENT
print_in_middle(main_menu.win, 10, 0, 40, "Unknown command", printDocument("test");
COLOR_PAIR(1)); current_allocated = &main_menu_allocated;
break; break;
} case "easy_edit"_sh:
case "ee"_sh:
std::clog << vytvorTrestniOznameni();
break;
default:
print_in_middle(main_menu.win, 10, 0, 40, "Unknown command",
COLOR_PAIR(1));
break;
}
} }
redrawwin(main_menu.win);
wrefresh(main_menu.win); wrefresh(main_menu.win);
refresh();
} }
unpost_menu(main_menu.menu); unpost_menu(main_menu.menu);

151
src/strings.cpp Normal file
View File

@ -0,0 +1,151 @@
#include "strings.h"
strings english_strings{
.invalid_option = "Invalid option:",
.usage = "Usage:",
.options = "OPTIONS",
.print_this_help = "Print this help",
.print_version = "Print version",
.version = "Version:",
.main_menu = "Main menu",
.unknown_command = "Unknown command:",
.min_terminal_size = "Minimum terminal size: 90x28",
.name_of_submiter = "Name of submiter:",
.address_of_submiter = "Address of submiter:",
.phone_of_submiter = "Phone of submiter:",
.email_of_submiter = "Email of submiter:",
.name_of_recipient = "Name of recipient:",
.address_of_recipient = "Address of recipient:",
.phone_of_recipient = "Phone of recipient:",
.email_of_recipient = "Email of recipient:",
.place_of_incident = "Place of incident:",
.date_of_incident = "Date of incident (dd.mm.rrrr):",
.description_of_incident = "Description of incident:",
.evidence_of_incident = "Evidence of incident:",
.additional_info = "Additional info:",
.cease_and_desist_entry_of_information =
"CEASE AND DESIST - ENTRY OF INFORMATION",
.enter_all_information_and_press_f10 =
"Enter all information and press F10 to finish",
.cease_and_desist_template = R"(
CEASE AND DESIST NOTICE
In {} on {}
Recipient:
First and last name: {}
Address: {}
Phone: {}
Email: {}
Sender:
First and last name: {}
Address: {}
Phone: {}
Email: {}
Subject: Notice to immediately cease unlawful conduct
{}
The unlawful conduct occurred on {} in {}.
Description of the unlawful conduct:
{}
Evidence:
{}
Additional information:
{}
If you do not cease the above-mentioned conduct, I will be forced to take further legal action, including filing a criminal complaint and seeking compensation for damages.
Sincerely,
............................
{}
(signature)
*This is not a legal document, but only a template for informational purposes. For legal advice, please consult a qualified attorney.*
)",
.call_to_stop_illegal_activity =
"I hereby call upon you to immediately cease the unlawful conduct.",
.call_to_stop_illegal_activity_with_name =
"I hereby call upon you, {}, to immediately cease the unlawful "
"conduct."};
strings czech_strings{
.invalid_option = "Neplatná volba: ",
.usage = "Použití:",
.options = "MOŽNOSTI",
.print_this_help = "Zobrazit tuto nápovědu",
.print_version = "Zobrazit verzi",
.version = "Verze: ",
.main_menu = "Hlavní nabídka",
.unknown_command = "Neznámý příkaz: ",
.min_terminal_size = "Minimální velikost terminálu: 90x28",
.name_of_submiter = "Jméno podavatele: ",
.address_of_submiter = "Adresa podavatele: ",
.phone_of_submiter = "Telefon podavatele: ",
.email_of_submiter = "Email podavatele: ",
.name_of_recipient = "Jméno adresáta: ",
.address_of_recipient = "Adresa adresáta: ",
.phone_of_recipient = "Telefon adresáta: ",
.email_of_recipient = "Email adresáta: ",
.place_of_incident = "Místo činu: ",
.date_of_incident = "Datum činu (dd.mm.rrrr):",
.description_of_incident = "Popis činu:",
.evidence_of_incident = "Důkazy:",
.additional_info = "Další informace:",
.cease_and_desist_entry_of_information = "TRESTNÍ OZNÁMENÍ - ZADÁNÍ ÚDAJŮ",
.enter_all_information_and_press_f10 =
"Zadejte všechny údaje a stiskněte F10 pro dokončení",
.cease_and_desist_template = R"(
VÝZVA K UPUŠTĚNÍ OD PROTIPRÁVNÍHO JEDNÁNÍ
V {} dne {}
Adresát:
Jméno a příjmení: {}
Adresa: {}
Telefon: {}
Email: {}
Odesílatel:
Jméno a příjmení: {}
Adresa: {}
Telefon: {}
Email: {}
Věc: Výzva k okamžitému upuštění od protiprávního jednání
{}
K protiprávnímu jednání došlo dne {} v {}.
Popis protiprávního jednání:
{}
Důkazy:
{}
Další informace:
{}
Pokud neupustíte od výše uvedeného jednání, budu nucen/a podniknout další právní kroky, včetně podání trestního oznámení a vymáhání náhrady škody.
S pozdravem,
............................
{}
(podpis)
*Toto není právní dokument, ale pouze vzor pro informativní účely. Pro právní poradenství se obraťte na kvalifikovaného právníka.*
)",
.call_to_stop_illegal_activity =
"Tímto Vás vyzývám, abyste okamžitě upustil/a od protiprávního "
"jednání.",
.call_to_stop_illegal_activity_with_name =
"Tímto Vás, {}, vyzývám, abyste okamžitě upustil/a od protiprávního "
"jednání."};

43
src/strings.h Normal file
View File

@ -0,0 +1,43 @@
#ifndef PARADOCS_STRINGS_H_
#define PARADOCS_STRINGS_H_
typedef struct {
const char* invalid_option;
const char* usage;
const char* options;
const char* print_this_help;
const char* print_version;
const char* version;
const char* main_menu;
const char* unknown_command;
const char* min_terminal_size;
const char* name_of_submiter;
const char* address_of_submiter;
const char* phone_of_submiter;
const char* email_of_submiter;
const char* name_of_recipient;
const char* address_of_recipient;
const char* phone_of_recipient;
const char* email_of_recipient;
const char* place_of_incident;
const char* date_of_incident;
const char* description_of_incident;
const char* evidence_of_incident;
const char* additional_info;
const char* cease_and_desist_entry_of_information;
const char* enter_all_information_and_press_f10;
const char* cease_and_desist_template;
const char* call_to_stop_illegal_activity;
const char* call_to_stop_illegal_activity_with_name;
} strings;
extern strings english_strings;
extern strings czech_strings;
extern strings* loc_strings;
#endif