1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2025-02-01 04:21:39 +01:00

Add vendor files to dist

This commit is contained in:
FreeScout 2018-09-25 07:08:30 -07:00
parent 444f4382d0
commit 00c2456286
26 changed files with 1834 additions and 4 deletions

View File

@ -0,0 +1,5 @@
/vendor
composer.phar
composer.lock
.DS_Store
.idea

View File

@ -0,0 +1,19 @@
Copyright (C) 2014 Barry vd. Heuvel
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,38 @@
{
"name": "barryvdh/laravel-translation-manager",
"description": "Manage Laravel Translations",
"keywords": [
"laravel",
"translations",
"translator"
],
"license": "MIT",
"authors": [
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"require": {
"php": ">=7",
"illuminate/support": "5.5.x|5.6.x|5.7.x",
"illuminate/translation": "5.5.x|5.6.x|5.7.x",
"symfony/finder": "~3.0|~4.0"
},
"autoload": {
"psr-4": {
"Barryvdh\\TranslationManager\\": "src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "0.4-dev"
},
"laravel": {
"providers": [
"Barryvdh\\TranslationManager\\ManagerServiceProvider"
]
}
},
"minimum-stability": "stable"
}

View File

@ -0,0 +1,69 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Routes group config
|--------------------------------------------------------------------------
|
| The default group settings for the elFinder routes.
|
*/
'route' => [
'prefix' => 'translations',
'middleware' => 'auth',
],
/**
* Enable deletion of translations
*
* @type boolean
*/
'delete_enabled' => true,
/**
* Exclude specific groups from Laravel Translation Manager.
* This is useful if, for example, you want to avoid editing the official Laravel language files.
*
* @type array
*
* array(
* 'pagination',
* 'reminders',
* 'validation',
* )
*/
'exclude_groups' => [],
/**
* Exclude specific languages from Laravel Translation Manager.
*
* @type array
*
* array(
* 'fr',
* 'de',
* )
*/
'exclude_langs' => [],
/**
* Export translations with keys output alphabetically.
*/
'sort_keys ' => false,
'trans_functions' => [
'trans',
'trans_choice',
'Lang::get',
'Lang::choice',
'Lang::trans',
'Lang::transChoice',
'@lang',
'@choice',
'__',
'$trans.get',
],
];

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTranslationsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ltm_translations', function(Blueprint $table)
{
$table->increments('id');
$table->integer('status')->default(0);
$table->string('locale');
$table->string('group');
$table->text('key');
$table->text('value')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ltm_translations');
}
}

View File

@ -0,0 +1,151 @@
## Laravel 5 Translation Manager
### For Laravel 4, please use the [0.1 branch](https://github.com/barryvdh/laravel-translation-manager/tree/0.1)!
This is a package to manage Laravel translation files.
It does not replace the Translation system, only import/export the php files to a database and make them editable through a webinterface.
The workflow would be:
- Import translations: Read all translation files and save them in the database
- Find all translations in php/twig sources
- Optionally: Listen to missing translation with the custom Translator
- Translate all keys through the webinterface
- Export: Write all translations back to the translation files.
This way, translations can be saved in git history and no overhead is introduced in production.
![Screenshot](http://i.imgur.com/4th2krf.png)
## Installation
Require this package in your composer.json and run composer update (or run `composer require barryvdh/laravel-translation-manager` directly):
composer require barryvdh/laravel-translation-manager
After updating composer, add the ServiceProvider to the providers array in config/app.php
'Barryvdh\TranslationManager\ManagerServiceProvider',
You need to run the migrations for this package.
$ php artisan vendor:publish --provider="Barryvdh\TranslationManager\ManagerServiceProvider" --tag=migrations
$ php artisan migrate
You need to publish the config file for this package. This will add the file `config/translation-manager.php`, where you can configure this package.
$ php artisan vendor:publish --provider="Barryvdh\TranslationManager\ManagerServiceProvider" --tag=config
In order to edit the default template, the views must be published as well. The views will then be placed in `resources/views/vendor/translation-manager`.
$ php artisan vendor:publish --provider="Barryvdh\TranslationManager\ManagerServiceProvider" --tag=views
Routes are added in the ServiceProvider. You can set the group parameters for the routes in the configuration.
You can change the prefix or filter/middleware for the routes. If you want full customisation, you can extend the ServiceProvider and override the `map()` function.
This example will make the translation manager available at `http://yourdomain.com/translations`
### Laravel >= 5.2
The configuration file by default only includes the `auth` middleware, but the latests changes in Laravel 5.2 makes it that session variables are only accessible when your route includes the `web` middleware. In order to make this package work on Laravel 5.2, you will have to change the route/middleware setting from the default
```
'route' => [
'prefix' => 'translations',
'middleware' => 'auth',
],
```
to
```
'route' => [
'prefix' => 'translations',
'middleware' => [
'web',
'auth',
],
],
```
**NOTE:** *This is only needed in Laravel 5.2 (and up!)*
## Usage
### Web interface
When you have imported your translation (via buttons or command), you can view them in the webinterface (on the url you defined with the controller).
You can click on a translation and an edit field will popup. Just click save and it is saved :)
When a translation is not yet created in a different locale, you can also just edit it to create it.
Using the buttons on the webinterface, you can import/export the translations. For publishing translations, make sure your application can write to the language directory.
You can also use the commands below.
### Import command
The import command will search through app/lang and load all strings in the database, so you can easily manage them.
$ php artisan translations:import
Translation strings from app/lang/locale.json files will be imported to the __json_ group.
Note: By default, only new strings are added. Translations already in the DB are kept the same. If you want to replace all values with the ones from the files,
add the `--replace` (or `-R`) option: `php artisan translations:import --replace`
### Find translations in source
The Find command/button will look search for all php/twig files in the app directory, to see if they contain translation functions, and will try to extract the group/item names.
The found keys will be added to the database, so they can be easily translated.
This can be done through the webinterface, or via an Artisan command.
$ php artisan translations:find
If your project uses translation strings as keys, these will be stored into then __json_ group.
### Export command
The export command will write the contents of the database back to app/lang php files.
This will overwrite existing translations and remove all comments, so make sure to backup your data before using.
Supply the group name to define which groups you want to publish.
$ php artisan translations:export <group>
For example, `php artisan translations:export reminders` when you have 2 locales (en/nl), will write to `app/lang/en/reminders.php` and `app/lang/nl/reminders.php`
To export translation strings as keys to JSON files , use the `--json` (or `-J`) option: `php artisan translations:import --json`. This will import every entries from the __json_ group.
### Clean command
The clean command will search for all translation that are NULL and delete them, so your interface is a bit cleaner. Note: empty translations are never exported.
$ php artisan translations:clean
### Reset command
The reset command simply clears all translation in the database, so you can start fresh (by a new import). Make sure to export your work if needed before doing this.
$ php artisan translations:reset
### Detect missing translations
Most translations can be found by using the Find command (see above), but in case you have dynamic keys (variables/automatic forms etc), it can be helpful to 'listen' to the missing translations.
To detect missing translations, we can swap the Laravel TranslationServiceProvider with a custom provider.
In your config/app.php, comment out the original TranslationServiceProvider and add the one from this package:
//'Illuminate\Translation\TranslationServiceProvider',
'Barryvdh\TranslationManager\TranslationServiceProvider',
This will extend the Translator and will create a new database entry, whenever a key is not found, so you have to visit the pages that use them.
This way it shows up in the webinterface and can be edited and later exported.
You shouldn't use this in production, just in development to translate your views, then just switch back.
## TODO
This package is still very alpha. Few thinks that are on the todo-list:
- Add locales/groups via webinterface
- Improve webinterface (more selection/filtering, behavior of popup after save etc)
- Seed existing languages (https://github.com/caouecs/Laravel-lang)
- Suggestions are welcome :)

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,41 @@
<?php
namespace Barryvdh\TranslationManager\Console;
use Barryvdh\TranslationManager\Manager;
use Illuminate\Console\Command;
class CleanCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'translations:clean';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Clean empty translations';
/** @var \Barryvdh\TranslationManager\Manager */
protected $manager;
public function __construct(Manager $manager)
{
$this->manager = $manager;
parent::__construct();
}
/**
* Execute the console command.
*/
public function handle()
{
$this->manager->cleanTranslations();
$this->info('Done cleaning translations');
}
}

