thinktomorrow / squanto
Text manager for static laravel translations during and after development
Installs: 28 482
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 7
Forks: 1
Open Issues: 3
Requires
- php: >=8.1
- ext-json: *
- illuminate/contracts: ~9.11|~10.0
- illuminate/database: ~9.11|~10.0
- illuminate/support: ~9.11|~10.0
- league/flysystem: ~3.0
- thinktomorrow/dynamic-attributes: ^0.4.2
Requires (Dev)
- mockery/mockery: ^1.5.1
- nunomaduro/larastan: ^2.4
- orchestra/testbench: ^7.5|^8.10
- phpunit/phpunit: ^9.5|^10.3
- spatie/temporary-directory: ^1.1
- dev-master
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.3.x-dev
- 2.1.x-dev
- 2.0.1
- 2.0.0
- 1.0.0.x-dev
- 1.0.0
- 1.0.0-beta
- 0.7.1
- 0.7.0
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.6
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.3
- 0.2.2
- 0.2.1.2
- 0.2.1.1
- 0.2.1
- 0.2.0
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- dev-ft/3.2
- dev-TempDimsavUpdate
- dev-feature-rename-key
- dev-feature-abstract-views
- dev-notes-for-better-config
This package is auto-updated.
Last update: 2024-11-08 12:33:06 UTC
README
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!
Requirements
- php >= 7.4.7
- Laravel >= 8.0
Install
Via Composer
$ composer require thinktomorrow/squanto
Setup
The 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 migrate
Next, publish the config file.
php artisan vendor:publish --tag=squanto-config
In 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.
Admin interface
routes
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');
Wysiswyg 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 are assigned the redactor-editor
class.
Usage
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:cache
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please email to dev@thinktomorrow.be instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.