Extends
lithium\net\http\Request
Sets or returns the current locale string. For more information, see
"[Globalization](http://lithify.me/docs/manual/07_globalization)" in the manual.
Parameters
- string $locale An optional locale string like `'en'`, `'en_US'` or `'de_DE'`. If specified, will overwrite the existing locale.
Returns
Returns the currently set locale string.Source
public function locale($locale = null) {
if ($locale) {
$this->_locale = $locale;
}
if ($this->_locale) {
return $this->_locale;
}
if (isset($this->params['locale'])) {
return $this->params['locale'];
}
}