Manage the static translations of your Laravel application during and after development Squanto, based on one of the first Native Indian interpreters, is an opinionated way to manage the translations in database.
NOTE: This package is still in development and the api will be subject to change. Also note that it is tailor made for Think Tomorrow projects but you are free to use it. Please only use this package in production until a stable version is released. That being said, please do try this package out as feedback is much appreciated!
Via Composer
$ composer require thinktomorrow/squanto-
Publish the migrations and run them:
$ php artisan vendor:publish --provider="Thinktomorrow\Squanto\SquantoServiceProvider" -
Basic development protectiong Add the
ThinkTomorrow\Squanto\Manager\ManagesSquantotrait to your User model. This will expose a public method 'isSquantoDeveloper' to be used inside your views and middleware. -
Managing squanto via the interface also requires a middleware
squanto.developwhich should protect the routes responsible for adding, editing and deleting translation lines. A insecure default is available but for production you must setup your own permissions logic on these routes.protected $routeMiddleware = [ 'squanto.developer' => \Thinktomorrow\Squanto\Manager\Http\Middleware\Developer::class, ],
-
Add the service provider in your config/app.php providers array
'providers' => [ ... Thinktomorrow\Squanto\SquantoServiceProvider::class, Thinktomorrow\Squanto\SquantoManagerServiceProvider::class, // Optionally add the UI manager ];
-
editor The redactor editor is required so you'll need to include the css and js assets. This is not provided since you'll need a licence. Feel free to switch editors. The textareas that require a wysiwyg a assigned a
redactor-editorclass.
Make sure you set the settings in the squanto config file. Especially the locales to be maintained. Run the migrations
$ php artisan migrateNext you can import the existing translations from your lang files by following command:
$ php artisan squanto:importIf you run this command with the -dry option it will simulate the impact of the import first.
Please see CHANGELOG for more information what has changed recently.
$ composer testPlease see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email cavensben@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.