View File

@ -0,0 +1,87 @@
<?php
namespace Barryvdh\TranslationManager\Console;
use Barryvdh\TranslationManager\Manager;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
class ExportCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'translations:export';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Export translations to PHP files';
/** @var \Barryvdh\TranslationManager\Manager */
protected $manager;
public function __construct(Manager $manager)
{
$this->manager = $manager;
parent::__construct();
}
/**
* Execute the console command.
*/
public function handle()
{
$group = $this->argument('group');
$json = $this->option('json');
if (is_null($group) && !$json) {
$this->warn('You must either specify a group argument or export as --json');
return;
}
if (!is_null($group) && $json) {
$this->warn('You cannot use both group argument and --json option at the same time');
return;
}
$this->manager->exportTranslations($group, $json);
if (!is_null($group)) {
$this->info('Done writing language files for '.(($group == '*') ? 'ALL groups' : $group.' group'));
} elseif ($json) {
$this->info('Done writing JSON language files for translation strings');
}
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return [
['group', InputArgument::OPTIONAL, 'The group to export (`*` for all).'],
];
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return [
['json', 'J', InputOption::VALUE_NONE, 'Export anonymous strings to JSON'],
];
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace Barryvdh\TranslationManager\Console;
use Barryvdh\TranslationManager\Manager;
use Illuminate\Console\Command;
class FindCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'translations:find';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Find translations in php/twig files';
/** @var \Barryvdh\TranslationManager\Manager */
protected $manager;
public function __construct(Manager $manager)
{
$this->manager = $manager;
parent::__construct();
}
/**
* Execute the console command.
*/
public function handle()
{
$counter = $this->manager->findTranslations(null);
$this->info('Done importing, processed '.$counter.' items!');
}
}

View File

@ -0,0 +1,55 @@
<?php
namespace Barryvdh\TranslationManager\Console;
use Barryvdh\TranslationManager\Manager;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
class ImportCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'translations:import';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Import translations from the PHP sources';
/** @var \Barryvdh\TranslationManager\Manager */
protected $manager;
public function __construct(Manager $manager)
{
$this->manager = $manager;
parent::__construct();
}
/**
* Execute the console command.
*/
public function handle()
{
$replace = $this->option('replace');
$counter = $this->manager->importTranslations($replace);
$this->info('Done importing, processed '.$counter.' items!');
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return [
['replace', 'R', InputOption::VALUE_NONE, 'Replace existing keys'],
];
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace Barryvdh\TranslationManager\Console;
use Illuminate\Console\Command;
use Barryvdh\TranslationManager\Manager;
class ResetCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'translations:reset';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Delete all translations from the database';
/** @var \Barryvdh\TranslationManager\Manager */
protected $manager;
public function __construct(Manager $manager)
{
$this->manager = $manager;
parent::__construct();
}
/**
* Execute the console command.
*/
public function handle()
{
$this->manager->truncateTranslations();
$this->info('All translations are deleted');
}
}

View File

