Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

#86 New configuration parameter 'outputExtension' #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function generateMultiple($path, $format = 'es6', $multiLocales = false)
}
}
foreach ($this->filesToCreate as $fileName => $data) {
$fileToCreate = $jsPath . $fileName . '.js';
$fileToCreate = $jsPath . $fileName . '.' . $this->config['outputExtension'];
$createdFiles .= $fileToCreate . PHP_EOL;
$jsonLocales = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . PHP_EOL;
if (json_last_error() !== JSON_ERROR_NONE) {
Expand Down
24 changes: 22 additions & 2 deletions src/config/vue-i18n-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,36 @@

/*
|--------------------------------------------------------------------------
| Output file
| Single output file
|--------------------------------------------------------------------------
|
| The javascript path where I will place the generated file.
| Note: the path will be prepended to point to the App directory.
|
*/
'jsPath' => '/resources/js/langs/',
'jsFile' => '/resources/js/vue-i18n-locales.generated.js',

/*
|--------------------------------------------------------------------------
| Multiple files output path
|--------------------------------------------------------------------------
|
| The javascript path where I will place the generated files.
| Note: the path will be prepended to point to the App directory.
|
*/
'jsPath' => '/resources/js/langs/',

/*
|--------------------------------------------------------------------------
| Multiple files output extension
|--------------------------------------------------------------------------
|
| Output file extension for generate multiple files.
|
*/
'outputExtension' => 'js',

/*
|--------------------------------------------------------------------------
| i18n library
Expand Down