diff --git a/.gitignore b/.gitignore index 58264022..38cdbd73 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ composer.phar composer.lock .DS_Store +.idea \ No newline at end of file diff --git a/LICENSE b/LICENSE index 33492d8d..d21c8f53 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,6 @@ Copyright (C) 2014 Barry vd. Heuvel Copyright (C) 2017 HighSolutions +Copyright (C) 2019 Tiger Fok 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 diff --git a/composer.json b/composer.json index ec9eff5c..37f2835e 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "highsolutions/laravel-translation-manager", + "name": "imtigger/laravel-translation-manager", "description": "Manage Laravel Translations", "keywords": ["laravel", "translations", "translator", "language"], "license": "MIT", @@ -7,21 +7,26 @@ { "name": "Barry vd. Heuvel", "email": "barryvdh@gmail.com" - }, + }, { "name": "HighSolutions", "email": "adam@highsolutions.pl" + }, + { + "name": "Tiger Fok", + "email": "tiger@tiger-workshop.com" } ], "require": { "php": ">=5.4.0", - "illuminate/console": "5.*", - "illuminate/support": "5.*", - "symfony/finder": "*" + "illuminate/console": "5.*|6.*", + "illuminate/support": "5.*|6.*", + "symfony/finder": "*", + "google/cloud-translate": "^1.7" }, "autoload": { "psr-4": { - "HighSolutions\\TranslationManager\\": "src/" + "Imtigger\\TranslationManager\\": "src/" } }, "extra": { @@ -29,8 +34,8 @@ "frameworks": ["Laravel 5.7"], "laravel": { "providers": [ - "HighSolutions\\TranslationManager\\ManagerServiceProvider", - "HighSolutions\\TranslationManager\\TranslationServiceProvider" + "Imtigger\\TranslationManager\\ManagerServiceProvider", + "Imtigger\\TranslationManager\\TranslationServiceProvider" ] } }, diff --git a/config/translation-manager.php b/config/translation-manager.php index c6b91701..5e3cb947 100644 --- a/config/translation-manager.php +++ b/config/translation-manager.php @@ -12,7 +12,7 @@ */ 'route' => [ 'prefix' => 'translations', - 'namespace' => 'HighSolutions\TranslationManager', + 'namespace' => 'Imtigger\TranslationManager', 'middleware' => [ 'web', 'auth', diff --git a/intro.jpg b/intro.jpg deleted file mode 100644 index 951ffa58..00000000 Binary files a/intro.jpg and /dev/null differ diff --git a/readme.md b/readme.md index 563900f8..8c9145c8 100644 --- a/readme.md +++ b/readme.md @@ -3,8 +3,6 @@ Laravel Translation Manager Easy management of translations in Laravel. - - Installation ------------ @@ -12,7 +10,7 @@ Add the following line to the `require` section of your Laravel webapp's `compos ```javascript "require": { - "highsolutions/laravel-translation-manager": "0.4.x" + "Imtigger/laravel-translation-manager": "^0.7" } ``` @@ -23,14 +21,14 @@ Then, update `config/app.php` by adding an entry for the service provider: ```php 'providers' => [ // ... - HighSolutions\TranslationManager\ManagerServiceProvider::class, + Imtigger\TranslationManager\ManagerServiceProvider::class, ]; ``` Next, publish all package resources: ```bash - php artisan vendor:publish --provider="HighSolutions\TranslationManager\ManagerServiceProvider" + php artisan vendor:publish --provider="Imtigger\TranslationManager\ManagerServiceProvider" ``` This will add to your project: @@ -71,7 +69,7 @@ Configuration | Setting name | Description | Default value | |--------------------------|-------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------| -| route | Route declaration (prefix, namespace, middlewares etc.) | [,'prefix' => 'translations', 'namespace' => 'HighSolutions\TranslationManager', 'middleware' => [,'web', 'auth',],] | +| route | Route declaration (prefix, namespace, middlewares etc.) | [,'prefix' => 'translations', 'namespace' => 'Imtigger\TranslationManager', 'middleware' => [,'web', 'auth',],] | | delete_enabled | Enable deletion of translations | true | | exclude_groups | Exclude specific file groups (like validation, pagination, routes etc.) | [] | | exclude_langs | Exclude specific langs and directories (like vendor and en, etc.) | [] | @@ -152,6 +150,25 @@ The suffix command analyzes all translations from new locale (langNew parameter) php artisan translations:sufix langOriginal langNew ``` +### Generate command + +The generate command find empty value in the database with specified locale (default en), and generate value using last part of the translation key. Best used with "Detect missing translations". + +Example: +- "backend.label.order_number" becomes "Order Number" +- "backend.action-button.submit-form" becomes "Submit Form" + +```bash + php artisan translations:generate [--import] [--export] [--group=backend] [--locale=en] +``` + +Options: +- --import Import translation before generating +- --export Export translation immediately +- --locale[=LOCALE] Translation locale [default: "en"] +- --group[=GROUP] Translation group [default: "backend"] + + ### 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. @@ -160,7 +177,7 @@ In your config/app.php, comment out the original TranslationServiceProvider and ```php //'Illuminate\Translation\TranslationServiceProvider', - 'HighSolutions\TranslationManager\TranslationServiceProvider', + 'Imtigger\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. @@ -177,7 +194,7 @@ Update `config/app.php` by adding an entry for the service provider (another one ```php 'providers' => [ // ... - HighSolutions\TranslationManager\TranslationServiceProvider::class, + Imtigger\TranslationManager\TranslationServiceProvider::class, ]; ``` @@ -305,68 +322,19 @@ You can use this helper like this: Do not use this inside of non-clickable elements (title attribute, alt attributes etc.). To launch popup inside link, click on border, not text. -Changelog ---------- - -0.6.0 -* No STRICT_MODE needed anymore - -0.5.1 -* Fix searching translations - -0.5.0 -* Change the views path - -0.4.7 -* remove closures in config file - -0.4.5 -* Laravel 5.6 support - -0.4.4 -* Fix translation title popup - -0.4.3 -* New configurations (popup placement and basic language) -* Update documentation about necessary JS scripts - -0.4.0 - -* New commands: clone and suffix -* Improve export command - -0.3.7 - -* New configuration option to exclude langs - -0.3.6 - -* Support auto-discovery and Laravel 5.5 - -0.3.0 - -* Support for subdirectories -* Support for array translations -* New design -* Permission management -* Translations for view -* Live editing - -0.2.0 - -* Barryvdh version of package - Roadmap ------- -* Duplicate translations of one locale to another with locale suffix. * Detection of incorrect files. -* Support vendor translations files. +* Auto generate placeholder from key +* Auto Tradition Simplifed <=> Simplifed Chinese convertion * Unit tests! Credits ------- -This package was originally created by [Barry vd. Heuvel](https://github.com/barryvdh) and is available here: [laravel-feed](https://github.com/barryvdh/laravel-translation-manager). +This package was originally created by [Barry vd. Heuvel](https://github.com/barryvdh) and is available here: [laravel-translation-manager](https://github.com/barryvdh/laravel-translation-manager) + +And then developed by [HighSolutions](https://github.com/highsolutions) and is available here: [laravel-translation-manager](https://github.com/highsolutions/laravel-translation-manager) -Currently is developed by [HighSolutions](http://highsolutions.pl), software house from Poland in love in Laravel. +Currently is developed by [Imtigger](http://tiger-workshop.com) diff --git a/resources/views/key_row.blade.php b/resources/views/key_row.blade.php index b8a98833..aa55a16b 100644 --- a/resources/views/key_row.blade.php +++ b/resources/views/key_row.blade.php @@ -9,7 +9,7 @@ @endphp @if(is_array($translation) && $isCatalog)