@ -0,0 +1,172 @@
<?php namespace Barryvdh\TranslationManager;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller as BaseController;
use Barryvdh\TranslationManager\Models\Translation;
use Illuminate\Support\Collection;
class Controller extends BaseController
{
/** @var \Barryvdh\TranslationManager\Manager */
protected $manager;
public function __construct(Manager $manager)
{
$this->manager = $manager;
}
public function getIndex($group = null)
{
$locales = $this->manager->getLocales();
$groups = Translation::groupBy('group');
$excludedGroups = $this->manager->getConfig('exclude_groups');
if($excludedGroups){
$groups->whereNotIn('group', $excludedGroups);
}
$groups = $groups->select('group')->orderBy('group')->get()->pluck('group', 'group');
if ($groups instanceof Collection) {
$groups = $groups->all();
}
$groups = [''=>'Choose a group'] + $groups;
$numChanged = Translation::where('group', $group)->where('status', Translation::STATUS_CHANGED)->count();
$allTranslations = Translation::where('group', $group)->orderBy('key', 'asc')->get();
$numTranslations = count($allTranslations);
$translations = [];
foreach($allTranslations as $translation){
$translations[$translation->key][$translation->locale] = $translation;
}
return view('translation-manager::index')
->with('translations', $translations)
->with('locales', $locales)
->with('groups', $groups)
->with('group', $group)
->with('numTranslations', $numTranslations)
->with('numChanged', $numChanged)
->with('editUrl', action('\Barryvdh\TranslationManager\Controller@postEdit', [$group]))
->with('deleteEnabled', $this->manager->getConfig('delete_enabled'));
}
public function getView($group = null)
{
return $this->getIndex($group);
}
protected function loadLocales()
{
//Set the default locale as the first one.
$locales = Translation::groupBy('locale')
->select('locale')
->get()
->pluck('locale');
if ($locales instanceof Collection) {
$locales = $locales->all();
}
$locales = array_merge([config('app.locale')], $locales);
return array_unique($locales);
}
public function postAdd($group = null)
{
$keys = explode("\n", request()->get('keys'));
foreach($keys as $key){
$key = trim($key);
if($group && $key){
$this->manager->missingKey('*', $group, $key);
}
}
return redirect()->back();
}
public function postEdit($group = null)
{
if(!in_array($group, $this->manager->getConfig('exclude_groups'))) {
$name = request()->get('name');
$value = request()->get('value');
list($locale, $key) = explode('|', $name, 2);
$translation = Translation::firstOrNew([
'locale' => $locale,
'group' => $group,
'key' => $key,
]);
$translation->value = (string) $value ?: null;
$translation->status = Translation::STATUS_CHANGED;
$translation->save();
return array('status' => 'ok');
}
}
public function postDelete($group = null, $key)
{
if(!in_array($group, $this->manager->getConfig('exclude_groups')) && $this->manager->getConfig('delete_enabled')) {
Translation::where('group', $group)->where('key', $key)->delete();
return ['status' => 'ok'];
}
}
public function postImport(Request $request)
{
$replace = $request->get('replace', false);
$counter = $this->manager->importTranslations($replace);
return ['status' => 'ok', 'counter' => $counter];
}
public function postFind()
{
$numFound = $this->manager->findTranslations();
return ['status' => 'ok', 'counter' => (int) $numFound];
}
public function postPublish($group = null)
{
$json = false;
if($group === '_json'){
$json = true;
}
$this->manager->exportTranslations($group, $json);
return ['status' => 'ok'];
}
public function postAddGroup(Request $request)
{
$group = str_replace(".", '', $request->input('new-group'));
if ($group)
{
return redirect()->action('\Barryvdh\TranslationManager\Controller@getView',$group);
}
else
{
return redirect()->back();
}
}
public function postAddLocale(Request $request)
{
$locales = $this->manager->getLocales();
$newLocale = str_replace([], '-', trim($request->input('new-locale')));
if (!$newLocale || in_array($newLocale, $locales)) {
return redirect()->back();
}
$this->manager->addLocale($newLocale);
return redirect()->back();
}
public function postRemoveLocale(Request $request)
{
foreach ($request->input('remove-locale', []) as $locale => $val) {
$this->manager->removeLocale($locale);
}
return redirect()->back();
}
}

View File

@ -0,0 +1,24 @@
<?php
/**
* Created by PhpStorm.
* User: kgbot
* Date: 5/29/18
* Time: 12:40 PM
*/
namespace Barryvdh\TranslationManager\Events;
class TranslationsExportedEvent
{
/**
* Create a new event instance.
*
* @return void
*/
public function __construct()
{
}
}

View File

