Download the PHP package anastalal/laravel-translation-importer without Composer
On this page you can find all versions of the php package anastalal/laravel-translation-importer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download anastalal/laravel-translation-importer
More information about anastalal/laravel-translation-importer
Files in anastalal/laravel-translation-importer
Package laravel-translation-importer
Short Description A Laravel Package to synchronise translation keys. This package simplifies the process of maintaining translations, especially when new keys are introduced during development.
License MIT
Informations about the package laravel-translation-importer
Laravel Translation Importer
Introduction
The Laravel Translation Importer package is a simple and powerful solution to manage your Laravel application's translation keys efficiently. It scans your project for translation functions (__()
and trans()
) and automatically updates the translation files located in the resources/lang
directory.
This package simplifies the process of maintaining translations, especially when new keys are introduced during development. It helps you avoid missing translation keys by automating the synchronization between your project and language files.
Features
- Manual scanning: The package provides commands to scan your project for translation keys inside
__()
andtrans()
functions. You can run these commands to update your translation files as needed. - File generation: It generates and updates translation files in
resources/lang
. - CLI Commands: Use artisan commands to sync missing keys or update existing ones.
- Supports Multiple Languages: The package is compatible with multi-language projects and works seamlessly across different locales.
Installation
You can install the package via composer:
After installing, you need to publish the configuration file using:
Usage
Important Note: Before using the package, you must manually create the necessary language folders and files in the
resources/lang
directory. For example:
You need to ensure that directories and files for the languages that you want are in place, as the package does not generate them automatically.
Sync Missing Translation Keys
The following command scans your project files for any missing translation keys and adds them to the respective language files in the resources/lang folder:
Sync Translations
To ensure that all translations are up-to-date, use the sync command. This will compare existing translations and update them as needed:
Configuration
Once you’ve published the configuration, you can customize the package’s behavior by modifying the config file located at:
Testing
To ensure the package works as expected, you can run the following tests:
Contributing
Contributions are welcome!
License
The Laravel Translation Importer is open-sourced software licensed under the MIT license.