All Projects → ben182 → Laravel Auto Translate

ben182 / Laravel Auto Translate

Licence: mit
Automatically translate your language files using a translator service

Projects that are alternatives of or similar to Laravel Auto Translate

Laravel Js Localization
🌐 Convert your Laravel messages and consume them in the front-end!
Stars: ✭ 451 (+194.77%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Email Verification
Laravel package to handle user verification using an activation mail
Stars: ✭ 63 (-58.82%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Orm
A drop-in Doctrine ORM 2 implementation for Laravel 5+ and Lumen
Stars: ✭ 712 (+365.36%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Generator
Laravel 5.3+ Scaffold Generator, Support both bootstrap and Semantic UI
Stars: ✭ 327 (+113.73%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Pdf
A Simple package for easily generating PDF documents from HTML. This package is specially for laravel but you can use this without laravel.
Stars: ✭ 79 (-48.37%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Server Monitor
Server Monitoring Command for Laravel Applications
Stars: ✭ 424 (+177.12%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Translatable
It's a Laravel database translations manager
Stars: ✭ 47 (-69.28%)
Mutual labels:  laravel, laravel-package, translations
Laravel Gamp
📊 Laravel Google Analytics Measurement Protocol Package
Stars: ✭ 271 (+77.12%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laraupdater
Enable Laravel App Self-Update. Allow your Laravel Application to auto-update itself.
Stars: ✭ 75 (-50.98%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Remember Uploads
Laravel Middleware and helper for remembering file uploads during validation redirects
Stars: ✭ 67 (-56.21%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Jwt Auth Guard
JWT Auth Guard for Laravel and Lumen Frameworks.
Stars: ✭ 319 (+108.5%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Eye
Eyewitness.io package for Laravel 5 applications
Stars: ✭ 114 (-25.49%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Administrator
a fork from Frozennode/Administrator
Stars: ✭ 296 (+93.46%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Telegram
✈️ Telegram Notifications Channel for Laravel
Stars: ✭ 450 (+194.12%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Achievements
Achievements for Laravel 5.3+
Stars: ✭ 279 (+82.35%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Settings
Simple Settings package for a laravel application
Stars: ✭ 45 (-70.59%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Auth Tests
Always-current tests for Laravel's authentication system. Curated by the community.
Stars: ✭ 230 (+50.33%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Gitscrum
GitScrum is a Project Management Tool, developed to help entrepreneurs, freelancers, managers, and teams Skyrocket their Productivity with the Agile methodology and Gamification.
Stars: ✭ 2,686 (+1655.56%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Api Health
Monitor first and third-party services and get notified when something goes wrong!
Stars: ✭ 65 (-57.52%)
Mutual labels:  laravel, laravel-package, laravel-5-package
Laravel Excel
🚀 Supercharged Excel exports and imports in Laravel
Stars: ✭ 10,417 (+6708.5%)
Mutual labels:  laravel, laravel-package, laravel-5-package

Latest Version Build Status Quality Score

With this package you can translate your language files using a translator service. The package ships with a free Google Translate version, Google Translate API and Deepl.

Specify a source language and a target language and it will automatically translate your files. This is useful if you want to prototype something quickly or just a first idea of the translation for later editing. The package ships with two artisan commands. One for translating all the missing translations that are set in the source language but not in the target language. The other one for translating all source language files and overwriting everything in the target language.

Installation

This package can be used in Laravel 5.6 or higher and needs PHP 7.2 or higher.

You can install the package via composer:

composer require ben182/laravel-auto-translate

Config

After installation publish the config file:

php artisan vendor:publish --provider="Ben182\AutoTranslate\AutoTranslateServiceProvider"

You can specify your source language, the target language(s), the translator and the path to your language files in there.

Translators

Name Free File Documentation Available languages
Google Translate HTTP Yes Ben182\AutoTranslate\Translators\SimpleGoogleTranslator / Over 100
Google Cloud Translate No Ben182\AutoTranslate\Translators\GoogleCloudTranslator Documentation Over 100
Deepl API v2 No Ben182\AutoTranslate\Translators\DeeplTranslator Documentation EN, DE, FR, ES, PT, IT, NL, PL, RU

If you have lots of translations to make I recommend Google Cloud Translate or Deepl. They are fast, reliable and you will not encounter any rate limiting.

Usage

Missing translations

Simply call the artisan missing command for translating all the translations that are set in your source language, but not in your target language:

php artisan autotrans:missing

E.g. you have English set as your source language. The source language has translations in auth.php:

<?php

return [
    'failed' => 'These credentials do not match our records.',
    'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
];

Your target language is German. The auth.php file has the following translations:

<?php

return [
    'failed' => 'Diese Kombination aus Zugangsdaten wurde nicht in unserer Datenbank gefunden.',
];

The artisan missing command will then translate the missing auth.throttle key.

All translations

To overwrite all your existing target language keys with the translation of the source language simply call:

php artisan autotrans:all

This will overwrite every single key with a translation of the equivalent source language key.

Parameters

Sometimes you have translations like these:

'welcome' => 'Welcome, :name',

They can be replaced with variables. When we pass these placeholders to a translator service, weird things can happen. Sometimes the placeholder comes back in upper-case letters or it has been translated. Thankfully the package will respect your variable placeholders, so they will be the same after the translation.

Extending

You can create your own translator by creating a class that implements \Ben182\AutoTranslate\Translators\TranslatorInterface. Simply reference it in your config file.

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].