@ -0,0 +1,428 @@
<?php
namespace Barryvdh\TranslationManager;
use Barryvdh\TranslationManager\Events\TranslationsExportedEvent;
use Barryvdh\TranslationManager\Models\Translation;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
class Manager
{
const JSON_GROUP = '_json';
/** @var \Illuminate\Contracts\Foundation\Application */
protected $app;
/** @var \Illuminate\Filesystem\Filesystem */
protected $files;
/** @var \Illuminate\Contracts\Events\Dispatcher */
protected $events;
protected $config;
protected $locales;
protected $ignoreLocales;
protected $ignoreFilePath;
public function __construct( Application $app, Filesystem $files, Dispatcher $events )
{
$this->app = $app;
$this->files = $files;
$this->events = $events;
$this->config = $app[ 'config' ][ 'translation-manager' ];
$this->ignoreFilePath = storage_path( '.ignore_locales' );
$this->locales = [];
$this->ignoreLocales = $this->getIgnoredLocales();
}
protected function getIgnoredLocales()
{
if ( !$this->files->exists( $this->ignoreFilePath ) ) {
return [];
}
$result = json_decode( $this->files->get( $this->ignoreFilePath ) );
return ( $result && is_array( $result ) ) ? $result : [];
}
public function importTranslations( $replace = false, $base = null )
{
$counter = 0;
//allows for vendor lang files to be properly recorded through recursion.
$vendor = true;
if ( $base == null ) {
$base = $this->app[ 'path.lang' ];
$vendor = false;
}
foreach ( $this->files->directories( $base ) as $langPath ) {
$locale = basename( $langPath );
//import langfiles for each vendor
if ( $locale == 'vendor' ) {
foreach ( $this->files->directories( $langPath ) as $vendor ) {
$counter += $this->importTranslations( $replace, $vendor );
}
continue;
}
$vendorName = $this->files->name( $this->files->dirname( $langPath ) );
foreach ( $this->files->allfiles( $langPath ) as $file ) {
$info = pathinfo( $file );
$group = $info[ 'filename' ];
if ( in_array( $group, $this->config[ 'exclude_groups' ] ) ) {
continue;
}
$subLangPath = str_replace( $langPath . DIRECTORY_SEPARATOR, '', $info[ 'dirname' ] );
$subLangPath = str_replace( DIRECTORY_SEPARATOR, '/', $subLangPath );
$langPath = str_replace( DIRECTORY_SEPARATOR, '/', $langPath );
if ( $subLangPath != $langPath ) {
$group = $subLangPath . '/' . $group;
}
if ( !$vendor ) {
$translations = \Lang::getLoader()->load( $locale, $group );
} else {
$translations = include( $file );
$group = "vendor/" . $vendorName;
}
if ( $translations && is_array( $translations ) ) {
foreach ( array_dot( $translations ) as $key => $value ) {
$importedTranslation = $this->importTranslation( $key, $value, $locale, $group, $replace );
$counter += $importedTranslation ? 1 : 0;
}
}
}
}
foreach ( $this->files->files( $this->app[ 'path.lang' ] ) as $jsonTranslationFile ) {
if ( strpos( $jsonTranslationFile, '.json' ) === false ) {
continue;
}
$locale = basename( $jsonTranslationFile, '.json' );
$group = self::JSON_GROUP;
$translations =
\Lang::getLoader()->load( $locale, '*', '*' ); // Retrieves JSON entries of the given locale only
if ( $translations && is_array( $translations ) ) {
foreach ( $translations as $key => $value ) {
$importedTranslation = $this->importTranslation( $key, $value, $locale, $group, $replace );
$counter += $importedTranslation ? 1 : 0;
}
}
}
return $counter;
}
public function importTranslation( $key, $value, $locale, $group, $replace = false )
{
// process only string values
if ( is_array( $value ) ) {
return false;
}
$value = (string) $value;
$translation = Translation::firstOrNew( [
'locale' => $locale,
'group' => $group,
'key' => $key,
] );
// Check if the database is different then the files
$newStatus = $translation->value === $value ? Translation::STATUS_SAVED : Translation::STATUS_CHANGED;
if ( $newStatus !== (int) $translation->status ) {
$translation->status = $newStatus;
}
// Only replace when empty, or explicitly told so
if ( $replace || !$translation->value ) {
$translation->value = $value;
}
$translation->save();
return true;
}
public function findTranslations( $path = null )
{
$path = $path ?: base_path();
$groupKeys = [];
$stringKeys = [];
$functions = $this->config[ 'trans_functions' ];
$groupPattern = // See http://regexr.com/392hu
"[^\w|>]" . // Must not have an alphanum or _ or > before real method
'(' . implode( '|', $functions ) . ')' . // Must start with one of the functions
"\(" . // Match opening parenthesis
"[\'\"]" . // Match " or '
'(' . // Start a new group to match:
'[a-zA-Z0-9_-]+' . // Must start with group
"([.|\/](?! )[^\1)]+)+" . // Be followed by one or more items/keys
')' . // Close group
"[\'\"]" . // Closing quote
"[\),]"; // Close parentheses or new parameter
$stringPattern =
"[^\w|>]" . // Must not have an alphanum or _ or > before real method
'(' . implode( '|', $functions ) . ')' . // Must start with one of the functions
"\(" . // Match opening parenthesis
"(?P<quote>['\"])" . // Match " or ' and store in {quote}
"(?P<string>(?:\\\k{quote}|(?!\k{quote}).)*)" . // Match any string that can be {quote} escaped
"\k{quote}" . // Match " or ' previously matched
"[\),]"; // Close parentheses or new parameter
// Find all PHP + Twig files in the app folder, except for storage
$finder = new Finder();
$finder->in( $path )->exclude( 'storage' )->name( '*.php' )->name( '*.twig' )->name( '*.vue' )->files();
/** @var \Symfony\Component\Finder\SplFileInfo $file */
foreach ( $finder as $file ) {
// Search the current file for the pattern
if ( preg_match_all( "/$groupPattern/siU", $file->getContents(), $matches ) ) {
// Get all matches
foreach ( $matches[ 2 ] as $key ) {
$groupKeys[] = $key;
}
}
if ( preg_match_all( "/$stringPattern/siU", $file->getContents(), $matches ) ) {
foreach ( $matches[ 'string' ] as $key ) {
if ( preg_match( "/(^[a-zA-Z0-9_-]+([.][^\1)\ ]+)+$)/siU", $key, $groupMatches ) ) {
// group{.group}.key format, already in $groupKeys but also matched here
// do nothing, it has to be treated as a group
continue;
}
//TODO: This can probably be done in the regex, but I couldn't do it.
//skip keys which contain namespacing characters, unless they also contain a
//space, which makes it JSON.
if ( !( str_contains( $key, '::' ) && str_contains( $key, '.' ) )
|| str_contains( $key, ' ' ) ) {
$stringKeys[] = $key;
}
}
}
}
// Remove duplicates
$groupKeys = array_unique( $groupKeys );
$stringKeys = array_unique( $stringKeys );
// Add the translations to the database, if not existing.
foreach ( $groupKeys as $key ) {
// Split the group and item
list( $group, $item ) = explode( '.', $key, 2 );
$this->missingKey( '', $group, $item );
}
foreach ( $stringKeys as $key ) {
$group = self::JSON_GROUP;
$item = $key;
$this->missingKey( '', $group, $item );
}
// Return the number of found translations
return count( $groupKeys + $stringKeys );
}
public function missingKey( $namespace, $group, $key )
{
if ( !in_array( $group, $this->config[ 'exclude_groups' ] ) ) {
Translation::firstOrCreate( [
'locale' => $this->app[ 'config' ][ 'app.locale' ],
'group' => $group,
'key' => $key,
] );
}
}
public function exportTranslations( $group = null, $json = false )
{
$basePath = $this->app[ 'path.lang' ];
if ( !is_null( $group ) && !$json ) {
if ( !in_array( $group, $this->config[ 'exclude_groups' ] ) ) {
$vendor = false;
if ( $group == '*' ) {
return $this->exportAllTranslations();
} else {
if ( starts_with( $group, "vendor" ) ) {
$vendor = true;
}
}
$tree = $this->makeTree( Translation::ofTranslatedGroup( $group )
->orderByGroupKeys( array_get( $this->config, 'sort_keys', false ) )
->get() );
foreach ( $tree as $locale => $groups ) {
if ( isset( $groups[ $group ] ) ) {
$translations = $groups[ $group ];
$path = $this->app[ 'path.lang' ];
$locale_path = $locale . DIRECTORY_SEPARATOR . $group;
if ( $vendor ) {
$path = $basePath . '/' . $group . '/' . $locale;
$locale_path = str_after( $group, "/" );
}
$subfolders = explode( DIRECTORY_SEPARATOR, $locale_path );
array_pop( $subfolders );
$subfolder_level = '';
foreach ( $subfolders as $subfolder ) {
$subfolder_level = $subfolder_level . $subfolder . DIRECTORY_SEPARATOR;
$temp_path = rtrim( $path . DIRECTORY_SEPARATOR . $subfolder_level, DIRECTORY_SEPARATOR );
if ( !is_dir( $temp_path ) ) {
mkdir( $temp_path, 0777, true );
}
}
$path = $path . DIRECTORY_SEPARATOR . $locale . DIRECTORY_SEPARATOR . $group . '.php';
$output = "<?php\n\nreturn " . var_export( $translations, true ) . ";" . \PHP_EOL;
$this->files->put( $path, $output );
}
}
Translation::ofTranslatedGroup( $group )->update( [ 'status' => Translation::STATUS_SAVED ] );
}
}
if ( $json ) {
$tree = $this->makeTree( Translation::ofTranslatedGroup( self::JSON_GROUP )
->orderByGroupKeys( array_get( $this->config, 'sort_keys', false ) )
->get(), true );
foreach ( $tree as $locale => $groups ) {
if ( isset( $groups[ self::JSON_GROUP ] ) ) {
$translations = $groups[ self::JSON_GROUP ];
$path = $this->app[ 'path.lang' ] . '/' . $locale . '.json';
$output = json_encode( $translations, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_UNICODE );
$this->files->put( $path, $output );
}
}
Translation::ofTranslatedGroup( self::JSON_GROUP )->update( [ 'status' => Translation::STATUS_SAVED ] );
}
$this->events->dispatch( new TranslationsExportedEvent() );
}
public function exportAllTranslations()
{
$groups = Translation::whereNotNull( 'value' )->selectDistinctGroup()->get( 'group' );
foreach ( $groups as $group ) {
if ( $group->group == self::JSON_GROUP ) {
$this->exportTranslations( null, true );
} else {
$this->exportTranslations( $group->group );
}
}
$this->events->dispatch( new TranslationsExportedEvent() );
}
protected function makeTree( $translations, $json = false )
{
$array = [];
foreach ( $translations as $translation ) {
if ( $json ) {
$this->jsonSet( $array[ $translation->locale ][ $translation->group ], $translation->key,
$translation->value );
} else {
array_set( $array[ $translation->locale ][ $translation->group ], $translation->key,
$translation->value );
}
}
return $array;
}
public function jsonSet( &$array, $key, $value )
{
if ( is_null( $key ) ) {
return $array = $value;
}
$array[ $key ] = $value;
return $array;
}
public function cleanTranslations()
{
Translation::whereNull( 'value' )->delete();
}
public function truncateTranslations()
{
Translation::truncate();
}
public function getLocales()
{
if ( empty( $this->locales ) ) {
$locales = array_merge( [ config( 'app.locale' ) ],
Translation::groupBy( 'locale' )->pluck( 'locale' )->toArray() );
foreach ( $this->files->directories( $this->app->langPath() ) as $localeDir ) {
if ( ( $name = $this->files->name( $localeDir ) ) != 'vendor' ) {
$locales[] = $name;
}
}
$this->locales = array_unique( $locales );
sort( $this->locales );
}
return array_diff( $this->locales, $this->ignoreLocales );
}
public function addLocale( $locale )
{
$localeDir = $this->app->langPath() . '/' . $locale;
$this->ignoreLocales = array_diff( $this->ignoreLocales, [ $locale ] );
$this->saveIgnoredLocales();
$this->ignoreLocales = $this->getIgnoredLocales();
if ( !$this->files->exists( $localeDir ) || !$this->files->isDirectory( $localeDir ) ) {
return $this->files->makeDirectory( $localeDir );
}
return true;
}
protected function saveIgnoredLocales()
{
return $this->files->put( $this->ignoreFilePath, json_encode( $this->ignoreLocales ) );
}
public function removeLocale( $locale )
{
if ( !$locale ) {
return false;
}
$this->ignoreLocales = array_merge( $this->ignoreLocales, [ $locale ] );
$this->saveIgnoredLocales();
$this->ignoreLocales = $this->getIgnoredLocales();
Translation::where( 'locale', $locale )->delete();
}
public function getConfig( $key = null )
{
if ( $key == null ) {
return $this->config;
} else {
return $this->config[ $key ];
}
}
}

