Permalink
Browse files

Added language options for dialog

  • Loading branch information...
Matousek committed Oct 29, 2015
1 parent 1c43b74 commit e4ebf73416dfa05dcaf312ebef8d8aeda7702bb8
Showing with 23 additions and 1 deletion.
  1. +5 −0 src/Kdyby/Google/Configuration.php
  2. +18 −1 src/Kdyby/Google/Dialog/LoginDialog.php
@@ -41,6 +41,11 @@ class Configuration extends Object
* @var array
*/
public $scopes;
/**
* @var string
*/
public $language;
/**
* @var array
@@ -20,6 +20,8 @@
*/
class LoginDialog extends AbstractDialog
{
/** @var string */
private $language;
/**
* Checks, if there is a user in storage and if not, it redirects to login dialog.
@@ -49,7 +51,22 @@ public function getUrl()
$this->session->establishCSRFTokenState();
$auth->setState($this->session->state);
return new UrlScript($this->google->client->createAuthUrl());
$url = new UrlScript($this->google->client->createAuthUrl());
if($this->language){
$url->appendQuery(['hl' => $this->language]);
}
return $url;
}
/**
* @param string $language (cs, en, etc...)
*/
public function setLanguage($language)
{
$this->language = $language;
}
}

0 comments on commit e4ebf73

Please sign in to comment.