Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzwindmann committed Dec 15, 2022
1 parent 9632b86 commit 8808fa7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
30 changes: 18 additions & 12 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1952,6 +1952,9 @@ function shorten($text, $count = '55') {
}


// define( 'WP_DEBUG', true );
// define( 'WP_DEBUG_LOG', true );

/**
* Debug Function
*
Expand Down Expand Up @@ -3268,21 +3271,24 @@ function qp_translate_theme() {
* @return string browser language
*/
function qp_detect_browser_language() {
$browser_language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 5);
if(stripos($browser_language, "de") !== false ){
return "de_DE";
}elseif(stripos($browser_language, "it") !== false ){
return "it_IT";
}elseif(stripos($browser_language, "tr") !== false ){
return "tr_TR";
}elseif(stripos($browser_language, "en") !== false ){
return "en_GB";
}
else{
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$browser_language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 5);
if(stripos($browser_language, "de") !== false ){
return "de_DE";
}elseif(stripos($browser_language, "it") !== false ){
return "it_IT";
}elseif(stripos($browser_language, "tr") !== false ){
return "tr_TR";
}elseif(stripos($browser_language, "en") !== false ){
return "en_GB";
}
else{
return "de_DE";
}
} else {
return "de_DE";
}
}

/**
* QP language function
*
Expand Down
1 change: 0 additions & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@
<meta property="og:locale:alternate" content="it_IT" />
<meta property="og:site_name" content="<?php echo 'Quartiersplattform '.get_field('quartiersplattform-name','option'); ?>"/>
<meta name="twitter:card" content="summary"/>
<!-- <meta name="twitter:site" content="<?php echo esc_attr( $twitter_site ); ?>"/> -->

<!-- Matomo Tracking API Key -->
<?php the_field('matomo_api', 'option'); ?>
Expand Down

0 comments on commit 8808fa7

Please sign in to comment.