View File

@ -0,0 +1,111 @@
<?php namespace Barryvdh\TranslationManager;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
class ManagerServiceProvider extends ServiceProvider {
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
// Register the config publish path
$configPath = __DIR__ . '/../config/translation-manager.php';
$this->mergeConfigFrom($configPath, 'translation-manager');
$this->publishes([$configPath => config_path('translation-manager.php')], 'config');
$this->app->singleton('translation-manager', function ($app) {
$manager = $app->make('Barryvdh\TranslationManager\Manager');
return $manager;
});
$this->app->singleton('command.translation-manager.reset', function ($app) {
return new Console\ResetCommand($app['translation-manager']);
});
$this->commands('command.translation-manager.reset');
$this->app->singleton('command.translation-manager.import', function ($app) {
return new Console\ImportCommand($app['translation-manager']);
});
$this->commands('command.translation-manager.import');
$this->app->singleton('command.translation-manager.find', function ($app) {
return new Console\FindCommand($app['translation-manager']);
});
$this->commands('command.translation-manager.find');
$this->app->singleton('command.translation-manager.export', function ($app) {
return new Console\ExportCommand($app['translation-manager']);
});
$this->commands('command.translation-manager.export');
$this->app->singleton('command.translation-manager.clean', function ($app) {
return new Console\CleanCommand($app['translation-manager']);
});
$this->commands('command.translation-manager.clean');
}
/**
* Bootstrap the application events.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
$viewPath = __DIR__.'/../resources/views';
$this->loadViewsFrom($viewPath, 'translation-manager');
$this->publishes([
$viewPath => base_path('resources/views/vendor/translation-manager'),
], 'views');
$migrationPath = __DIR__.'/../database/migrations';
$this->publishes([
$migrationPath => base_path('database/migrations'),
], 'migrations');
$config = $this->app['config']->get('translation-manager.route', []);
$config['namespace'] = 'Barryvdh\TranslationManager';
$router->group($config, function($router)
{
$router->get('view/{groupKey?}', 'Controller@getView')->where('groupKey', '.*');
$router->get('/{groupKey?}', 'Controller@getIndex')->where('groupKey', '.*');
$router->post('/add/{groupKey}', 'Controller@postAdd')->where('groupKey', '.*');
$router->post('/edit/{groupKey}', 'Controller@postEdit')->where('groupKey', '.*');
$router->post('/groups/add', 'Controller@postAddGroup');
$router->post('/delete/{groupKey}/{translationKey}', 'Controller@postDelete')->where('groupKey', '.*');
$router->post('/import', 'Controller@postImport');
$router->post('/find', 'Controller@postFind');
$router->post('/locales/add', 'Controller@postAddLocale');
$router->post('/locales/remove', 'Controller@postRemoveLocale');
$router->post('/publish/{groupKey}', 'Controller@postPublish')->where('groupKey', '.*');
});
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array('translation-manager',
'command.translation-manager.reset',
'command.translation-manager.import',
'command.translation-manager.find',
'command.translation-manager.export',
'command.translation-manager.clean'
);
}
}

View File

@ -0,0 +1,55 @@
<?php namespace Barryvdh\TranslationManager\Models;
use Illuminate\Database\Eloquent\Model;
use DB;
/**
* Translation model
*
* @property integer $id
* @property integer $status
* @property string $locale
* @property string $group
* @property string $key
* @property string $value
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
*/
class Translation extends Model{
const STATUS_SAVED = 0;
const STATUS_CHANGED = 1;
protected $table = 'ltm_translations';
protected $guarded = array('id', 'created_at', 'updated_at');
public function scopeOfTranslatedGroup($query, $group)
{
return $query->where('group', $group)->whereNotNull('value');
}
public function scopeOrderByGroupKeys($query, $ordered) {
if ($ordered) {
$query->orderBy('group')->orderBy('key');
}
return $query;
}
public function scopeSelectDistinctGroup($query)
{
$select = '';
switch (DB::getDriverName()){
case 'mysql':
$select = 'DISTINCT `group`';
break;
default:
$select = 'DISTINCT "group"';
break;
}
return $query->select(DB::raw($select));
}
}

