Skip to content

Commit

Permalink
add line break and tab before line
Browse files Browse the repository at this point in the history
  • Loading branch information
sudippalash committed Jul 23, 2022
1 parent bf6f4ef commit df1a557
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Via Composer

```bash
$ composer require sudippalash/lang-maker
composer require sudippalash/lang-maker
```

#### Publish config file
Expand Down Expand Up @@ -59,8 +59,8 @@ In `config/lang-maker.php` config file you should set `lang-maker` global path.
| If language route use any middleware then provide it or leave empty array. Example: ['auth ']
*/

'route_name' => 'admin.language',
'route_prefix' => 'admin/language',
'route_name' => 'user.language',
'route_prefix' => 'user/language',
'middleware' => [],

/*
Expand All @@ -71,7 +71,7 @@ In `config/lang-maker.php` config file you should set `lang-maker` global path.
| specify the file names (without extension) in array which you want to ignore to modify or leave it blank array
*/

'ignore_lang_file' => ['validation'],
'ignore_lang_file' => [], //['validation', 'pagination']

/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/LanguageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function update(Request $request, $currantLang)

if (!empty($request->message)) {
foreach($request->message as $fileName => $fileData) {
$content = "<?php return [";
$content = "<?php\n\nreturn [\n";
$content .= $this->buildArray($fileData);
$content .= "];";
file_put_contents($langFolder . "/" . $fileName . '.php', $content);
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/LangUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public function buildArray($fileData)
$content = "";
foreach ($fileData as $lable => $data) {
if(is_array($data)) {
$content .= "'$lable'=>[" . $this->buildArray($data) . "],";
$content .= "\t'$lable' => [" . $this->buildArray($data) . "],\n";
} else {
$content .= "'$lable'=>'" . addslashes($data) . "',";
$content .= "\t'$lable' => '" . addslashes($data) . "',\n";
}
}

Expand Down

0 comments on commit df1a557

Please sign in to comment.