diff --git a/src/Resources/public/admin/collections.js b/src/Resources/public/admin/collections.js index 9f79406..1daa35e 100644 --- a/src/Resources/public/admin/collections.js +++ b/src/Resources/public/admin/collections.js @@ -1,8 +1,12 @@ $(function () { + var config = JSON.parse($('#calendar_config').text()); + var locale = config.locale.includes('_') ? config.locale.split('_')[0] : config.locale; + var calendar = new FullCalendar.Calendar($('#calendar')[0], { plugins: [ 'timeGrid' ], defaultView: 'timeGrid', nowIndicator: true, + locale: locale, }); var calendarRendered = false; diff --git a/src/Resources/public/click_n_collect.js b/src/Resources/public/click_n_collect.js index c1aa5c9..6f3bdbd 100644 --- a/src/Resources/public/click_n_collect.js +++ b/src/Resources/public/click_n_collect.js @@ -2,6 +2,7 @@ $(function () { var config = JSON.parse($('#calendar_config').text()); + var locale = config.locale.includes('_') ? config.locale.split('_')[0] : config.locale; $('input.click_n_collect_location').each(function () { var n = $(this).attr('id').match(/sylius_checkout_select_shipping_shipments_([0-9]+)_location/)[1]; @@ -30,7 +31,8 @@ $(function () { eventClick: function (info) { $collectionTime.val(info.event.start.toISOString()); selectEvent(info.el); - } + }, + locale: locale, }); var calendarRendered = false; diff --git a/src/Resources/translations/messages.bg.yml b/src/Resources/translations/messages.bg.yml new file mode 100644 index 0000000..09a624a --- /dev/null +++ b/src/Resources/translations/messages.bg.yml @@ -0,0 +1,49 @@ +coop_tilleuls_click_n_collect: + menu: + admin: + main: + sales: + collections: Click 'N' Collect + configuration: + locations: Локации за Click 'N' Collect + ui: + new_location: Нова локация за Click 'N' Collect + edit_location: Промени локация за Click 'N' Collect + locations: Локации за Click 'N' Collect + collect_details: Детайли за получаване + pin: 'ПИН-код:' + collections: Click 'N' Collect + change_collection_time: Промяна време за получаване + form: + location: + name: име + rrule: Правило за повторение на работното време (формат iCalendar) + rrule_interval: интервал на получаване + rrule_hoursly: Часове + rrule_minutely: Минути + rrule_days: Дни от седмицата + rrule_weekdays: + monday: Пон. + tuesday: Вто. + wednesday: Сря. + thursday: Четв. + friday: Пет. + saturday: Съб. + sunday: Нед. + rrule_schedule: Работно време + rrule_dtstart: Начална дата + rrule_expert: Начин за напреднали + rrule_toggle: Смени + order_preparation_delay: Време за приготвяне на поръчката (в минути) + throughput: Поток (колко човека едновременно могат да бъдат обслужени) + generate_pin: Активирай ПИН-код операции? + street: Улица + city: Град + postcode: Пощ. код + country: Държава + province_code: Код на област + province_name: име на област + enabled: Включено + shipping_method: + click_n_collect: Click 'N' Collect + locations: Локации за Click 'N' Collect diff --git a/src/Resources/views/Admin/collections.html.twig b/src/Resources/views/Admin/collections.html.twig index 06daf56..267b264 100644 --- a/src/Resources/views/Admin/collections.html.twig +++ b/src/Resources/views/Admin/collections.html.twig @@ -10,6 +10,10 @@ {% for location in locations %}{% endfor %}
+ {# json_encode(65) is for JSON_UNESCAPED_SLASHES|JSON_HEX_TAG to avoid JS XSS #} + {% endblock %} diff --git a/src/Resources/views/fullcalendar/_scripts.html.twig b/src/Resources/views/fullcalendar/_scripts.html.twig index 07db8f5..2f01e9d 100644 --- a/src/Resources/views/fullcalendar/_scripts.html.twig +++ b/src/Resources/views/fullcalendar/_scripts.html.twig @@ -1,4 +1,5 @@ {# TODO: use a local installation and Webpack Encore, need https://github.com/Sylius/Sylius/issues/10656 #} +{% include '@SyliusUi/_javascripts.html.twig' with {'path': 'https://unpkg.com/@fullcalendar/core@^4/locales-all.js'} %} {% include '@SyliusUi/_javascripts.html.twig' with {'path': 'https://unpkg.com/@fullcalendar/core@^4/main.js'} %} {% include '@SyliusUi/_javascripts.html.twig' with {'path': 'https://unpkg.com/@fullcalendar/daygrid@^4/main.js'} %} {% include '@SyliusUi/_javascripts.html.twig' with {'path': 'https://unpkg.com/@fullcalendar/timegrid@^4/main.js'} %}