mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-29 11:15:58 +00:00
Language editor refactoring part 4 (backend + frontend)
This commit is contained in:
@@ -17,15 +17,15 @@ class LanguageCollection extends ResourceCollection
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$current_language = Language::with('languageStrings')
|
||||
$current_language = Language::with('languageTranslations')
|
||||
->whereLocale(get_setting('language') ?? 'en')
|
||||
->first();
|
||||
|
||||
return [
|
||||
'data' => $this->collection,
|
||||
'meta' => [
|
||||
'current_language' => new LanguageResource($current_language),
|
||||
'default_translations' => get_default_language_strings()
|
||||
'current_language' => new LanguageResource($current_language),
|
||||
'reference_translations' => get_default_language_translations()
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class LanguageResource extends JsonResource
|
||||
'attributes' => [
|
||||
'name' => $this->name,
|
||||
'locale' => $this->locale,
|
||||
'translations' => map_language_translations($this->languageStrings),
|
||||
'translations' => map_language_translations($this->languageTranslations),
|
||||
'updated_at' => $this->updated_at,
|
||||
'created_at' => $this->created_at,
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user