View File

@ -0,0 +1,41 @@
<?php namespace Barryvdh\TranslationManager;
use Illuminate\Translation\TranslationServiceProvider as BaseTranslationServiceProvider;
class TranslationServiceProvider extends BaseTranslationServiceProvider {
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->registerLoader();
$this->app->singleton('translator', function($app)
{
$loader = $app['translation.loader'];
// When registering the translator component, we'll need to set the default
// locale as well as the fallback locale. So, we'll grab the application
// configuration so we can easily get both of these values from there.
$locale = $app['config']['app.locale'];
$trans = new Translator($loader, $locale);
$trans->setFallback($app['config']['app.fallback_locale']);
if($app->bound('translation-manager')){
$trans->setTranslationManager($app['translation-manager']);
}
return $trans;
});
}
}

View File

@ -0,0 +1,47 @@
<?php namespace Barryvdh\TranslationManager;
use Illuminate\Translation\Translator as LaravelTranslator;
use Illuminate\Events\Dispatcher;
class Translator extends LaravelTranslator {
/** @var Dispatcher */
protected $events;
/**
* Get the translation for the given key.
*
* @param string $key
* @param array $replace
* @param string $locale
* @return string
*/
public function get($key, array $replace = array(), $locale = null, $fallback = true)
{
// Get without fallback
$result = parent::get($key, $replace, $locale, false);
if($result === $key){
$this->notifyMissingKey($key);
// Reget with fallback
$result = parent::get($key, $replace, $locale, $fallback);
}
return $result;
}
public function setTranslationManager(Manager $manager)
{
$this->manager = $manager;
}
protected function notifyMissingKey($key)
{
list($namespace, $group, $item) = $this->parseKey($key);
if($this->manager && $namespace === '*' && $group && $item ){
$this->manager->missingKey($namespace, $group, $item);
}
}
}

View File

