started to activate translations ajax nav
This commit is contained in:
@@ -20,6 +20,7 @@ function edlp_ajax_page_attachments(array &$attachments) {
|
||||
$redirect = false;
|
||||
|
||||
$current_path = \Drupal::service('path.current')->getPath();
|
||||
$current_language = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
$is_front = \Drupal::service('path.matcher')->isFrontPage();
|
||||
|
||||
// do not redirect if not node, term, or custom routing
|
||||
@@ -33,10 +34,12 @@ function edlp_ajax_page_attachments(array &$attachments) {
|
||||
$redirect = true;
|
||||
}
|
||||
|
||||
// $redirect = false;
|
||||
$js_str = "var edlp = {\n
|
||||
sys_path:'".$current_path."',\n
|
||||
is_front:".($is_front ? 'true':'false').",\n
|
||||
redirect:".($redirect ? 'true':'false').",\n
|
||||
lang_code:'".$current_language."',\n
|
||||
};";
|
||||
|
||||
$attachments['#attached']['html_head'][] = [
|
||||
|
||||
Reference in New Issue
Block a user