Manage the static translations of your Laravel application during and after development. Squanto, its name derived from 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. That being said, please do try this package out as feedback is much appreciated!
- php >= 7.4.7
- Laravel >= 8.0
Via Composer
$ composer require thinktomorrow/squantoThe service providers of the package will be discovered automatically by Laravel. Note that there are two providers: one general package service provider but also a separate one for the Manager browser UI.
Run the migrations. This will add a table called squanto_lines to your database.
$ php artisan migrateNext, publish the config file.
php artisan vendor:publish --tag=squanto-configIn the config, set the different locales you'll wish to maintain via squanto. Most of the other config settings are sensible defaults and should work fine.
Add the following routes. These are the route definitions for viewing and editing the translations. Make sure you'll add the necessary authentication middleware.
Route::get('translations/{id}/edit', [\Thinktomorrow\Squanto\Manager\Http\ManagerController::class, 'edit'])->name('squanto.edit');
Route::put('translations/{id}', [\Thinktomorrow\Squanto\Manager\Http\ManagerController::class, 'update'])->name('squanto.update');
Route::get('translations', [\Thinktomorrow\Squanto\Manager\Http\ManagerController::class, 'index'])->name('squanto.index');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 are assigned the redactor-editor class.
The following console commands are available for the developer.
# Push all language lines to the database. Existing database values will remain untouched.
$ php artisan squanto:push
# Remove database lines that are no longer present in the language files.
$ php artisan squanto:purge
# Check if your database lines are up to date, and if a push or purge command is advised.
$ php artisan squanto:check
# Rebuild the database cache.
$ php artisan squanto:cachePlease see CHANGELOG for more information what has changed recently.
$ composer testIf you discover any security related issues, please email to dev@thinktomorrow.be instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.