Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
kg-bot committed Mar 6, 2020
2 parents d04f0dc + bce3382 commit a97bfe5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
7 changes: 4 additions & 3 deletions src/Classes/ExportLocalizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,14 @@ protected function parseJsonFiles($file, $key, $dir)
}
}

public static function exportToArray(){
return (new ExportLocalizations)->export()->toArray();
public static function exportToArray()
{
return (new self)->export()->toArray();
}

protected static function executeCallback($strings)
{
if($callback = config('laravel-localization.export_callback')) {
if ($callback = config('laravel-localization.export_callback')) {
$strings = $callback($strings);
}

Expand Down
25 changes: 12 additions & 13 deletions src/config/laravel-localization.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
'routes' => [

/**
* Route prefix, example of route http://localhost/js/localizations.js
*
* Route prefix, example of route http://localhost/js/localizations.js.
*/
'prefix' => env('LARAVEL_LOCALIZATION_PREFIX', '/js/localization.js'),

/**
* Route name, defaults to assets.lang
* Route name, defaults to assets.lang.
*/
'name' => env('LARAVEL_LOCALIZATION_ROUTE_NAME', 'assets.lang'),

Expand All @@ -33,14 +32,14 @@
: [],

/**
* Should we enable public URL from which we can access translations
* Should we enable public URL from which we can access translations.
*/
'enable' => env('LARAVEL_LOCALIZATION_ROUTE_ENABLE', false),
],
'events' => [

/**
* This package emits some events after it getters all translation messages
* This package emits some events after it getters all translation messages.
*
* Here you can change channel on which events will broadcast
*/
Expand All @@ -49,40 +48,40 @@
'caches' => [

/**
* What cache driver do you want to use - more information: https://laravel.com/docs/5.6/cache#driver-prerequisites
* What cache driver do you want to use - more information: https://laravel.com/docs/5.6/cache#driver-prerequisites.
*/
'driver' => 'file',

/**
* Key name of the cache entry for the localization array
* Key name of the cache entry for the localization array.
*/
'key' => 'localization.array',

/**
* Timeout of the cached data in minutes - set to 0 to disable
* Timeout of the cached data in minutes - set to 0 to disable.
*/
'timeout' => 60,
],
'js' => [
/**
* Default locale for export
* Default locale for export.
*/
'default_locale' => 'en',

/**
* root location to where JavaScript file will be exported
* root location to where JavaScript file will be exported.
*/
'filepath' => resource_path('assets/js'),

/**
* File name for JavaScript file with exported messages
* File name for JavaScript file with exported messages.
*/
'filename' => 'll_messages.js',
],
'paths' => [

/**
* You can export more lang files then just files in resources/lang, for example
* You can export more lang files then just files in resources/lang, for example.
*
* In you .env file just add:
* LARAVEL_LOCALIZATION_LANG_DIRS=resources/lang,Modules/Blog/Resources/lang
Expand All @@ -98,7 +97,7 @@
],
/**
* This function will be called every time after export, it should be globally accessible function (eg. Laravel helper function)
* and it should accept (string) argument
* and it should accept (string) argument.
*/
'export_callback' => null,

Expand Down
2 changes: 0 additions & 2 deletions src/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* Date: 6/4/18
* Time: 12:18 AM.
*/
use KgBot\LaravelLocalization\Facades\ExportLocalizations;

if (config('laravel-localization.routes.enable')) {
/*
* Localization
Expand Down

0 comments on commit a97bfe5

Please sign in to comment.