Skip to content
/ squanto Public
forked from thinktomorrow/squanto

Laravel static translations manager for development and client management

License

Notifications You must be signed in to change notification settings

yinx/squanto

 
 

Repository files navigation

squanto

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

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!

Install

Via Composer

$ composer require thinktomorrow/squanto

Setup

  1. Publish the migrations and run them:

    $ php artisan vendor:publish --provider="Thinktomorrow\Squanto\SquantoServiceProvider"
  2. Basic development protectiong Add the ThinkTomorrow\Squanto\Manager\ManagesSquanto trait to your User model. This will expose a public method 'isSquantoDeveloper' to be used inside your views and middleware.

  3. Managing squanto via the interface also requires a middleware squanto.develop which 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,
    ],
  4. 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
    ];
  5. 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-editor class.

Usage

Make sure you set the settings in the squanto config file. Especially the locales to be maintained. Run the migrations

$ php artisan migrate

Next you can import the existing translations from your lang files by following command:

$ php artisan squanto:import

If you run this command with the -dry option it will simulate the impact of the import first.

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email cavensben@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Laravel static translations manager for development and client management

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • PHP 83.3%
  • HTML 16.7%