@ -152,6 +152,18 @@ return array(
'Barryvdh\\Debugbar\\Twig\\Extension\\Stopwatch' => $vendorDir . '/barryvdh/laravel-debugbar/src/Twig/Extension/Stopwatch.php',
'Barryvdh\\Debugbar\\Twig\\Node\\StopwatchNode' => $vendorDir . '/barryvdh/laravel-debugbar/src/Twig/Node/StopwatchNode.php',
'Barryvdh\\Debugbar\\Twig\\TokenParser\\StopwatchTokenParser' => $vendorDir . '/barryvdh/laravel-debugbar/src/Twig/TokenParser/StopwatchTokenParser.php',
'Barryvdh\\TranslationManager\\Console\\CleanCommand' => $vendorDir . '/barryvdh/laravel-translation-manager/src/Console/CleanCommand.php',
'Barryvdh\\TranslationManager\\Console\\ExportCommand' => $vendorDir . '/barryvdh/laravel-translation-manager/src/Console/ExportCommand.php',
'Barryvdh\\TranslationManager\\Console\\FindCommand' => $vendorDir . '/barryvdh/laravel-translation-manager/src/Console/FindCommand.php',
'Barryvdh\\TranslationManager\\Console\\ImportCommand' => $vendorDir . '/barryvdh/laravel-translation-manager/src/Console/ImportCommand.php',
'Barryvdh\\TranslationManager\\Console\\ResetCommand' => $vendorDir . '/barryvdh/laravel-translation-manager/src/Console/ResetCommand.php',
'Barryvdh\\TranslationManager\\Controller' => $vendorDir . '/barryvdh/laravel-translation-manager/src/Controller.php',
'Barryvdh\\TranslationManager\\Events\\TranslationsExportedEvent' => $vendorDir . '/barryvdh/laravel-translation-manager/src/Events/TranslationsExportedEvent.php',
'Barryvdh\\TranslationManager\\Manager' => $vendorDir . '/barryvdh/laravel-translation-manager/src/Manager.php',
'Barryvdh\\TranslationManager\\ManagerServiceProvider' => $vendorDir . '/barryvdh/laravel-translation-manager/src/ManagerServiceProvider.php',
'Barryvdh\\TranslationManager\\Models\\Translation' => $vendorDir . '/barryvdh/laravel-translation-manager/src/Models/Translation.php',
'Barryvdh\\TranslationManager\\TranslationServiceProvider' => $vendorDir . '/barryvdh/laravel-translation-manager/src/TranslationServiceProvider.php',
'Barryvdh\\TranslationManager\\Translator' => $vendorDir . '/barryvdh/laravel-translation-manager/src/Translator.php',
'Carbon\\Carbon' => $vendorDir . '/nesbot/carbon/src/Carbon/Carbon.php',
'Carbon\\CarbonInterval' => $vendorDir . '/nesbot/carbon/src/Carbon/CarbonInterval.php',
'Carbon\\CarbonPeriod' => $vendorDir . '/nesbot/carbon/src/Carbon/CarbonPeriod.php',
@ -2060,6 +2072,9 @@ return array(
'Mockery\\Undefined' => $vendorDir . '/mockery/mockery/library/Mockery/Undefined.php',
'Mockery\\VerificationDirector' => $vendorDir . '/mockery/mockery/library/Mockery/VerificationDirector.php',
'Mockery\\VerificationExpectation' => $vendorDir . '/mockery/mockery/library/Mockery/VerificationExpectation.php',
'Modules\\SampleModule\\Database\\Seeders\\SampleModuleDatabaseSeeder' => $baseDir . '/Modules/SampleModule/Database/Seeders/SampleModuleDatabaseSeeder.php',
'Modules\\SampleModule\\Http\\Controllers\\SampleModuleController' => $baseDir . '/Modules/SampleModule/Http/Controllers/SampleModuleController.php',
'Modules\\SampleModule\\Providers\\SampleModuleServiceProvider' => $baseDir . '/Modules/SampleModule/Providers/SampleModuleServiceProvider.php',
'Monolog\\ErrorHandler' => $vendorDir . '/monolog/monolog/src/Monolog/ErrorHandler.php',
'Monolog\\Formatter\\ChromePHPFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php',
'Monolog\\Formatter\\ElasticaFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php',

View File

@ -15,10 +15,10 @@ return array(
'58571171fd5812e6e447dce228f52f4d' => $vendorDir . '/laravel/framework/src/Illuminate/Support/helpers.php',
'2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
'6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
'e91d0dc994644828154ae2387ede1ca8' => $vendorDir . '/spatie/string/src/string_functions.php',
'801c31d8ed748cfa537fa45402288c95' => $vendorDir . '/psy/psysh/src/functions.php',
'e91d0dc994644828154ae2387ede1ca8' => $vendorDir . '/spatie/string/src/string_functions.php',
'4a1f389d6ce373bda9e57857d3b61c84' => $vendorDir . '/barryvdh/laravel-debugbar/src/helpers.php',
'cb61d74ad51d00867155534456b38b23' => $vendorDir . '/mews/purifier/src/helpers.php',
'72b1e3f4a2af9b30b3f137b3ec2057fc' => $vendorDir . '/spatie/laravel-activitylog/src/helpers.php',
'9f394da3192a168c4633675768d80428' => $vendorDir . '/nwidart/laravel-modules/src/helpers.php',
'72b1e3f4a2af9b30b3f137b3ec2057fc' => $vendorDir . '/spatie/laravel-activitylog/src/helpers.php',
);

View File

@ -58,6 +58,7 @@ return array(
'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'),
'DebugBar\\' => array($vendorDir . '/maximebf/debugbar/src/DebugBar'),
'Cron\\' => array($vendorDir . '/mtdowling/cron-expression/src/Cron'),
'Barryvdh\\TranslationManager\\' => array($vendorDir . '/barryvdh/laravel-translation-manager/src'),
'Barryvdh\\Debugbar\\' => array($vendorDir . '/barryvdh/laravel-debugbar/src'),
'Axn\\Laroute\\Routes\\' => array($baseDir . '/overrides/Axn/Laroute/Routes'),
'Axn\\Laroute\\' => array($vendorDir . '/axn/laravel-laroute/src'),

View File

@ -16,12 +16,12 @@ class ComposerStaticInit9382ab4a444ef313492b08539c8c268d
'58571171fd5812e6e447dce228f52f4d' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/helpers.php',
'2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
'6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
'e91d0dc994644828154ae2387ede1ca8' => __DIR__ . '/..' . '/spatie/string/src/string_functions.php',
'801c31d8ed748cfa537fa45402288c95' => __DIR__ . '/..' . '/psy/psysh/src/functions.php',
'e91d0dc994644828154ae2387ede1ca8' => __DIR__ . '/..' . '/spatie/string/src/string_functions.php',
'4a1f389d6ce373bda9e57857d3b61c84' => __DIR__ . '/..' . '/barryvdh/laravel-debugbar/src/helpers.php',
'cb61d74ad51d00867155534456b38b23' => __DIR__ . '/..' . '/mews/purifier/src/helpers.php',
'72b1e3f4a2af9b30b3f137b3ec2057fc' => __DIR__ . '/..' . '/spatie/laravel-activitylog/src/helpers.php',
'9f394da3192a168c4633675768d80428' => __DIR__ . '/..' . '/nwidart/laravel-modules/src/helpers.php',
'72b1e3f4a2af9b30b3f137b3ec2057fc' => __DIR__ . '/..' . '/spatie/laravel-activitylog/src/helpers.php',
);
public static $prefixLengthsPsr4 = array (
@ -130,6 +130,7 @@ class ComposerStaticInit9382ab4a444ef313492b08539c8c268d
),
'B' =>
array (
'Barryvdh\\TranslationManager\\' => 28,
'Barryvdh\\Debugbar\\' => 18,
),
'A' =>
@ -353,6 +354,10 @@ class ComposerStaticInit9382ab4a444ef313492b08539c8c268d
array (
0 => __DIR__ . '/..' . '/mtdowling/cron-expression/src/Cron',
),
'Barryvdh\\TranslationManager\\' =>
array (
0 => __DIR__ . '/..' . '/barryvdh/laravel-translation-manager/src',
),
'Barryvdh\\Debugbar\\' =>
array (
0 => __DIR__ . '/..' . '/barryvdh/laravel-debugbar/src',
@ -572,6 +577,18 @@ class ComposerStaticInit9382ab4a444ef313492b08539c8c268d
'Barryvdh\\Debugbar\\Twig\\Extension\\Stopwatch' => __DIR__ . '/..' . '/barryvdh/laravel-debugbar/src/Twig/Extension/Stopwatch.php',
'Barryvdh\\Debugbar\\Twig\\Node\\StopwatchNode' => __DIR__ . '/..' . '/barryvdh/laravel-debugbar/src/Twig/Node/StopwatchNode.php',
'Barryvdh\\Debugbar\\Twig\\TokenParser\\StopwatchTokenParser' => __DIR__ . '/..' . '/barryvdh/laravel-debugbar/src/Twig/TokenParser/StopwatchTokenParser.php',
'Barryvdh\\TranslationManager\\Console\\CleanCommand' => __DIR__ . '/..' . '/barryvdh/laravel-translation-manager/src/Console/CleanCommand.php',
'Barryvdh\\TranslationManager\\Console\\ExportCommand' => __DIR__ . '/..' . '/barryvdh/laravel-translation-manager/src/Console/ExportCommand.php',
'Barryvdh\\TranslationManager\\Console\\FindCommand' => __DIR__ . '/..' . '/barryvdh/laravel-translation-manager/src/Console/FindCommand.php',
'Barryvdh\\TranslationManager\\Console\\ImportCommand' => __DIR__ . '/..' . '/barryvdh/laravel-translation-manager/src/Console/ImportCommand.php',
'Barryvdh\\TranslationManager\\Console\\ResetCommand' => __DIR__ . '/..' . '/barryvdh/laravel-translation-manager/src/Console/ResetCommand.php',
'Barryvdh\\TranslationManager\\Controller' => __DIR__ . '/..' . '/barryvdh/laravel-translation-manager/src/Controller.php',
'Barryvdh\\TranslationManager\\Events\\TranslationsExportedEvent' => __DIR__ . '/..' . '/barryvdh/laravel-translation-manager/src/Events/TranslationsExportedEvent.php',
'Barryvdh\\TranslationManager\\Manager' => __DIR__ . '/..' . '/barryvdh/laravel-translation-manager/src/Manager.php',
'Barryvdh\\TranslationManager\\ManagerServiceProvider' => __DIR__ . '/..' . '/barryvdh/laravel-translation-manager/src/ManagerServiceProvider.php',
'Barryvdh\\TranslationManager\\Models\\Translation' => __DIR__ . '/..' . '/barryvdh/laravel-translation-manager/src/Models/Translation.php',
'Barryvdh\\TranslationManager\\TranslationServiceProvider' => __DIR__ . '/..' . '/barryvdh/laravel-translation-manager/src/TranslationServiceProvider.php',
'Barryvdh\\TranslationManager\\Translator' => __DIR__ . '/..' . '/barryvdh/laravel-translation-manager/src/Translator.php',
'Carbon\\Carbon' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Carbon.php',
'Carbon\\CarbonInterval' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/CarbonInterval.php',
'Carbon\\CarbonPeriod' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/CarbonPeriod.php',
@ -2480,6 +2497,9 @@ class ComposerStaticInit9382ab4a444ef313492b08539c8c268d
'Mockery\\Undefined' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Undefined.php',
'Mockery\\VerificationDirector' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/VerificationDirector.php',
'Mockery\\VerificationExpectation' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/VerificationExpectation.php',
'Modules\\SampleModule\\Database\\Seeders\\SampleModuleDatabaseSeeder' => __DIR__ . '/../..' . '/Modules/SampleModule/Database/Seeders/SampleModuleDatabaseSeeder.php',
'Modules\\SampleModule\\Http\\Controllers\\SampleModuleController' => __DIR__ . '/../..' . '/Modules/SampleModule/Http/Controllers/SampleModuleController.php',
'Modules\\SampleModule\\Providers\\SampleModuleServiceProvider' => __DIR__ . '/../..' . '/Modules/SampleModule/Providers/SampleModuleServiceProvider.php',
'Monolog\\ErrorHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/ErrorHandler.php',
'Monolog\\Formatter\\ChromePHPFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php',
'Monolog\\Formatter\\ElasticaFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php',

View File

@ -149,6 +149,62 @@
"webprofiler"
]
},
{
"name": "barryvdh/laravel-translation-manager",
"version": "v0.5.0",
"version_normalized": "0.5.0.0",
"source": {
"type": "git",
"url": "https://github.com/barryvdh/laravel-translation-manager.git",
"reference": "857334ea6ffa2511982442495460c9c3ff096160"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-translation-manager/zipball/857334ea6ffa2511982442495460c9c3ff096160",
"reference": "857334ea6ffa2511982442495460c9c3ff096160",
"shasum": ""
},
"require": {
"illuminate/support": "5.5.x|5.6.x|5.7.x",
"illuminate/translation": "5.5.x|5.6.x|5.7.x",
"php": ">=7",
"symfony/finder": "~3.0|~4.0"
},
"time": "2018-08-31T13:25:15+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.4-dev"
},
"laravel": {
"providers": [
"Barryvdh\\TranslationManager\\ManagerServiceProvider"
]
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Barryvdh\\TranslationManager\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"description": "Manage Laravel Translations",
"keywords": [
"laravel",
"translations",
"translator"
]
},
{
"name": "devfactory/minify",
"version": "1.0.7",