mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-11-09 07:53:29 -05:00
- Replace untranslated English strings with empty fallback ('') across all non-English catalogs and sort keys alphabetically (closes #4783, closes #4660)
- Restore missing Sales.no_sales_to_display in English while preserving existing translations (closes #4794, references #4637, #4795)
- Register Georgian (ka) and Swahili (sw-KE, sw-TZ) locales, normalize Croatian to hr per BCP 47, and fix datepicker long month keys (partially addresses #4476, references #3891)
- Hardcode invariant brand constants (OSPOS, website, copyrights) in login/footer views, remove from catalogs, and standardize Latin OSPOS branding
- Fix English catalog typos and maintain consistent British English variants in en-GB
- Add LanguageFilesTest with 4,418 automated tests for syntax, key parity, sorting, and bidirectional locale registrations
- Update AGENTS.md with localization guidelines and development best practices
96 lines
3.1 KiB
PHP
96 lines
3.1 KiB
PHP
<?php
|
|
use Config\OSPOS;
|
|
|
|
$config = config(OSPOS::class)->settings; ?>
|
|
|
|
const pickerconfig = function(config) {
|
|
return $.extend({
|
|
format: "<?= $this->data["format"] ?? dateformat_bootstrap($config['dateformat']) . ' ' . dateformat_bootstrap($config['timeformat'])?>",
|
|
<?php
|
|
$t = $config['timeformat'];
|
|
$m = $t[strlen($t) - 1];
|
|
if (str_contains($config['timeformat'], 'a') || str_contains($config['timeformat'], 'A')) {
|
|
?>
|
|
showMeridian: true,
|
|
<?php } else { ?>
|
|
showMeridian: false,
|
|
<?php } ?>
|
|
minView: 2,
|
|
minuteStep: 1,
|
|
autoclose: true,
|
|
todayBtn: true,
|
|
todayHighlight: true,
|
|
bootcssVer: 3,
|
|
language: "<?= current_language_code() ?>"
|
|
}, <?php echo isset($config) ?>);
|
|
};
|
|
|
|
$.fn.datetimepicker.dates['<?= $config['language'] ?>'] = {
|
|
days: [
|
|
"<?= lang('Calendar.sunday') ?>",
|
|
"<?= lang('Calendar.monday') ?>",
|
|
"<?= lang('Calendar.tuesday') ?>",
|
|
"<?= lang('Calendar.wednesday') ?>",
|
|
"<?= lang('Calendar.thursday') ?>",
|
|
"<?= lang('Calendar.friday') ?>",
|
|
"<?= lang('Calendar.saturday') ?>"
|
|
],
|
|
daysShort: [
|
|
"<?= lang('Calendar.sun') ?>",
|
|
"<?= lang('Calendar.mon') ?>",
|
|
"<?= lang('Calendar.tue') ?>",
|
|
"<?= lang('Calendar.wed') ?>",
|
|
"<?= lang('Calendar.thu') ?>",
|
|
"<?= lang('Calendar.fri') ?>",
|
|
"<?= lang('Calendar.sat') ?>"
|
|
],
|
|
daysMin: [
|
|
"<?= lang('Calendar.su') ?>",
|
|
"<?= lang('Calendar.mo') ?>",
|
|
"<?= lang('Calendar.tu') ?>",
|
|
"<?= lang('Calendar.we') ?>",
|
|
"<?= lang('Calendar.th') ?>",
|
|
"<?= lang('Calendar.fr') ?>",
|
|
"<?= lang('Calendar.sa') ?>"
|
|
],
|
|
months: [
|
|
"<?= lang('Calendar.january') ?>",
|
|
"<?= lang('Calendar.february') ?>",
|
|
"<?= lang('Calendar.march') ?>",
|
|
"<?= lang('Calendar.april') ?>",
|
|
"<?= lang('Calendar.mayl') ?>",
|
|
"<?= lang('Calendar.june') ?>",
|
|
"<?= lang('Calendar.july') ?>",
|
|
"<?= lang('Calendar.august') ?>",
|
|
"<?= lang('Calendar.september') ?>",
|
|
"<?= lang('Calendar.october') ?>",
|
|
"<?= lang('Calendar.november') ?>",
|
|
"<?= lang('Calendar.december') ?>"
|
|
],
|
|
monthsShort: [
|
|
"<?= lang('Calendar.jan') ?>",
|
|
"<?= lang('Calendar.feb') ?>",
|
|
"<?= lang('Calendar.mar') ?>",
|
|
"<?= lang('Calendar.apr') ?>",
|
|
"<?= lang('Calendar.may') ?>",
|
|
"<?= lang('Calendar.jun') ?>",
|
|
"<?= lang('Calendar.jul') ?>",
|
|
"<?= lang('Calendar.aug') ?>",
|
|
"<?= lang('Calendar.sep') ?>",
|
|
"<?= lang('Calendar.oct') ?>",
|
|
"<?= lang('Calendar.nov') ?>",
|
|
"<?= lang('Calendar.dec') ?>"
|
|
],
|
|
today: "<?= lang('Datepicker.today') ?>",
|
|
<?php if (str_contains($config['timeformat'], 'a')) { ?>
|
|
meridiem: ["am", "pm"],
|
|
<?php } elseif (str_contains($config['timeformat'], 'A')) { ?>
|
|
meridiem: ["AM", "PM"],
|
|
<?php } else { ?>
|
|
meridiem: [],
|
|
<?php } ?>
|
|
weekStart: <?= lang('Datepicker.weekstart') ?>
|
|
};
|
|
|
|
$(".datetime").datetimepicker(pickerconfig());
|