Added guestName translation to kiosk.json. Implemented time.json to time util translations. Updated info.js to reflect kiosk name requirement. Updated mail.js and print.js for localized time translations. Implemented optional guest name (voucher note) within kiosk.ejs. Implemented translations within time.js. Updated docker-compose.yml. Updated dependencies. Updated README.md

This commit is contained in:
Glenn de Haan
2025-07-07 21:29:45 +02:00
parent 87fd80b0e8
commit b3f1988982
14 changed files with 135 additions and 113 deletions

View File

@@ -111,7 +111,7 @@ module.exports = () => {
*/
if(variables.kioskEnabled) {
const kioskType = types(variables.kioskVoucherType, true);
log.info('[Kiosk] Enabled!');
log.info(`[Kiosk] Enabled! ${variables.kioskNameRequired ? '(Guest Name Required!)' : ''}`);
log.info(`[Kiosk][Type] ${time(kioskType.expiration)}, ${kioskType.usage === '1' ? 'single-use' : kioskType.usage === '0' ? 'multi-use (unlimited)' : `multi-use (${kioskType.usage}x)`}${typeof kioskType.upload === "undefined" && typeof kioskType.download === "undefined" && typeof kioskType.megabytes === "undefined" ? ', no limits' : `${typeof kioskType.upload !== "undefined" ? `, upload bandwidth limit: ${kioskType.upload} kb/s` : ''}${typeof kioskType.download !== "undefined" ? `, download bandwidth limit: ${kioskType.download} kb/s` : ''}${typeof kioskType.megabytes !== "undefined" ? `, quota limit: ${kioskType.megabytes} mb` : ''}`}`);
}

View File

@@ -59,6 +59,7 @@ module.exports = {
subject: t('title'),
text: `${t('greeting')},\n\n${t('intro')}:\n\n${voucher.code.slice(0, 5)}-${voucher.code.slice(5)}`,
html: ejs.render(fs.readFileSync(`${__dirname}/../template/email/voucher.ejs`, 'utf-8'), {
language,
t,
voucher,
unifiSsid: variables.unifiSsid,

View File

@@ -180,7 +180,7 @@ module.exports = {
});
doc.font('Roboto-Regular')
.fontSize(10)
.text(time(vouchers[item].duration));
.text(time(vouchers[item].duration, language));
if (vouchers[item].qos_usage_quota) {
doc.font('Roboto-Bold')
@@ -310,7 +310,7 @@ module.exports = {
printer.invert(true);
printer.print(`${t('duration')}:`);
printer.invert(false);
printer.print(` ${time(voucher.duration)}`);
printer.print(` ${time(voucher.duration, language)}`);
printer.newLine();
if(voucher.qos_usage_quota) {

View File

@@ -41,6 +41,7 @@ module.exports = {
smtpPassword: config('smtp_password') || process.env.SMTP_PASSWORD || '',
kioskEnabled: config('kiosk_enabled') || (process.env.KIOSK_ENABLED === 'true') || false,
kioskVoucherType: config('kiosk_voucher_type') || process.env.KIOSK_VOUCHER_TYPE || '480,1,,,',
kioskNameRequired: config('kiosk_name_required') || (process.env.KIOSK_NAME_REQUIRED === 'true') || false,
logLevel: config('log_level') || process.env.LOG_LEVEL || 'info',
translationDefault: config('translation_default') || process.env.TRANSLATION_DEFAULT || 'en',
translationDebug: config('translation_debug') || (process.env.TRANSLATION_DEBUG === 'true') || false,