summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/imgui_extensions.cpp46
-rw-r--r--src/ui/ui_contacts.cpp58
-rw-r--r--src/ui/ui_earnings.cpp22
-rw-r--r--src/ui/ui_expenses.cpp74
-rw-r--r--src/ui/ui_invoices.cpp86
-rw-r--r--src/ui/ui_main.cpp22
-rw-r--r--src/ui/ui_projects.cpp34
-rw-r--r--src/ui/ui_settings.cpp50
8 files changed, 196 insertions, 196 deletions
diff --git a/src/ui/imgui_extensions.cpp b/src/ui/imgui_extensions.cpp
index 4a0117b..8c8f4c4 100644
--- a/src/ui/imgui_extensions.cpp
+++ b/src/ui/imgui_extensions.cpp
@@ -13,7 +13,7 @@ namespace ImGui
void InputTextWithError(const char* text, char* buffer, size_t buf_size, bool has_error)
{
if (has_error) {
- ImGui::PushStyleColor(ImGuiCol_Border, COLOR_ERROR_OUTLINE);
+ ImGui::PushStyleColor(ImGuiCol_Border, config::colors::COLOR_ERROR_OUTLINE);
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.5f);
}
ImGui::InputText(text, buffer, buf_size);
@@ -29,7 +29,7 @@ namespace ImGui
ImGui::SetNextItemWidth(widthAvailable*0.5f);
if (has_error) {
- ImGui::PushStyleColor(ImGuiCol_Border, COLOR_ERROR_OUTLINE);
+ ImGui::PushStyleColor(ImGuiCol_Border, config::colors::COLOR_ERROR_OUTLINE);
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.5f);
}
ImGui::InputTextWithHint(hint, hint, buffer, buf_size);
@@ -53,7 +53,7 @@ namespace ImGui
{
const char *filterPatterns[] = { "*.pdf" };
const char *file = tinyfd_openFileDialog(
- "Choose a file", // dialog title // @localize
+ "Choose a file", // dialog title // @locale::get
NULL, // default path
1, // number of filter patterns
filterPatterns, // filter patterns array
@@ -76,7 +76,7 @@ namespace ImGui
result = true;
}
ImGui::SameLine();
- ImGui::TextWrapped("Selected: %s", buffer); // @localize
+ ImGui::TextWrapped("Selected: %s", buffer); // @locale::get
}
@@ -90,16 +90,16 @@ namespace ImGui
ImGui::SetNextItemWidth(widthAvailable*0.5f);
const char* countries[30];
- for (int x = 0; x < country_count; x++)
+ for (int x = 0; x < config::country_count; x++)
{
char locale_str[20];
- snprintf(locale_str, 20, "country.%s", country_codes[x]);
- countries[x] = localize(locale_str);
+ snprintf(locale_str, 20, "country.%s", config::country_codes[x]);
+ countries[x] = locale::get(locale_str);
}
- for (int i = 0; i < country_count; i++)
+ for (int i = 0; i < config::country_count; i++)
{
- if (strcmp(country_codes[i], buffer) == 0)
+ if (strcmp(config::country_codes[i], buffer) == 0)
{
selected_country = countries[i];
break;
@@ -109,13 +109,13 @@ namespace ImGui
int selected_country_index = -1;
if (!has_a_selection) {
- ImGui::PushStyleColor(ImGuiCol_Border, COLOR_ERROR_OUTLINE);
+ ImGui::PushStyleColor(ImGuiCol_Border, config::colors::COLOR_ERROR_OUTLINE);
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.5f);
}
- if (ImGui::BeginCombo(localize("contact.form.country"), selected_country))
+ if (ImGui::BeginCombo(locale::get("contact.form.country"), selected_country))
{
- for (int n = 0; n < country_count; n++)
+ for (int n = 0; n < config::country_count; n++)
{
bool is_selected = (selected_country == countries[n]);
if (ImGui::Selectable(countries[n], is_selected)) {
@@ -136,7 +136,7 @@ namespace ImGui
}
if (selected_country_index != -1) {
- strops_copy(buffer, country_codes[selected_country_index], buf_size);
+ strops_copy(buffer, config::country_codes[selected_country_index], buf_size);
}
}
@@ -144,9 +144,9 @@ namespace ImGui
{
float widthAvailable = ImGui::GetContentRegionAvail().x;
ImGui::SetNextItemWidth(widthAvailable*0.5f);
- const char* customer_types[2] = { localize("contact.form.type.business"), localize("contact.form.type.consumer") };
+ const char* customer_types[2] = { locale::get("contact.form.type.business"), locale::get("contact.form.type.consumer") };
int currentItem = static_cast<int>(*type);
- if (ImGui::Combo(localize("contact.form.type"), &currentItem, customer_types, IM_ARRAYSIZE(customer_types)))
+ if (ImGui::Combo(locale::get("contact.form.type"), &currentItem, customer_types, IM_ARRAYSIZE(customer_types)))
{
*type = static_cast<contact_type>(currentItem);
}
@@ -159,7 +159,7 @@ namespace ImGui
static bool is_open = false;
if (has_error) {
- ImGui::PushStyleColor(ImGuiCol_Border, COLOR_ERROR_OUTLINE);
+ ImGui::PushStyleColor(ImGuiCol_Border, config::colors::COLOR_ERROR_OUTLINE);
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.5f);
}
ImGui::InputTextWithHint(hint, hint, buffer, buf_size);
@@ -230,7 +230,7 @@ namespace ImGui
snprintf(autocomplete_strings[i], 200, "%s (%s %s)", autocomplete_list[i].name, autocomplete_list[i].address.address1, autocomplete_list[i].address.address2);
}
- int autocomplete_index = ImGui::TextInputWithAutocomplete(localize("contact.form.fullname"),
+ int autocomplete_index = ImGui::TextInputWithAutocomplete(locale::get("contact.form.fullname"),
buffer->name, IM_ARRAYSIZE(buffer->name), (char**)autocomplete_strings, autocomplete_count, has_error);
if (autocomplete_index != -1)
@@ -266,12 +266,12 @@ namespace ImGui
}
int selected_costcenter_index = -1;
- if (ImGui::BeginCombo(localize("invoice.form.costcenter"), selected_costcenter == NULL ? NULL : localize(selected_costcenter->description)))
+ if (ImGui::BeginCombo(locale::get("invoice.form.costcenter"), selected_costcenter == NULL ? NULL : locale::get(selected_costcenter->description)))
{
for (u32 n = 0; n < costcenter_count; n++)
{
bool is_selected = selected_costcenter && strcmp(selected_costcenter->id, buffer[n].id) == 0;
- if (ImGui::Selectable(localize(buffer[n].description), is_selected)) {
+ if (ImGui::Selectable(locale::get(buffer[n].description), is_selected)) {
selected_costcenter_index = n;
}
}
@@ -307,7 +307,7 @@ namespace ImGui
}
int selected_project_index = -1;
- if (ImGui::BeginCombo(localize("invoice.form.project"), selected_project == NULL ? NULL : selected_project->description))
+ if (ImGui::BeginCombo(locale::get("invoice.form.project"), selected_project == NULL ? NULL : selected_project->description))
{
for (u32 n = 0; n < project_count; n++)
{
@@ -356,13 +356,13 @@ namespace ImGui
if (strcmp(selected_tax_rate->country_code, "00") == 0) {
char category_code_desc[MAX_LEN_LONG_DESC];
snprintf(category_code_desc, MAX_LEN_LONG_DESC, "taxcategory.%s", selected_tax_rate->category_code);
- snprintf(rate_str_buf, 40, "%s", localize(category_code_desc));
+ snprintf(rate_str_buf, 40, "%s", locale::get(category_code_desc));
}
else snprintf(rate_str_buf, 40, "%s/%.1f%%", selected_tax_rate->country_code, selected_tax_rate->rate);
}
if (has_error) {
- ImGui::PushStyleColor(ImGuiCol_Border, COLOR_ERROR_OUTLINE);
+ ImGui::PushStyleColor(ImGuiCol_Border, config::colors::COLOR_ERROR_OUTLINE);
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.5f);
}
@@ -375,7 +375,7 @@ namespace ImGui
if (strcmp(buffer[n].country_code, "00") == 0) {
char category_code_desc[MAX_LEN_LONG_DESC];
snprintf(category_code_desc, MAX_LEN_LONG_DESC, "taxcategory.%s", buffer[n].category_code);
- snprintf(rate_str_buf, 40, "%s", localize(category_code_desc));
+ snprintf(rate_str_buf, 40, "%s", locale::get(category_code_desc));
}
else snprintf(rate_str_buf, 40, "%s/%.1f%%", buffer[n].country_code, buffer[n].rate);
diff --git a/src/ui/ui_contacts.cpp b/src/ui/ui_contacts.cpp
index ffed39a..e282374 100644
--- a/src/ui/ui_contacts.cpp
+++ b/src/ui/ui_contacts.cpp
@@ -32,11 +32,11 @@ static contact active_contact;
void ui_draw_address_form(address* buffer, a_err last_err)
{
- ImGui::FormInputTextWithErrorHint(localize("contact.form.address1"), buffer->address1, IM_ARRAYSIZE(buffer->address1), last_err & A_ERR_MISSING_ADDRESS1);
- ImGui::FormInputTextWithErrorHint(localize("contact.form.address2"), buffer->address2, IM_ARRAYSIZE(buffer->address2), 0);
- ImGui::FormInputTextWithErrorHint(localize("contact.form.city"), buffer->city, IM_ARRAYSIZE(buffer->city), last_err & A_ERR_MISSING_CITY);
- ImGui::FormInputTextWithErrorHint(localize("contact.form.postal"), buffer->postal, IM_ARRAYSIZE(buffer->postal), last_err & A_ERR_MISSING_POSTAL);
- ImGui::FormInputTextWithErrorHint(localize("contact.form.region"), buffer->region, IM_ARRAYSIZE(buffer->region), 0);
+ ImGui::FormInputTextWithErrorHint(locale::get("contact.form.address1"), buffer->address1, IM_ARRAYSIZE(buffer->address1), last_err & A_ERR_MISSING_ADDRESS1);
+ ImGui::FormInputTextWithErrorHint(locale::get("contact.form.address2"), buffer->address2, IM_ARRAYSIZE(buffer->address2), 0);
+ ImGui::FormInputTextWithErrorHint(locale::get("contact.form.city"), buffer->city, IM_ARRAYSIZE(buffer->city), last_err & A_ERR_MISSING_CITY);
+ ImGui::FormInputTextWithErrorHint(locale::get("contact.form.postal"), buffer->postal, IM_ARRAYSIZE(buffer->postal), last_err & A_ERR_MISSING_POSTAL);
+ ImGui::FormInputTextWithErrorHint(locale::get("contact.form.region"), buffer->region, IM_ARRAYSIZE(buffer->region), 0);
ImGui::FormCountryCombo(buffer->country_code, IM_ARRAYSIZE(buffer->country_code));
}
@@ -59,7 +59,7 @@ void draw_addressee_form_ex(delivery_info* buffer, bool viewing_only = false)
if (!viewing_only) ImGui::EndDisabled();
- ImGui::FormInputTextWithErrorHint(localize("contact.form.fullname"), buffer->name, IM_ARRAYSIZE(buffer->name), last_err & A_ERR_MISSING_NAME);
+ ImGui::FormInputTextWithErrorHint(locale::get("contact.form.fullname"), buffer->name, IM_ARRAYSIZE(buffer->name), last_err & A_ERR_MISSING_NAME);
ui_draw_address_form(&buffer->address, last_err);
@@ -79,7 +79,7 @@ void draw_contact_form_ex(contact* buffer, bool viewing_only = false, bool with_
if (!viewing_only) ImGui::EndDisabled();
if (with_autocomplete) ImGui::FormContactAutocomplete(buffer, last_err & A_ERR_MISSING_NAME);
- else ImGui::FormInputTextWithErrorHint(localize("contact.form.fullname"), buffer->name, IM_ARRAYSIZE(buffer->name), last_err & A_ERR_MISSING_NAME);
+ else ImGui::FormInputTextWithErrorHint(locale::get("contact.form.fullname"), buffer->name, IM_ARRAYSIZE(buffer->name), last_err & A_ERR_MISSING_NAME);
ui_draw_address_form(&buffer->address, last_err);
@@ -88,13 +88,13 @@ void draw_contact_form_ex(contact* buffer, bool viewing_only = false, bool with_
// Fields only required for businesses.
if (buffer->type == contact_type::CONTACT_BUSINESS)
{
- ImGui::FormInputTextWithErrorHint(localize("contact.form.taxnumber"), buffer->taxid, IM_ARRAYSIZE(buffer->taxid), last_err & A_ERR_MISSING_TAXID);
- ImGui::FormInputTextWithErrorHint(localize("contact.form.businessnumber"), buffer->businessid, IM_ARRAYSIZE(buffer->businessid), last_err & A_ERR_MISSING_BUSINESSID);
+ ImGui::FormInputTextWithErrorHint(locale::get("contact.form.taxnumber"), buffer->taxid, IM_ARRAYSIZE(buffer->taxid), last_err & A_ERR_MISSING_TAXID);
+ ImGui::FormInputTextWithErrorHint(locale::get("contact.form.businessnumber"), buffer->businessid, IM_ARRAYSIZE(buffer->businessid), last_err & A_ERR_MISSING_BUSINESSID);
}
- ImGui::FormInputTextWithErrorHint(localize("contact.form.email"), buffer->email, IM_ARRAYSIZE(buffer->email), last_err & A_ERR_MISSING_EMAIL);
- ImGui::FormInputTextWithErrorHint(localize("contact.form.phonenumber"), buffer->phone_number, IM_ARRAYSIZE(buffer->phone_number), 0);
- ImGui::FormInputTextWithErrorHint(localize("contact.form.bankaccount"), buffer->bank_account, IM_ARRAYSIZE(buffer->bank_account), 0);
+ ImGui::FormInputTextWithErrorHint(locale::get("contact.form.email"), buffer->email, IM_ARRAYSIZE(buffer->email), last_err & A_ERR_MISSING_EMAIL);
+ ImGui::FormInputTextWithErrorHint(locale::get("contact.form.phonenumber"), buffer->phone_number, IM_ARRAYSIZE(buffer->phone_number), 0);
+ ImGui::FormInputTextWithErrorHint(locale::get("contact.form.bankaccount"), buffer->bank_account, IM_ARRAYSIZE(buffer->bank_account), 0);
if (viewing_only) ImGui::EndDisabled();
ImGui::PopID();
@@ -113,7 +113,7 @@ static void draw_contact_list()
if (max_page == 0) max_page = 1;
// Table header controls: create button and pagination.
- if (ImGui::Button(localize("form.create")))
+ if (ImGui::Button(locale::get("form.create")))
{
current_view_state = view_state::CREATE;
active_contact = administration_contact_create_empty();
@@ -126,7 +126,7 @@ static void draw_contact_list()
ImGui::SameLine();
bool enable_prev = current_page > 0;
if (!enable_prev) ImGui::BeginDisabled();
- if (ImGui::Button(localize("ui.prev")) && current_page > 0) current_page--;
+ if (ImGui::Button(locale::get("ui.prev")) && current_page > 0) current_page--;
if (!enable_prev) ImGui::EndDisabled();
ImGui::SameLine();
@@ -136,16 +136,16 @@ static void draw_contact_list()
ImGui::SameLine();
bool enable_next = current_page < max_page-1;
if (!enable_next) ImGui::BeginDisabled();
- if (ImGui::Button(localize("ui.next")) && current_page < max_page-1) current_page++;
+ if (ImGui::Button(locale::get("ui.next")) && current_page < max_page-1) current_page++;
if (!enable_next) ImGui::EndDisabled();
ImGui::Spacing();
if (ImGui::BeginTable("TableContacts", 4, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg)) {
- ImGui::TableSetupColumn(localize("contact.table.identifier"), ImGuiTableColumnFlags_WidthFixed, 80);
- ImGui::TableSetupColumn(localize("contact.table.name"), ImGuiTableColumnFlags_WidthStretch);
- ImGui::TableSetupColumn(localize("contact.table.address"), ImGuiTableColumnFlags_WidthStretch);
+ ImGui::TableSetupColumn(locale::get("contact.table.identifier"), ImGuiTableColumnFlags_WidthFixed, 80);
+ ImGui::TableSetupColumn(locale::get("contact.table.name"), ImGuiTableColumnFlags_WidthStretch);
+ ImGui::TableSetupColumn(locale::get("contact.table.address"), ImGuiTableColumnFlags_WidthStretch);
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 160);
ImGui::TableHeadersRow();
@@ -163,7 +163,7 @@ static void draw_contact_list()
ImGui::TableSetColumnIndex(3);
char btn_name[20];
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.view"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.view"), i);
if (ImGui::Button(btn_name)) {
active_contact = c;
current_view_state = view_state::VIEW;
@@ -171,14 +171,14 @@ static void draw_contact_list()
ImGui::SameLine();
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.change"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.change"), i);
if (ImGui::Button(btn_name)) {
active_contact = c;
current_view_state = view_state::EDIT;
}
ImGui::SameLine();
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.delete"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.delete"), i);
if (ImGui::Button(btn_name)) {
selected_for_removal = c;
ImGui::OpenPopup("ConfirmDeletePopup");
@@ -187,15 +187,15 @@ static void draw_contact_list()
// Confirmation popup before contact is deleted definitively.
if (ImGui::BeginPopupModal("ConfirmDeletePopup", nullptr, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoTitleBar)) {
- ImGui::Text(localize("form.confirmDelete"));
+ ImGui::Text(locale::get("form.confirmDelete"));
ImGui::Separator();
- if (ImGui::Button(localize("form.yes"), ImVec2(120, 0))) {
+ if (ImGui::Button(locale::get("form.yes"), ImVec2(120, 0))) {
administration_contact_remove(selected_for_removal);
ImGui::CloseCurrentPopup();
}
ImGui::SameLine();
- if (ImGui::Button(localize("form.no"), ImVec2(120, 0))) {
+ if (ImGui::Button(locale::get("form.no"), ImVec2(120, 0))) {
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
@@ -207,7 +207,7 @@ static void draw_contact_list()
static void ui_draw_contacts_create()
{
- if (ImGui::Button(localize("form.back"))) {
+ if (ImGui::Button(locale::get("form.back"))) {
current_view_state = view_state::LIST;
}
@@ -218,7 +218,7 @@ static void ui_draw_contacts_create()
if (!can_save) ImGui::BeginDisabled();
// Save button
ImGui::Spacing();
- if (ImGui::Button(localize("form.save"))) {
+ if (ImGui::Button(locale::get("form.save"))) {
administration_contact_add(active_contact);
current_view_state = view_state::LIST;
}
@@ -227,7 +227,7 @@ static void ui_draw_contacts_create()
static void ui_draw_contacts_update()
{
- if (ImGui::Button(localize("form.back"))) {
+ if (ImGui::Button(locale::get("form.back"))) {
current_view_state = view_state::LIST;
}
@@ -238,7 +238,7 @@ static void ui_draw_contacts_update()
if (!can_save) ImGui::BeginDisabled();
// Save button
ImGui::Spacing();
- if (ImGui::Button(localize("form.save"))) {
+ if (ImGui::Button(locale::get("form.save"))) {
administration_contact_update(active_contact);
current_view_state = view_state::LIST;
}
@@ -254,7 +254,7 @@ void ui_draw_contacts()
case view_state::EDIT: ui_draw_contacts_update(); break;
case view_state::VIEW:
- if (ImGui::Button(localize("form.back"))) {
+ if (ImGui::Button(locale::get("form.back"))) {
current_view_state = view_state::LIST;
}
diff --git a/src/ui/ui_earnings.cpp b/src/ui/ui_earnings.cpp
index 82fe1af..2106015 100644
--- a/src/ui/ui_earnings.cpp
+++ b/src/ui/ui_earnings.cpp
@@ -45,7 +45,7 @@ void ui_draw_earnings()
bool enable_prev = current_page > 0;
if (!enable_prev) ImGui::BeginDisabled();
- if (ImGui::Button(localize("ui.prev")) && current_page > 0) current_page--;
+ if (ImGui::Button(locale::get("ui.prev")) && current_page > 0) current_page--;
if (!enable_prev) ImGui::EndDisabled();
ImGui::SameLine();
@@ -54,7 +54,7 @@ void ui_draw_earnings()
ImGui::SameLine();
bool enable_next = current_page < max_page-1;
if (!enable_next) ImGui::BeginDisabled();
- if (ImGui::Button(localize("ui.next")) && current_page < max_page-1) current_page++;
+ if (ImGui::Button(locale::get("ui.next")) && current_page < max_page-1) current_page++;
if (!enable_next) ImGui::EndDisabled();
ImGui::Spacing();
@@ -100,7 +100,7 @@ void ui_draw_earnings()
// Uncategorized income and expenses
if (has_uncategorized_revenue || has_uncategorized_taxes || has_uncategorized_expenses) {
ImGui::TableNextRow();
- ImGui::TableSetColumnIndex(0); ImGui::Text("(%s)", localize("statement.uncategorized"));
+ ImGui::TableSetColumnIndex(0); ImGui::Text("(%s)", locale::get("statement.uncategorized"));
ImGui::TableSetColumnIndex(1); ImGui::Text("");
ImGui::TableSetColumnIndex(2); ImGui::Text("");
ImGui::TableSetColumnIndex(3); ImGui::Text("");
@@ -109,7 +109,7 @@ void ui_draw_earnings()
if (has_uncategorized_revenue) {
ImGui::TableNextRow();
- ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", localize("statement.revenue"));
+ ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", locale::get("statement.revenue"));
ImGui::TableSetColumnIndex(1); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 0].uncategorized_revenue, currency_symbol);
ImGui::TableSetColumnIndex(2); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 1].uncategorized_revenue, currency_symbol);
ImGui::TableSetColumnIndex(3); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 2].uncategorized_revenue, currency_symbol);
@@ -118,7 +118,7 @@ void ui_draw_earnings()
if (has_uncategorized_taxes) {
ImGui::TableNextRow();
- ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", localize("statement.tax"));
+ ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", locale::get("statement.tax"));
ImGui::TableSetColumnIndex(1); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 0].uncategorized_taxes, currency_symbol);
ImGui::TableSetColumnIndex(2); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 1].uncategorized_taxes, currency_symbol);
ImGui::TableSetColumnIndex(3); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 2].uncategorized_taxes, currency_symbol);
@@ -127,7 +127,7 @@ void ui_draw_earnings()
if (has_uncategorized_expenses) {
ImGui::TableNextRow();
- ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", localize("statement.expenses"));
+ ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", locale::get("statement.expenses"));
ImGui::TableSetColumnIndex(1); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 0].uncategorized_expenses, currency_symbol);
ImGui::TableSetColumnIndex(2); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 1].uncategorized_expenses, currency_symbol);
ImGui::TableSetColumnIndex(3); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 2].uncategorized_expenses, currency_symbol);
@@ -154,7 +154,7 @@ void ui_draw_earnings()
ImGui::PushFont(fontBold);
ImGui::TableNextRow();
- ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", localize("statement.revenue"));
+ ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", locale::get("statement.revenue"));
ImGui::TableSetColumnIndex(1); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 0].reports[p].revenue, currency_symbol);
ImGui::TableSetColumnIndex(2); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 1].reports[p].revenue, currency_symbol);
ImGui::TableSetColumnIndex(3); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 2].reports[p].revenue, currency_symbol);
@@ -162,7 +162,7 @@ void ui_draw_earnings()
ImGui::PopFont();
ImGui::TableNextRow();
- ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", localize("statement.tax"));
+ ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", locale::get("statement.tax"));
ImGui::TableSetColumnIndex(1); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 0].reports[p].taxes, currency_symbol);
ImGui::TableSetColumnIndex(2); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 1].reports[p].taxes, currency_symbol);
ImGui::TableSetColumnIndex(3); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 2].reports[p].taxes, currency_symbol);
@@ -170,7 +170,7 @@ void ui_draw_earnings()
ImGui::PushFont(fontBold);
ImGui::TableNextRow();
- ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", localize("statement.expenses"));
+ ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", locale::get("statement.expenses"));
ImGui::TableSetColumnIndex(1); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 0].reports[p].expenses_total, currency_symbol);
ImGui::TableSetColumnIndex(2); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 1].reports[p].expenses_total, currency_symbol);
ImGui::TableSetColumnIndex(3); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 2].reports[p].expenses_total, currency_symbol);
@@ -182,7 +182,7 @@ void ui_draw_earnings()
project_expense* expense = &report->expenses[e];
if (!expense->expense_used_in_project) continue;
ImGui::TableNextRow();
- ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", localize(expense->description));
+ ImGui::TableSetColumnIndex(0); ImGui::Text(" %s", locale::get(expense->description));
ImGui::TableSetColumnIndex(1); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 0].reports[p].expenses[e].total, currency_symbol);
ImGui::TableSetColumnIndex(2); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 1].reports[p].expenses[e].total, currency_symbol);
ImGui::TableSetColumnIndex(3); ImGui::Text("%.0f %s", statement->quarters[quarter_start + 2].reports[p].expenses[e].total, currency_symbol);
@@ -194,7 +194,7 @@ void ui_draw_earnings()
ImGui::PushFont(fontBold);
ImGui::TableNextRow();
- ImGui::TableNextColumn(); ImGui::TextUnformatted(localize("statement.profit"));
+ ImGui::TableNextColumn(); ImGui::TextUnformatted(locale::get("statement.profit"));
#define PUSH_PROFIT_COLUMN(_profit)\
ImGui::TableNextColumn(); \
diff --git a/src/ui/ui_expenses.cpp b/src/ui/ui_expenses.cpp
index c02cdce..acb53a8 100644
--- a/src/ui/ui_expenses.cpp
+++ b/src/ui/ui_expenses.cpp
@@ -27,7 +27,7 @@
#include "administration.hpp"
#include "administration_writer.hpp"
#include "locales.hpp"
-#include "import_service.hpp"
+#include "importer.hpp"
static import_invoice_request* active_import_request = 0;
@@ -65,8 +65,8 @@ static void draw_expense_form(invoice* buffer, bool viewing_only = false)
{
if (viewing_only) ImGui::BeginDisabled();
- ImGui::Text("%s: %s", localize("invoice.form.invoicenumber"), buffer->sequential_number);
- ImGui::Text("%s: %s", localize("invoice.form.billedTo"), buffer->customer.name);
+ ImGui::Text("%s: %s", locale::get("invoice.form.invoicenumber"), buffer->sequential_number);
+ ImGui::Text("%s: %s", locale::get("invoice.form.billedTo"), buffer->customer.name);
tm issued_at_date = *gmtime(&buffer->issued_at);
if (ImGui::DatePicker("##issuedAt", issued_at_date))
@@ -74,7 +74,7 @@ static void draw_expense_form(invoice* buffer, bool viewing_only = false)
buffer->issued_at = mktime(&issued_at_date);
}
ImGui::SameLine();
- ImGui::Text(localize("invoice.form.issuedat"));
+ ImGui::Text(locale::get("invoice.form.issuedat"));
tm expires_at_date = *gmtime(&buffer->expires_at);
if (ImGui::DatePicker("##expiresAt", expires_at_date))
@@ -82,7 +82,7 @@ static void draw_expense_form(invoice* buffer, bool viewing_only = false)
buffer->expires_at = mktime(&expires_at_date);
}
ImGui::SameLine();
- ImGui::Text(localize("invoice.form.expiresat"));
+ ImGui::Text(locale::get("invoice.form.expiresat"));
tm delivered_at_date = *gmtime(&buffer->delivered_at);
if (ImGui::DatePicker("##deliveredAt", delivered_at_date))
@@ -90,23 +90,23 @@ static void draw_expense_form(invoice* buffer, bool viewing_only = false)
buffer->delivered_at = mktime(&delivered_at_date);
}
ImGui::SameLine();
- ImGui::Text(localize("invoice.form.deliveredat"));
+ ImGui::Text(locale::get("invoice.form.deliveredat"));
ImGui::Separator();
- if (ImGui::FormInvoiceFileSelector("Select file...", buffer->document.original_path)) { // @localize
+ if (ImGui::FormInvoiceFileSelector("Select file...", buffer->document.original_path)) { // @locale::get
buffer->document.copy_path[0] = 0;
}
ImGui::Separator();
- ImGui::Text(localize("invoice.form.supplier"));
+ ImGui::Text(locale::get("invoice.form.supplier"));
draw_contact_form_ex(&buffer->supplier, false, true);
- ImGui::Checkbox(localize("invoice.form.triangulation"), &buffer->is_triangulation);
+ ImGui::Checkbox(locale::get("invoice.form.triangulation"), &buffer->is_triangulation);
if (buffer->is_triangulation) {
ImGui::Spacing();
- ImGui::Text(localize("invoice.form.shippinginformation"));
+ ImGui::Text(locale::get("invoice.form.shippinginformation"));
draw_addressee_form_ex(&buffer->addressee, 0);
}
ImGui::Separator();
@@ -122,7 +122,7 @@ static void draw_expense_form(invoice* buffer, bool viewing_only = false)
bool max_items_reached = administration_billing_item_count(buffer) >= MAX_BILLING_ITEMS;
if (max_items_reached) ImGui::BeginDisabled();
- if (ImGui::Button(localize(localize("invoice.form.add"))))
+ if (ImGui::Button(locale::get(locale::get("invoice.form.add"))))
{
billing_item item = administration_billing_item_create_empty();
administration_billing_item_add_to_invoice(buffer, item);
@@ -130,7 +130,7 @@ static void draw_expense_form(invoice* buffer, bool viewing_only = false)
if (max_items_reached) ImGui::EndDisabled();
ImGui::SameLine();
- ImGui::Text("| %s: ", localize("invoice.form.currency"));
+ ImGui::Text("| %s: ", locale::get("invoice.form.currency"));
ImGui::SameLine();
if (ImGui::FormCurrencyCombo(buffer->currency))
{
@@ -146,7 +146,7 @@ static void ui_draw_expenses_list()
{
if (!administration_can_create_invoices()) {
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0, 102, 204, 255)); // blue
- ImGui::Text(localize("ui.invoiceRequirementP1"));
+ ImGui::Text(locale::get("ui.invoiceRequirementP1"));
ImGui::PopStyleColor();
if (ImGui::IsItemHovered()) {
@@ -157,7 +157,7 @@ static void ui_draw_expenses_list()
}
ImGui::SameLine();
- ImGui::Text(localize("ui.invoiceRequirementP2"));
+ ImGui::Text(locale::get("ui.invoiceRequirementP2"));
return;
}
@@ -172,7 +172,7 @@ static void ui_draw_expenses_list()
if (max_page == 0) max_page = 1;
// Table header controls: create, import, and pagination.
- if (ImGui::Button(localize("form.create")))
+ if (ImGui::Button(locale::get("form.create")))
{
current_view_state = view_state::CREATE;
active_invoice = administration_invoice_create_empty(); // @leak
@@ -183,7 +183,7 @@ static void ui_draw_expenses_list()
char import_file_path[MAX_LEN_PATH] = {0};
ImGui::SameLine();
- if (ImGui::FormInvoiceFileSelector("+ Import", import_file_path)) { // @localize
+ if (ImGui::FormInvoiceFileSelector("+ Import", import_file_path)) { // @locale::get
current_view_state = view_state::VIEW_IMPORT_REQUEST;
active_invoice = administration_invoice_create_empty(); // @leak
active_invoice.customer = administration_company_info_get();
@@ -200,7 +200,7 @@ static void ui_draw_expenses_list()
ImGui::SameLine();
bool enable_prev = current_page > 0;
if (!enable_prev) ImGui::BeginDisabled();
- if (ImGui::Button(localize("ui.prev")) && current_page > 0) current_page--;
+ if (ImGui::Button(locale::get("ui.prev")) && current_page > 0) current_page--;
if (!enable_prev) ImGui::EndDisabled();
ImGui::SameLine();
@@ -210,19 +210,19 @@ static void ui_draw_expenses_list()
ImGui::SameLine();
bool enable_next = current_page < max_page-1;
if (!enable_next) ImGui::BeginDisabled();
- if (ImGui::Button(localize("ui.next")) && current_page < max_page-1) current_page++;
+ if (ImGui::Button(locale::get("ui.next")) && current_page < max_page-1) current_page++;
if (!enable_next) ImGui::EndDisabled();
ImGui::Spacing();
if (ImGui::BeginTable("TableInvoices", 7, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg)) {
- ImGui::TableSetupColumn(localize("invoice.table.invoicenumber"), ImGuiTableColumnFlags_WidthFixed, 120);
- ImGui::TableSetupColumn(localize("invoice.table.sender"));
- ImGui::TableSetupColumn(localize("invoice.table.customer"));
- ImGui::TableSetupColumn(localize("invoice.table.issuedat"));
- ImGui::TableSetupColumn(localize("invoice.table.total"));
- ImGui::TableSetupColumn(localize("invoice.table.status"));
+ ImGui::TableSetupColumn(locale::get("invoice.table.invoicenumber"), ImGuiTableColumnFlags_WidthFixed, 120);
+ ImGui::TableSetupColumn(locale::get("invoice.table.sender"));
+ ImGui::TableSetupColumn(locale::get("invoice.table.customer"));
+ ImGui::TableSetupColumn(locale::get("invoice.table.issuedat"));
+ ImGui::TableSetupColumn(locale::get("invoice.table.total"));
+ ImGui::TableSetupColumn(locale::get("invoice.table.status"));
ImGui::TableSetupColumn("");
ImGui::TableHeadersRow();
@@ -240,11 +240,11 @@ static void ui_draw_expenses_list()
ImGui::TableSetColumnIndex(3); ImGui::Text(buf);
ImGui::TableSetColumnIndex(4); ImGui::Text("%.2f %s", c.total, c.currency);
- ImGui::TableSetColumnIndex(5); ImGui::Text("%s", localize(administration_invoice_get_status_string(&c)));
+ ImGui::TableSetColumnIndex(5); ImGui::Text("%s", locale::get(administration_invoice_get_status_string(&c)));
ImGui::TableSetColumnIndex(6);
char btn_name[20];
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.view"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.view"), i);
if (ImGui::Button(btn_name)) {
active_invoice = c;
current_view_state = view_state::VIEW;
@@ -252,14 +252,14 @@ static void ui_draw_expenses_list()
ImGui::SameLine();
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.change"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.change"), i);
if (ImGui::Button(btn_name)) {
active_invoice = administration_invoice_create_copy(&c); // We create a copy because of billing item list pointers.
current_view_state = view_state::EDIT;
}
ImGui::SameLine();
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.delete"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.delete"), i);
if (ImGui::Button(btn_name)) {
selected_for_removal = c;
ImGui::OpenPopup("ConfirmDeletePopup");
@@ -268,15 +268,15 @@ static void ui_draw_expenses_list()
// Confirmation popup before contact is deleted definitively.
if (ImGui::BeginPopupModal("ConfirmDeletePopup", nullptr, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoTitleBar)) {
- ImGui::Text(localize("form.confirmDelete"));
+ ImGui::Text(locale::get("form.confirmDelete"));
ImGui::Separator();
- if (ImGui::Button(localize("form.yes"), ImVec2(120, 0))) {
+ if (ImGui::Button(locale::get("form.yes"), ImVec2(120, 0))) {
administration_invoice_remove(&selected_for_removal);
ImGui::CloseCurrentPopup();
}
ImGui::SameLine();
- if (ImGui::Button(localize("form.no"), ImVec2(120, 0))) {
+ if (ImGui::Button(locale::get("form.no"), ImVec2(120, 0))) {
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
@@ -289,7 +289,7 @@ static void ui_draw_expenses_list()
static void ui_draw_expense_update()
{
- if (ImGui::Button(localize("form.back"))) {
+ if (ImGui::Button(locale::get("form.back"))) {
current_view_state = view_state::LIST;
}
@@ -299,7 +299,7 @@ static void ui_draw_expense_update()
if (!can_save) ImGui::BeginDisabled();
ImGui::Spacing();
- if (ImGui::Button(localize("form.save"))) {
+ if (ImGui::Button(locale::get("form.save"))) {
administration_invoice_update(&active_invoice);
current_view_state = view_state::LIST;
@@ -313,7 +313,7 @@ static void ui_draw_expense_update()
static void ui_draw_expense_create()
{
- if (ImGui::Button(localize("form.back"))) {
+ if (ImGui::Button(locale::get("form.back"))) {
current_view_state = view_state::LIST;
}
@@ -323,7 +323,7 @@ static void ui_draw_expense_create()
if (!can_save) ImGui::BeginDisabled();
ImGui::Spacing();
- if (ImGui::Button(localize("form.save"))) {
+ if (ImGui::Button(locale::get("form.save"))) {
administration_invoice_add(&active_invoice);
current_view_state = view_state::LIST;
@@ -337,7 +337,7 @@ static void ui_draw_expense_create()
static void ui_draw_expense_view()
{
- if (ImGui::Button(localize("form.back"))) {
+ if (ImGui::Button(locale::get("form.back"))) {
current_view_state = view_state::LIST;
}
@@ -356,7 +356,7 @@ static void ui_draw_import_request()
return;
}
else {
- if (ImGui::Button(localize("form.back"))) {
+ if (ImGui::Button(locale::get("form.back"))) {
current_view_state = view_state::LIST;
active_import_request = 0;
return;
diff --git a/src/ui/ui_invoices.cpp b/src/ui/ui_invoices.cpp
index 4a087be..ee816a9 100644
--- a/src/ui/ui_invoices.cpp
+++ b/src/ui/ui_invoices.cpp
@@ -60,14 +60,14 @@ void draw_invoice_items_form(invoice* invoice)
if (ImGui::BeginTable("TableBillingItems", 9, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg)) {
ImGui::TableSetupColumn("##actions", ImGuiTableColumnFlags_WidthFixed, 20);
- ImGui::TableSetupColumn(localize("invoice.table.amount"), ImGuiTableColumnFlags_WidthFixed, 80);
- ImGui::TableSetupColumn(localize("invoice.table.description"));
- ImGui::TableSetupColumn(localize("invoice.table.price"), ImGuiTableColumnFlags_WidthFixed, 100);
- ImGui::TableSetupColumn(localize("invoice.table.discount"), ImGuiTableColumnFlags_WidthFixed, 100);
- ImGui::TableSetupColumn(localize("invoice.table.net"), ImGuiTableColumnFlags_WidthFixed, 100);
- ImGui::TableSetupColumn(localize("invoice.table.tax%"), ImGuiTableColumnFlags_WidthFixed, 120);
- ImGui::TableSetupColumn(localize("invoice.table.tax"), ImGuiTableColumnFlags_WidthFixed, 100);
- ImGui::TableSetupColumn(localize("invoice.table.total"), ImGuiTableColumnFlags_WidthFixed, 100);
+ ImGui::TableSetupColumn(locale::get("invoice.table.amount"), ImGuiTableColumnFlags_WidthFixed, 80);
+ ImGui::TableSetupColumn(locale::get("invoice.table.description"));
+ ImGui::TableSetupColumn(locale::get("invoice.table.price"), ImGuiTableColumnFlags_WidthFixed, 100);
+ ImGui::TableSetupColumn(locale::get("invoice.table.discount"), ImGuiTableColumnFlags_WidthFixed, 100);
+ ImGui::TableSetupColumn(locale::get("invoice.table.net"), ImGuiTableColumnFlags_WidthFixed, 100);
+ ImGui::TableSetupColumn(locale::get("invoice.table.tax%"), ImGuiTableColumnFlags_WidthFixed, 120);
+ ImGui::TableSetupColumn(locale::get("invoice.table.tax"), ImGuiTableColumnFlags_WidthFixed, 100);
+ ImGui::TableSetupColumn(locale::get("invoice.table.total"), ImGuiTableColumnFlags_WidthFixed, 100);
ImGui::TableHeadersRow();
@@ -145,7 +145,7 @@ void draw_invoice_items_form(invoice* invoice)
ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0, IM_COL32(50, 50, 50, 255));
ImGui::TableSetColumnIndex(2);
- ImGui::Text("%s %s", localize("invoice.form.finalSettlement"), administration_get_default_currency());
+ ImGui::Text("%s %s", locale::get("invoice.form.finalSettlement"), administration_get_default_currency());
ImGui::TableSetColumnIndex(4);
ImGui::InputFloat("##final_allowance", &invoice->allowance, 0.0f, 0.0f, "%.2f");
@@ -176,8 +176,8 @@ static void draw_invoice_form(invoice* buffer, bool viewing_only = false)
{
ImGui::BeginDisabled();
- ImGui::Text("%s: %s", localize("invoice.form.invoicenumber"), buffer->sequential_number);
- ImGui::Text("%s: %s", localize("invoice.form.supplier"), buffer->supplier.name);
+ ImGui::Text("%s: %s", locale::get("invoice.form.invoicenumber"), buffer->sequential_number);
+ ImGui::Text("%s: %s", locale::get("invoice.form.supplier"), buffer->supplier.name);
tm issued_at_date = *gmtime(&buffer->issued_at);
if (ImGui::DatePicker("##issuedAt", issued_at_date))
@@ -185,7 +185,7 @@ static void draw_invoice_form(invoice* buffer, bool viewing_only = false)
buffer->issued_at = mktime(&issued_at_date);
}
ImGui::SameLine();
- ImGui::Text(localize("invoice.form.issuedat"));
+ ImGui::Text(locale::get("invoice.form.issuedat"));
tm expires_at_date = *gmtime(&buffer->expires_at);
if (ImGui::DatePicker("##expiresAt", expires_at_date))
@@ -193,7 +193,7 @@ static void draw_invoice_form(invoice* buffer, bool viewing_only = false)
buffer->expires_at = mktime(&expires_at_date);
}
ImGui::SameLine();
- ImGui::Text(localize("invoice.form.expiresat"));
+ ImGui::Text(locale::get("invoice.form.expiresat"));
if (!viewing_only) ImGui::EndDisabled();
tm delivered_at_date = *gmtime(&buffer->delivered_at);
@@ -202,23 +202,23 @@ static void draw_invoice_form(invoice* buffer, bool viewing_only = false)
buffer->delivered_at = mktime(&delivered_at_date);
}
ImGui::SameLine();
- ImGui::Text(localize("invoice.form.deliveredat"));
+ ImGui::Text(locale::get("invoice.form.deliveredat"));
ImGui::Separator();
- if (ImGui::FormInvoiceFileSelector("Select file...", buffer->document.original_path)) { // @localize
+ if (ImGui::FormInvoiceFileSelector("Select file...", buffer->document.original_path)) { // @locale::get
buffer->document.copy_path[0] = 0;
}
ImGui::Separator();
- ImGui::Text(localize("invoice.form.billinginformation"));
+ ImGui::Text(locale::get("invoice.form.billinginformation"));
draw_contact_form_ex(&buffer->customer, false, true);
- ImGui::Checkbox(localize("invoice.form.triangulation"), &buffer->is_triangulation);
+ ImGui::Checkbox(locale::get("invoice.form.triangulation"), &buffer->is_triangulation);
if (buffer->is_triangulation) {
ImGui::Spacing();
- ImGui::Text(localize("invoice.form.shippinginformation"));
+ ImGui::Text(locale::get("invoice.form.shippinginformation"));
draw_addressee_form_ex(&buffer->addressee, 0);
}
ImGui::Separator();
@@ -231,7 +231,7 @@ static void draw_invoice_form(invoice* buffer, bool viewing_only = false)
bool max_items_reached = administration_billing_item_count(buffer) >= MAX_BILLING_ITEMS;
if (max_items_reached) ImGui::BeginDisabled();
- if (ImGui::Button(localize(localize("invoice.form.add"))))
+ if (ImGui::Button(locale::get(locale::get("invoice.form.add"))))
{
billing_item item = administration_billing_item_create_empty();
administration_billing_item_add_to_invoice(buffer, item);
@@ -239,7 +239,7 @@ static void draw_invoice_form(invoice* buffer, bool viewing_only = false)
if (max_items_reached) ImGui::EndDisabled();
ImGui::SameLine();
- ImGui::Text("| %s: ", localize("invoice.form.currency"));
+ ImGui::Text("| %s: ", locale::get("invoice.form.currency"));
ImGui::SameLine();
if (ImGui::FormCurrencyCombo(buffer->currency))
{
@@ -255,7 +255,7 @@ static void ui_draw_invoices_list()
{
if (!administration_can_create_invoices()) {
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0, 102, 204, 255)); // blue
- ImGui::Text(localize("ui.invoiceRequirementP1"));
+ ImGui::Text(locale::get("ui.invoiceRequirementP1"));
ImGui::PopStyleColor();
if (ImGui::IsItemHovered()) {
@@ -266,7 +266,7 @@ static void ui_draw_invoices_list()
}
ImGui::SameLine();
- ImGui::Text(localize("ui.invoiceRequirementP2"));
+ ImGui::Text(locale::get("ui.invoiceRequirementP2"));
return;
}
@@ -281,7 +281,7 @@ static void ui_draw_invoices_list()
if (max_page == 0) max_page = 1;
// Table header controls: create button and pagination.
- if (ImGui::Button(localize("form.create")))
+ if (ImGui::Button(locale::get("form.create")))
{
current_view_state = view_state::CREATE;
active_invoice = administration_invoice_create_empty(); // @leak
@@ -297,7 +297,7 @@ static void ui_draw_invoices_list()
ImGui::SameLine();
bool enable_prev = current_page > 0;
if (!enable_prev) ImGui::BeginDisabled();
- if (ImGui::Button(localize("ui.prev")) && current_page > 0) current_page--;
+ if (ImGui::Button(locale::get("ui.prev")) && current_page > 0) current_page--;
if (!enable_prev) ImGui::EndDisabled();
ImGui::SameLine();
@@ -307,19 +307,19 @@ static void ui_draw_invoices_list()
ImGui::SameLine();
bool enable_next = current_page < max_page-1;
if (!enable_next) ImGui::BeginDisabled();
- if (ImGui::Button(localize("ui.next")) && current_page < max_page-1) current_page++;
+ if (ImGui::Button(locale::get("ui.next")) && current_page < max_page-1) current_page++;
if (!enable_next) ImGui::EndDisabled();
ImGui::Spacing();
if (ImGui::BeginTable("TableInvoices", 7, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg)) {
- ImGui::TableSetupColumn(localize("invoice.table.invoicenumber"), ImGuiTableColumnFlags_WidthFixed, 120);
- ImGui::TableSetupColumn(localize("invoice.table.customer"));
- ImGui::TableSetupColumn(localize("invoice.table.addressee"));
- ImGui::TableSetupColumn(localize("invoice.table.issuedat"));
- ImGui::TableSetupColumn(localize("invoice.table.total"));
- ImGui::TableSetupColumn(localize("invoice.table.status"));
+ ImGui::TableSetupColumn(locale::get("invoice.table.invoicenumber"), ImGuiTableColumnFlags_WidthFixed, 120);
+ ImGui::TableSetupColumn(locale::get("invoice.table.customer"));
+ ImGui::TableSetupColumn(locale::get("invoice.table.addressee"));
+ ImGui::TableSetupColumn(locale::get("invoice.table.issuedat"));
+ ImGui::TableSetupColumn(locale::get("invoice.table.total"));
+ ImGui::TableSetupColumn(locale::get("invoice.table.status"));
ImGui::TableSetupColumn("");
ImGui::TableHeadersRow();
@@ -337,11 +337,11 @@ static void ui_draw_invoices_list()
ImGui::TableSetColumnIndex(3); ImGui::Text(buf);
ImGui::TableSetColumnIndex(4); ImGui::Text("%.2f %s", c.total, c.currency);
- ImGui::TableSetColumnIndex(5); ImGui::Text("%s", localize(administration_invoice_get_status_string(&c)));
+ ImGui::TableSetColumnIndex(5); ImGui::Text("%s", locale::get(administration_invoice_get_status_string(&c)));
ImGui::TableSetColumnIndex(6);
char btn_name[20];
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.view"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.view"), i);
if (ImGui::Button(btn_name)) {
active_invoice = c;
current_view_state = view_state::VIEW;
@@ -351,14 +351,14 @@ static void ui_draw_invoices_list()
if (c.status == invoice_status::INVOICE_CONCEPT)
{
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.change"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.change"), i);
if (ImGui::Button(btn_name)) {
active_invoice = administration_invoice_create_copy(&c); // We create a copy because of billing item list pointers.
current_view_state = view_state::EDIT;
}
ImGui::SameLine();
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.delete"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.delete"), i);
if (ImGui::Button(btn_name)) {
selected_for_removal = c;
ImGui::OpenPopup("ConfirmDeletePopup");
@@ -368,15 +368,15 @@ static void ui_draw_invoices_list()
// Confirmation popup before contact is deleted definitively.
if (ImGui::BeginPopupModal("ConfirmDeletePopup", nullptr, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoTitleBar)) {
- ImGui::Text(localize("form.confirmDelete"));
+ ImGui::Text(locale::get("form.confirmDelete"));
ImGui::Separator();
- if (ImGui::Button(localize("form.yes"), ImVec2(120, 0))) {
+ if (ImGui::Button(locale::get("form.yes"), ImVec2(120, 0))) {
administration_invoice_remove(&selected_for_removal);
ImGui::CloseCurrentPopup();
}
ImGui::SameLine();
- if (ImGui::Button(localize("form.no"), ImVec2(120, 0))) {
+ if (ImGui::Button(locale::get("form.no"), ImVec2(120, 0))) {
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
@@ -389,7 +389,7 @@ static void ui_draw_invoices_list()
static void ui_draw_invoice_update()
{
- if (ImGui::Button(localize("form.back"))) {
+ if (ImGui::Button(locale::get("form.back"))) {
current_view_state = view_state::LIST;
}
@@ -399,7 +399,7 @@ static void ui_draw_invoice_update()
if (!can_save) ImGui::BeginDisabled();
ImGui::Spacing();
- if (ImGui::Button(localize("form.save"))) {
+ if (ImGui::Button(locale::get("form.save"))) {
administration_invoice_update(&active_invoice);
current_view_state = view_state::LIST;
@@ -413,7 +413,7 @@ static void ui_draw_invoice_update()
static void ui_draw_invoice_create()
{
- if (ImGui::Button(localize("form.back"))) {
+ if (ImGui::Button(locale::get("form.back"))) {
current_view_state = view_state::LIST;
}
@@ -423,7 +423,7 @@ static void ui_draw_invoice_create()
if (!can_save) ImGui::BeginDisabled();
ImGui::Spacing();
- if (ImGui::Button(localize("form.save"))) {
+ if (ImGui::Button(locale::get("form.save"))) {
administration_invoice_add(&active_invoice);
current_view_state = view_state::LIST;
@@ -437,7 +437,7 @@ static void ui_draw_invoice_create()
static void ui_draw_invoice_view()
{
- if (ImGui::Button(localize("form.back"))) {
+ if (ImGui::Button(locale::get("form.back"))) {
current_view_state = view_state::LIST;
}
diff --git a/src/ui/ui_main.cpp b/src/ui/ui_main.cpp
index 45b787b..f918ce8 100644
--- a/src/ui/ui_main.cpp
+++ b/src/ui/ui_main.cpp
@@ -67,7 +67,7 @@ void ui_draw_main()
{
if (ui_state == main_state::UI_END) ui_set_state(main_state::UI_INVOICES);
- // @localize
+ // @locale::get
if (ImGui::BeginMainMenuBar())
{
if (ImGui::BeginMenu("File"))
@@ -107,22 +107,22 @@ void ui_draw_main()
float buttonWidth = sidePanelWidth;
- if (ImGui::Button(localize("nav.invoices"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_INVOICES);
- if (ImGui::Button(localize("nav.expenses"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_EXPENSES);
- if (ImGui::Button(localize("nav.contacts"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_CONTACTS);
+ if (ImGui::Button(locale::get("nav.invoices"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_INVOICES);
+ if (ImGui::Button(locale::get("nav.expenses"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_EXPENSES);
+ if (ImGui::Button(locale::get("nav.contacts"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_CONTACTS);
static bool reports_opened = true;
- if (ImGui::Button(localize("nav.reports"), ImVec2(buttonWidth, 24))) reports_opened = !reports_opened;
+ if (ImGui::Button(locale::get("nav.reports"), ImVec2(buttonWidth, 24))) reports_opened = !reports_opened;
if (reports_opened)
{
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(20.0f, 0.0f));
- if (ImGui::Button(localize("nav.reports.results"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_REPORT_RESULTS);
- if (ImGui::Button(localize("nav.reports.tax"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_REPORT_TAX);
+ if (ImGui::Button(locale::get("nav.reports.results"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_REPORT_RESULTS);
+ if (ImGui::Button(locale::get("nav.reports.tax"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_REPORT_TAX);
ImGui::PopStyleVar();
}
- if (ImGui::Button(localize("nav.projects"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_PROJECTS);
- if (ImGui::Button(localize("nav.settings"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_SETTINGS);
+ if (ImGui::Button(locale::get("nav.projects"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_PROJECTS);
+ if (ImGui::Button(locale::get("nav.settings"), ImVec2(buttonWidth, 24))) ui_set_state(main_state::UI_SETTINGS);
ImGui::PopStyleColor(1);
ImGui::PopStyleVar(3);
@@ -154,10 +154,10 @@ void ui_draw_main()
char* path = administration_get_file_path();
if (path == NULL) {
- ImGui::Text("%s: %s", localize("ui.workingOn"), localize("ui.unsavedProject"));
+ ImGui::Text("%s: %s", locale::get("ui.workingOn"), locale::get("ui.unsavedProject"));
}
else {
- ImGui::Text("%s: %s", localize("ui.workingOn"), path);
+ ImGui::Text("%s: %s", locale::get("ui.workingOn"), path);
}
ImGui::SameLine();
diff --git a/src/ui/ui_projects.cpp b/src/ui/ui_projects.cpp
index e7fa86f..560bc72 100644
--- a/src/ui/ui_projects.cpp
+++ b/src/ui/ui_projects.cpp
@@ -39,7 +39,7 @@ static void draw_project_form()
bool viewing_only = (current_view_state == view_state::VIEW);
static const char* selected_country = NULL;
- if (ImGui::Button(localize("form.back"))) {
+ if (ImGui::Button(locale::get("form.back"))) {
current_view_state = view_state::LIST;
active_project = administration_project_create_empty();
selected_country = 0;
@@ -51,10 +51,10 @@ static void draw_project_form()
a_err last_err = administration_project_is_valid(active_project);
ImGui::SetNextItemWidth(widthAvailable*0.2f);
- ImGui::InputText(localize("project.form.identifier"), active_project.id, IM_ARRAYSIZE(active_project.id));
+ ImGui::InputText(locale::get("project.form.identifier"), active_project.id, IM_ARRAYSIZE(active_project.id));
if (!viewing_only) ImGui::EndDisabled();
- ImGui::FormInputTextWithErrorHint(localize("project.form.description"), active_project.description, IM_ARRAYSIZE(active_project.description), last_err & A_ERR_MISSING_DESCRIPTION);
+ ImGui::FormInputTextWithErrorHint(locale::get("project.form.description"), active_project.description, IM_ARRAYSIZE(active_project.description), last_err & A_ERR_MISSING_DESCRIPTION);
if (viewing_only) ImGui::EndDisabled();
@@ -64,7 +64,7 @@ static void draw_project_form()
if (!can_save) ImGui::BeginDisabled();
// Save button
ImGui::Spacing();
- if (ImGui::Button(localize("form.save"))) {
+ if (ImGui::Button(locale::get("form.save"))) {
if (current_view_state == view_state::CREATE) {
administration_project_add(active_project);
}
@@ -91,7 +91,7 @@ static void draw_project_list()
s32 max_page = (administration_project_count() + items_per_page - 1) / items_per_page;
if (max_page == 0) max_page = 1;
- if (ImGui::Button(localize("form.create")))
+ if (ImGui::Button(locale::get("form.create")))
{
current_view_state = view_state::CREATE;
active_project = administration_project_create_empty();
@@ -103,7 +103,7 @@ static void draw_project_list()
ImGui::SameLine();
bool enable_prev = current_page > 0;
if (!enable_prev) ImGui::BeginDisabled();
- if (ImGui::Button(localize("ui.prev")) && current_page > 0) current_page--;
+ if (ImGui::Button(locale::get("ui.prev")) && current_page > 0) current_page--;
if (!enable_prev) ImGui::EndDisabled();
ImGui::SameLine();
@@ -112,16 +112,16 @@ static void draw_project_list()
ImGui::SameLine();
bool enable_next = current_page < max_page-1;
if (!enable_next) ImGui::BeginDisabled();
- if (ImGui::Button(localize("ui.next")) && current_page < max_page-1) current_page++;
+ if (ImGui::Button(locale::get("ui.next")) && current_page < max_page-1) current_page++;
if (!enable_next) ImGui::EndDisabled();
ImGui::Spacing();
if (ImGui::BeginTable("TableProjects", 4, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg)) {
- ImGui::TableSetupColumn(localize("project.table.identifier"), ImGuiTableColumnFlags_WidthFixed, 80);
- ImGui::TableSetupColumn(localize("project.table.status"), ImGuiTableColumnFlags_WidthFixed, 140);
- ImGui::TableSetupColumn(localize("project.table.description"), ImGuiTableColumnFlags_WidthStretch);
+ ImGui::TableSetupColumn(locale::get("project.table.identifier"), ImGuiTableColumnFlags_WidthFixed, 80);
+ ImGui::TableSetupColumn(locale::get("project.table.status"), ImGuiTableColumnFlags_WidthFixed, 140);
+ ImGui::TableSetupColumn(locale::get("project.table.description"), ImGuiTableColumnFlags_WidthStretch);
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 160);
ImGui::TableHeadersRow();
@@ -133,13 +133,13 @@ static void draw_project_list()
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text(c.id);
- ImGui::TableSetColumnIndex(1); ImGui::Text(localize(administration_project_get_status_string(c)));
+ ImGui::TableSetColumnIndex(1); ImGui::Text(locale::get(administration_project_get_status_string(c)));
ImGui::TableSetColumnIndex(2); ImGui::Text(c.description);
ImGui::TableSetColumnIndex(3);
char btn_name[20];
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.view"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.view"), i);
if (ImGui::Button(btn_name)) {
active_project = c;
current_view_state = view_state::VIEW;
@@ -148,14 +148,14 @@ static void draw_project_list()
if (c.state == project_state::PROJECT_RUNNING)
{
ImGui::SameLine();
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.change"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.change"), i);
if (ImGui::Button(btn_name)) {
active_project = c;
current_view_state = view_state::EDIT;
}
ImGui::SameLine();
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.cancel"), i);
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", locale::get("form.cancel"), i);
if (ImGui::Button(btn_name)) {
selected_for_cancellation = c;
ImGui::OpenPopup("ConfirmCancelProject");
@@ -164,15 +164,15 @@ static void draw_project_list()
}
if (ImGui::BeginPopupModal("ConfirmCancelProject", nullptr, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoTitleBar)) {
- ImGui::Text(localize("form.confirmCancelProject"));
+ ImGui::Text(locale::get("form.confirmCancelProject"));
ImGui::Separator();
- if (ImGui::Button(localize("form.yes"), ImVec2(120, 0))) {
+ if (ImGui::Button(locale::get("form.yes"), ImVec2(120, 0))) {
administration_project_cancel(selected_for_cancellation);
ImGui::CloseCurrentPopup();
}
ImGui::SameLine();
- if (ImGui::Button(localize("form.no"), ImVec2(120, 0))) {
+ if (ImGui::Button(locale::get("form.no"), ImVec2(120, 0))) {
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
diff --git a/src/ui/ui_settings.cpp b/src/ui/ui_settings.cpp
index d7dfd4d..79d65da 100644
--- a/src/ui/ui_settings.cpp
+++ b/src/ui/ui_settings.cpp
@@ -69,8 +69,8 @@ static void ui_draw_vat_rates()
if (ImGui::BeginTable("TableVatRates", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg)) {
- ImGui::TableSetupColumn(localize("settings.vat.table.country"), ImGuiTableColumnFlags_WidthFixed, 220);
- ImGui::TableSetupColumn(localize("settings.vat.table.rates"));
+ ImGui::TableSetupColumn(locale::get("settings.vat.table.country"), ImGuiTableColumnFlags_WidthFixed, 220);
+ ImGui::TableSetupColumn(locale::get("settings.vat.table.rates"));
// Used to generate headers for each individual country.
char prev_country[MAX_LEN_COUNTRY_CODE];
@@ -105,7 +105,7 @@ static void ui_draw_vat_rates()
char locale_buf[20];
snprintf(locale_buf, sizeof(locale_buf), "country.%s", c.country_code);
ImGui::TableSetColumnIndex(0);
- ImGui::Text(localize(locale_buf));
+ ImGui::Text(locale::get(locale_buf));
// If not adding an item already, show + button next to country name.
if (!is_adding_item)
@@ -132,7 +132,7 @@ static void ui_draw_vat_rates()
char category_code_desc[MAX_LEN_LONG_DESC];
snprintf(category_code_desc, MAX_LEN_LONG_DESC, "taxcategory.%s", c.category_code);
- ImGui::Text(can_be_modified ? "" : localize(category_code_desc));
+ ImGui::Text(can_be_modified ? "" : locale::get(category_code_desc));
// Column 2: When editing, show input for new rate. Else we display the stored rate and check for modify request.
@@ -145,7 +145,7 @@ static void ui_draw_vat_rates()
if (new_tax_rate.rate > 100.0f) new_tax_rate.rate = 100.0f;
ImGui::SameLine();
- if (ImGui::Button(localize("form.save"))) {
+ if (ImGui::Button(locale::get("form.save"))) {
is_editing_item = false;
is_adding_item = false;
@@ -156,7 +156,7 @@ static void ui_draw_vat_rates()
}
ImGui::SameLine();
- if (ImGui::Button(localize("form.cancel"))) {
+ if (ImGui::Button(locale::get("form.cancel"))) {
is_editing_item = false;
is_adding_item = false;
memset(&new_tax_rate, 0, sizeof(new_tax_rate));
@@ -191,7 +191,7 @@ static void ui_draw_vat_rates()
if (new_tax_rate.rate > 100.0f) new_tax_rate.rate = 100.0f;
ImGui::SameLine();
- if (ImGui::Button(localize("form.save"))) {
+ if (ImGui::Button(locale::get("form.save"))) {
is_editing_item = false;
is_adding_item = false;
@@ -202,7 +202,7 @@ static void ui_draw_vat_rates()
}
ImGui::SameLine();
- if (ImGui::Button(localize("form.cancel"))) {
+ if (ImGui::Button(locale::get("form.cancel"))) {
is_editing_item = false;
is_adding_item = false;
memset(&new_tax_rate, 0, sizeof(new_tax_rate));
@@ -225,8 +225,8 @@ static void ui_draw_cost_centers()
if (ImGui::BeginTable("TableCostCenters", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg)) {
- ImGui::TableSetupColumn(localize("settings.costcenters.table.code"), ImGuiTableColumnFlags_WidthFixed, 140);
- ImGui::TableSetupColumn(localize("settings.costcenters.table.description"));
+ ImGui::TableSetupColumn(locale::get("settings.costcenters.table.code"), ImGuiTableColumnFlags_WidthFixed, 140);
+ ImGui::TableSetupColumn(locale::get("settings.costcenters.table.description"));
for (u32 i = 0; i < cost_center_count; i++) {
cost_center c = cost_centers[i];
@@ -247,7 +247,7 @@ static void ui_draw_cost_centers()
if (!is_desc_valid) ImGui::BeginDisabled();
ImGui::SameLine();
- if (ImGui::Button(localize("form.save"))) {
+ if (ImGui::Button(locale::get("form.save"))) {
is_editing_item = false;
is_adding_item = false;
@@ -261,7 +261,7 @@ static void ui_draw_cost_centers()
if (!is_desc_valid) ImGui::EndDisabled();
ImGui::SameLine();
- if (ImGui::Button(localize("form.cancel"))) {
+ if (ImGui::Button(locale::get("form.cancel"))) {
is_editing_item = false;
is_adding_item = false;
memset(&new_cost_center, 0, sizeof(new_cost_center));
@@ -269,7 +269,7 @@ static void ui_draw_cost_centers()
}
else
{
- ImGui::Text(localize(c.description));
+ ImGui::Text(locale::get(c.description));
if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left))
{
@@ -302,7 +302,7 @@ static void ui_draw_cost_centers()
if (!can_save) ImGui::BeginDisabled();
ImGui::SameLine();
- if (ImGui::Button(localize("form.create")))
+ if (ImGui::Button(locale::get("form.create")))
{
is_adding_item = false;
is_editing_item = false;
@@ -314,7 +314,7 @@ static void ui_draw_cost_centers()
if (!can_save) ImGui::EndDisabled();
ImGui::SameLine();
- if (ImGui::Button(localize("form.cancel"))) {
+ if (ImGui::Button(locale::get("form.cancel"))) {
is_adding_item = false;
is_editing_item = false;
memset(&new_cost_center, 0, sizeof(new_cost_center));
@@ -325,7 +325,7 @@ static void ui_draw_cost_centers()
}
// If not adding a new item already, show create button at bottom of list.
- if (!is_adding_item && ImGui::Button(localize("form.create")))
+ if (!is_adding_item && ImGui::Button(locale::get("form.create")))
{
new_cost_center = administration_cost_center_create_empty();
is_adding_item = true;
@@ -336,7 +336,7 @@ static void ui_draw_cost_centers()
static void ui_draw_services()
{
// AI service
- if (ImGui::CollapsingHeader(localize("settings.services.ai_service")))
+ if (ImGui::CollapsingHeader(locale::get("settings.services.ai_service")))
{
// TODO: get this from iterator over ai_get_impl
char* services[2] = {
@@ -344,7 +344,7 @@ static void ui_draw_services()
"DeepSeek",
};
- if (ImGui::BeginCombo(localize("settings.services.ai_service.provider"), services[new_service.provider]))
+ if (ImGui::BeginCombo(locale::get("settings.services.ai_service.provider"), services[new_service.provider]))
{
for (u32 n = 0; n < 2; n++)
{
@@ -356,10 +356,10 @@ static void ui_draw_services()
ImGui::EndCombo();
}
- ImGui::InputTextWithHint(localize("settings.services.ai_service.pubkey"), localize("settings.services.ai_service.pubkey"),
+ ImGui::InputTextWithHint(locale::get("settings.services.ai_service.pubkey"), locale::get("settings.services.ai_service.pubkey"),
new_service.api_key_public, sizeof(new_service.api_key_public));
- if (ImGui::Button(localize("form.save"))) {
+ if (ImGui::Button(locale::get("form.save"))) {
administration_set_ai_service(new_service);
}
}
@@ -369,7 +369,7 @@ void ui_draw_settings()
{
if (ImGui::BeginTabBar("SettingsTabBar"))
{
- if (ImGui::BeginTabItem(localize("settings.table.company"), nullptr, select_company_tab == 1 ? ImGuiTabItemFlags_SetSelected : 0))
+ if (ImGui::BeginTabItem(locale::get("settings.table.company"), nullptr, select_company_tab == 1 ? ImGuiTabItemFlags_SetSelected : 0))
{
select_company_tab = 0;
draw_contact_form(&company_info);
@@ -378,24 +378,24 @@ void ui_draw_settings()
bool can_save = administration_contact_is_valid(company_info) == A_ERR_SUCCESS;
if (!can_save) ImGui::BeginDisabled();
ImGui::Spacing();
- if (ImGui::Button(localize("form.save"))) {
+ if (ImGui::Button(locale::get("form.save"))) {
administration_company_info_set(company_info);
}
if (!can_save) ImGui::EndDisabled();
ImGui::EndTabItem();
}
- if (ImGui::BeginTabItem(localize("settings.table.vatrates")))
+ if (ImGui::BeginTabItem(locale::get("settings.table.vatrates")))
{
ui_draw_vat_rates();
ImGui::EndTabItem();
}
- if (ImGui::BeginTabItem(localize("settings.table.costcenters")))
+ if (ImGui::BeginTabItem(locale::get("settings.table.costcenters")))
{
ui_draw_cost_centers();
ImGui::EndTabItem();
}
- if (ImGui::BeginTabItem(localize("settings.table.services")))
+ if (ImGui::BeginTabItem(locale::get("settings.table.services")))
{
ui_draw_services();
ImGui::EndTabItem();