Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Oct 24, 2018
1 parent afc5a81 commit 3f85cee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Translatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ protected function createTranslatedField(Field $originalField, string $locale):

$translatedField->attribute = 'translations';

$translatedField->name = ($this->displayLocaleUsingCallback)($translatedField, $locale);
$translatedField->name = (count($this->locales) > 1)
? ($this->displayLocaleUsingCallback)($translatedField, $locale)
: $translatedField->name;

$translatedField->fillUsing(function ($request, $model, $attribute, $requestAttribute) {
$requestAttributeParts = explode('_', $requestAttribute);
Expand Down

0 comments on commit 3f85cee

Please sign in to comment.