fix: Fix items and customization locale merging
This commit is contained in:
parent
fe5daaded8
commit
e5ea4a83e5
@ -7,7 +7,6 @@ use Illuminate\Support\Collection;
|
|||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use App\Config\GiteaConfig;
|
use App\Config\GiteaConfig;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
class ItemsCollection
|
class ItemsCollection
|
||||||
{
|
{
|
||||||
@ -45,8 +44,11 @@ class ItemsCollection
|
|||||||
|
|
||||||
$trimmed_current_locale_name = trim($current_locale_name[1][0]);
|
$trimmed_current_locale_name = trim($current_locale_name[1][0]);
|
||||||
$current_locale_json = json_decode(file_get_contents("${raw_locales_global_base_url}/${trimmed_current_locale_name}.json"), true);
|
$current_locale_json = json_decode(file_get_contents("${raw_locales_global_base_url}/${trimmed_current_locale_name}.json"), true);
|
||||||
$this->locales = $this->locales->merge([$trimmed_current_locale_name => [collect($current_locale_json['templates'])->merge(collect($current_locale_json['customization']))]]);
|
$template_locale = collect($current_locale_json['templates']);
|
||||||
|
$customization_locale= collect($current_locale_json['customization']);
|
||||||
|
$this->locales = $this->locales->merge([$trimmed_current_locale_name => $template_locale->concat($customization_locale)]);
|
||||||
}
|
}
|
||||||
|
file_put_contents("G:\spt-items-api\storage\data.json", $this->locales['en']);
|
||||||
Cache::put($this->locales_cache_key, $this->locales);
|
Cache::put($this->locales_cache_key, $this->locales);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
storage/data.json
Normal file
1
storage/data.json
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user