Download the PHP package flemzord/laravel-auto-translate without Composer

On this page you can find all versions of the php package flemzord/laravel-auto-translate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-auto-translate

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:

Config

After installation publish the config file:

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 Flemzord\AutoTranslate\Translators\SimpleGoogleTranslator / Over 100
Google Cloud Translate No Flemzord\AutoTranslate\Translators\GoogleCloudTranslator Documentation Over 100
Deepl API v2 No Flemzord\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:

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

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

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:

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

Parameters

Sometimes you have translations like these:

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 \Flemzord\AutoTranslate\Translators\TranslatorInterface. Simply reference it in your config file.

Testing

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.


All versions of laravel-auto-translate with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3
google/cloud Version ^0.140.0
illuminate/support Version ^5.6||^6.6||^7.0||^8.0
scn/deepl-api-connector Version dev-master
stichoza/google-translate-php Version ^4.1
themsaid/laravel-langman Version ^1.3
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package flemzord/laravel-auto-translate contains the following files

Loading the files please wait ....