Download the PHP package ahmedessam/laravel-autotranslate without Composer

On this page you can find all versions of the php package ahmedessam/laravel-autotranslate. 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-autotranslate

Laravel AutoTranslate

Laravel AutoTranslate is a package that automates the process of collecting translation keys throughout your Laravel project and organizing them into the appropriate translation files. This tool simplifies multilingual development by ensuring that all translation keys are efficiently managed and up-to-date.

Installation

You can install the package via Composer:

Usage

Step 1: Publish Translation Files

Before running the AutoTranslate command, you must publish the translation files using Laravel's built-in command:

This will create the necessary language files in your lang directory.

Step 2: Synchronize Translation Keys

Once the translation files are published, you can run the AutoTranslate command to automatically collect and organize translation keys:

This command will scan your entire Laravel project for translation keys and ensure they are properly placed in the corresponding translation files.

Configuration

The AutoTranslate package provides a configuration file that allows you to customize the behavior of the translation synchronization process. You can publish the configuration file using the following command:

This will create a config file named autotranslate.php in your config directory. The configuration file contains the following options:

Custom Patterns

You can define custom patterns to search for translation keys in PHP files. To add a custom pattern, simply add it to the patterns array in the autotranslate.php configuration file. Each pattern should be a regular expression that captures the translation key.

Here is an example of adding a custom pattern to capture translation keys in the format trans('key'):

This pattern will capture translation keys in the format trans('key') and extract the key value.

Custom Directories

By default, the AutoTranslate package scans the default Laravel directories for translation keys. If you have additional directories that contain translation keys, you can specify them in the directories array in the autotranslate.php configuration file.

Here is an example of adding a custom directory to search for translation keys:

This will include the custom_directory in the search for translation keys and remove the default Laravel directories.

Directories to save translations

By default, the AutoTranslate package saves the translation keys in the resources/lang directory. If you want to save the translation keys in a different directory, you can specify the directory in the default_directory option in the autotranslate.php configuration file.

Here is an example of saving the translation keys in a custom directory named custom_lang:

This will save the translation keys in the custom_lang directory instead of the default lang directory.

Features

Translation Key Extraction

The AutoTranslate package scans your Laravel project for translation keys and extracts them from various sources, including:

The package identifies translation keys based on the Laravel __(), trans() helper functions and Blade @lang directive.

Requirements

License

The Laravel AutoTranslate package is open-sourced software licensed under the MIT license.

Author

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Issues

If you find any issues with the package or have any questions, please feel free to open an issue on the GitHub repository.

Enjoy building your multilingual applications with Laravel AutoTranslate!


All versions of laravel-autotranslate with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0|^10.0|^9.0|^8.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 ahmedessam/laravel-autotranslate contains the following files

Loading the files please wait ....