diff --git a/ajax.php b/ajax.php index 3374776c7a54ef4cbaa1c0bf7a8139d2179be2dc..60fca4337ec3df74e71df4037b49bdbfc917ac89 100644 --- a/ajax.php +++ b/ajax.php @@ -37,6 +37,9 @@ $dispatcher = patterns('', )), url('^/form/', patterns('ajax.forms.php:DynamicFormsAjaxAPI', url_get('^help-topic/(?P<id>\d+)$', 'getClientFormsForHelpTopic') + )), + url('^/i18n/(?P<lang>[\w_]+)/', patterns('ajax.i18n.php:i18nAjaxAPI', + url_get('(?P<tag>\w+)$', 'getLanguageFile') )) ); Signal::send('ajax.client', $dispatcher); diff --git a/include/ajax.config.php b/include/ajax.config.php index e0df37d9787a07c46c0e67a25dadd6e5655f18a2..98053cf330e953936e6f1ce142e7e047203e6aee 100644 --- a/include/ajax.config.php +++ b/include/ajax.config.php @@ -47,6 +47,7 @@ class ConfigAjaxAPI extends AjaxController { $config = $this->json_encode($config); Http::cacheable(md5($config), $cfg->lastModified()); + header('Content-Type: application/json; charset=UTF-8'); return $config; } diff --git a/include/client/footer.inc.php b/include/client/footer.inc.php index 45588e7c22aa61fa6f2257c80f25b7bfc55acf86..44acf45cf6b134f4ac5ca1abc794656cdfd290c0 100644 --- a/include/client/footer.inc.php +++ b/include/client/footer.inc.php @@ -9,5 +9,14 @@ <h4><?php echo __('Please Wait!');?></h4> <p><?php echo __('Please wait... it will take a second!');?></p> </div> +<?php +if ($thisclient && $thisclient instanceof EndUser) + $lang = $thisclient->getLanguage(); +elseif ($cfg && $cfg->getSystemLanguage()) + $lang = $cfg->getSystemLanguage(); +if ($lang && $lang != 'en_US') { ?> + <script type="text/javascript" src="ajax.php/i18n/<?php + echo $thisclient->getLanguage(); ?>/redactor"></script> +<?php } ?> </body> </html>