Skip to content

Commit

Permalink
Added regional locales for a specific project
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedary committed Aug 25, 2021
1 parent 464aa75 commit 4fb9766
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Http/Controllers/LanguageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ private function editConfigurationFile(string $path, string $key, array $value,

switch($callback) {
case "localization":
$configuration[$key] = $value;
foreach(\App\Models\Region::whereIsRoot()->get() as $region) {
if($region->segment)
$configuration[$key . '_' . $region->segment] = $value;
foreach($value as $locale => $val) {
if(strlen($locale) == 2)
$value[$locale . '_' . $region->segment] = $val;
}
}
$configuration[$key] = $value;
break;
case "editor":
$configuration[$key] = array_keys($value);
Expand Down

0 comments on commit 4fb9766

Please sign in to comment.