Zmiana aplikacji na wersje lang
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { endpoints } from "./config.js";
|
||||
import { t } from "./i18n.js";
|
||||
import { showToast } from "./toast.js";
|
||||
import {
|
||||
getBillState,
|
||||
@@ -75,36 +76,42 @@ export function formatGuestQueueMessage(title, lines = []) {
|
||||
}
|
||||
|
||||
export function buildWaiterCallQueueMessage() {
|
||||
return "Przywołanie kelnera";
|
||||
return t("waiter.queue_title");
|
||||
}
|
||||
|
||||
export function buildBillRequestQueueMessage(docType) {
|
||||
const billState = getBillState();
|
||||
const lines = [
|
||||
{ label: "Forma płatności:", value: billState.payment || "nieznana" },
|
||||
{ label: "Dokument:", value: docType === "faktura" ? "faktura" : "paragon" },
|
||||
{
|
||||
label: t("bill.queue_payment"),
|
||||
value: billState.payment || t("bill.payment_unknown"),
|
||||
},
|
||||
{
|
||||
label: t("bill.queue_doc"),
|
||||
value: docType === "faktura" ? t("bill.doc_invoice") : t("bill.doc_receipt"),
|
||||
},
|
||||
];
|
||||
|
||||
if (docType === "faktura") {
|
||||
lines.push({ label: "NIP:", value: billState.nip || "—" });
|
||||
lines.push({ label: "Firma:", value: billState.company?.name || "—" });
|
||||
lines.push({ label: t("bill.queue_nip"), value: billState.nip || "—" });
|
||||
lines.push({ label: t("bill.queue_company"), value: billState.company?.name || "—" });
|
||||
const addressParts = [
|
||||
billState.company?.street,
|
||||
[billState.company?.zip, billState.company?.city].filter(Boolean).join(" "),
|
||||
].filter(Boolean);
|
||||
if (addressParts.length) {
|
||||
lines.push({ label: "Adres:", value: addressParts.join(", ") });
|
||||
lines.push({ label: t("bill.queue_address"), value: addressParts.join(", ") });
|
||||
}
|
||||
}
|
||||
|
||||
return formatGuestQueueMessage("Prośba o rachunek", lines);
|
||||
return formatGuestQueueMessage(t("bill.queue_title"), lines);
|
||||
}
|
||||
|
||||
export function guestActionBlockedMessage(messageType) {
|
||||
if (messageType === "waiter_call") {
|
||||
return "Kelner został już wezwany. Poczekaj, aż obsługa potwierdzi zgłoszenie na panelu.";
|
||||
return t("waiter.blocked");
|
||||
}
|
||||
return "Prośba o rachunek została już wysłana. Poczekaj, aż obsługa ją obsłuży.";
|
||||
return t("bill.blocked");
|
||||
}
|
||||
|
||||
export function updateGuestActionNavState() {
|
||||
|
||||
Reference in New Issue
Block a user