diff --git a/EventListener/CrowdinRequestLocaleSubcriber.php b/EventListener/CrowdinRequestLocaleSubcriber.php new file mode 100644 index 000000000..1d7a3654a --- /dev/null +++ b/EventListener/CrowdinRequestLocaleSubcriber.php @@ -0,0 +1,31 @@ + [ + ['setInContextAcceptLanguage', 100], + ], + ]; + } + + public function setInContextAcceptLanguage(GetResponseEvent $e) + { + if (!$e->getRequest()->cookies->has('ez_in_context_translation')) { + return; + } + + $e->getRequest()->headers->set('accept-language', 'ach-UG'); + } +} diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 53cbcd581..d45cb4989 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -291,3 +291,8 @@ services: calls: - [setRequestStack, ['@request_stack']] - [setPjaxRequestMatcher, ['@ezsystems.platformui.pjax.request_matcher']] + + ezsystems.platformui.event_subscriber.crowdin_request_locale: + class: EzSystems\PlatformUIBundle\EventListener\CrowdinRequestLocaleSubcriber + tags: + - {name: kernel.event_subscriber} diff --git a/Resources/views/PlatformUI/shell.html.twig b/Resources/views/PlatformUI/shell.html.twig index a277d2be4..f47413f75 100644 --- a/Resources/views/PlatformUI/shell.html.twig +++ b/Resources/views/PlatformUI/shell.html.twig @@ -5,6 +5,14 @@ eZ Platform UI + + {% if parameters.interfaceLanguages[0] == 'ach_UG' %} + + + {% endif %} {% stylesheets '$css.files;ez_platformui$' filter='cssrewrite' %} {% endstylesheets %}