You are here

public function GoogleCSEServices::paramlr in Google Custom Search Engine 8.2

Same name and namespace in other branches
  1. 8.3 src/GoogleCSEServices.php \Drupal\google_cse\GoogleCSEServices::paramlr()

Returns "lr" language param for search request.

Return value

string The language code.

1 call to GoogleCSEServices::paramlr()
GoogleCSEServices::service in src/GoogleCSEServices.php
Sends query to Google's Custom Search Engine and returns response.

File

src/GoogleCSEServices.php, line 174

Class

GoogleCSEServices
Additional functions as services for Google CSE.

Namespace

Drupal\google_cse

Code

public function paramlr() {
  switch ($this->CSEconfig
    ->get('configuration')['google_cse_adv_language']) {
    case 'active':
      $language = $this->languageManager
        ->getCurrentLanguage();
      return 'lang_' . $language
        ->getId();
    default:
      return '';
  }
}