Skip to content

Commit d8d1d09

Browse files
author
Muammer Topçu
authored
Merge pull request #50 from openclassify/translate-hot-fix
lang check fix
2 parents 0294a30 + 6b9d872 commit d8d1d09

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/Model/Traits/Translatable.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,9 @@ public function translateOrNew($locale)
140140
*/
141141
public function checkTranslation($translation)
142142
{
143-
if (!empty($translation->getAttribute('name')) || !empty($translation->getAttribute('title'))) {
143+
if ($translation || (!empty($translation->name) || !empty($translation->title))) {
144144
return true;
145145
}
146-
147-
return false;
148146
}
149147

150148
/**
@@ -179,8 +177,8 @@ public function translations()
179177
/**
180178
* Get a translation.
181179
*
182-
* @param null $locale
183-
* @param bool|null $withFallback
180+
* @param null $locale
181+
* @param bool|null $withFallback
184182
* @return EloquentModel|null
185183
*/
186184
public function getTranslation($locale = null, $withFallback = true)
@@ -452,9 +450,9 @@ public function getLocaleKey()
452450
/**
453451
* Return if the entry is trashed or not.
454452
*
453+
* @return bool
455454
* @todo is this really used/needed?
456455
*
457-
* @return bool
458456
*/
459457
public function trashed()
460458
{

0 commit comments

Comments
 (0)