Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
Merge pull request #20 from AlexLombry/1.0
Browse files Browse the repository at this point in the history
Send null instead of fallback locale in case of user doesn't have fallback set.
  • Loading branch information
vinkla committed Mar 2, 2015
2 parents 9796b39 + 1e4049d commit 0f6f0b0
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Vinkla/Translator/TranslatorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,9 @@ private function getTranslationByLocaleId($localeId)
*/
private function getLocaleId($locale = null)
{
$existLocale = $this->getLocale($locale ?: App::getLocale());

if (is_null($existLocale)) {
return $this->getFallbackLocaleId();
}

return $this->getLocale($locale ?: App::getLocale())->id;
$exist = $this->getLocale($locale ?: App::getLocale());

return $exist ? $exist->id : null;
}

/**
Expand Down

0 comments on commit 0f6f0b0

Please sign in to comment.