Skip to content

Commit

Permalink
Setting the locale key to empty array by default
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Oct 13, 2017
1 parent 409f56a commit b5da7ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Modules/Media/Transformers/MediaTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function toArray($request)
}

foreach (LaravelLocalization::getSupportedLocales() as $locale => $supportedLocale) {
$data[$locale] = [];
foreach ($this->translatedAttributes as $translatedAttribute) {
$data[$locale][$translatedAttribute] = $this->translateOrNew($locale)->$translatedAttribute;
}
Expand Down
1 change: 1 addition & 0 deletions Modules/Page/Transformers/FullPageTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function toArray($request)
];

foreach (LaravelLocalization::getSupportedLocales() as $locale => $supportedLocale) {
$pageData[$locale] = [];
foreach ($this->translatedAttributes as $translatedAttribute) {
$pageData[$locale][$translatedAttribute] = $this->translateOrNew($locale)->$translatedAttribute;
}
Expand Down

0 comments on commit b5da7ef

Please sign in to comment.