https://github.com/hexadog/laravel-translation-manager
Laravel Translation Manager - Find unused or missing translations
https://github.com/hexadog/laravel-translation-manager
laravel laravel-package laravel-translation-manager laravel-translations laravel-translator package-development
Last synced: 7 months ago
JSON representation
Laravel Translation Manager - Find unused or missing translations
- Host: GitHub
- URL: https://github.com/hexadog/laravel-translation-manager
- Owner: hexadog
- Created: 2020-11-07T11:16:31.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-27T18:32:04.000Z (over 1 year ago)
- Last Synced: 2025-04-09T03:17:35.946Z (7 months ago)
- Topics: laravel, laravel-package, laravel-translation-manager, laravel-translations, laravel-translator, package-development
- Language: PHP
- Homepage:
- Size: 177 KB
- Stars: 5
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
## Introduction
hexadog/laravel-translation-manager is a Laravel package to help you manage your application translation.
## Installation
This package requires PHP 7.3 and Laravel 7.0 or higher.
To get started, install Translation Manager using Composer:
```shell
composer require hexadog/laravel-translation-manager
```
The package will automatically register its service provider.
To publish the config file to config/translation-manager.php run:
```shell
php artisan vendor:publish --provider="Hexadog\TranslationManager\Providers\PackageServiceProvider"
```
## Usage
Translation Manager has many features to help you working with translation
- [Configuration](#configuration)
- [Artisan Commands](#artisan-commands)
- [Find unused translation](#find-unused-translation)
- [Find missing translation](#find-missing-translation)
### Configuration
This is the default contents of the configuration:
```php
[
'app',
'resources',
],
// File Extensions to search for.
'extensions' => [
'php',
'js',
],
// Translation function names.
// If your function name contains $ escape it using \$ .
'functions' => [
'__',
'_t',
'@lang',
],
// Indicates weather you need to sort the translations alphabetically
// by original strings (keys).
// It helps navigate a translation file and detect possible duplicates.
'sort-keys' => true,
];
```
### Artisan Commands
This package provides some artisan commands in order to manage themes.
#### Find unused translation
Find all unused translation in your app
```shell
php artisan translation:unused
```
Find all unused translation in your app for specifig namespace
```shell
php artisan translation:unused --namespace=hexadog
```
Find all unused translation in your app for specifig language
```shell
php artisan translation:unused --lang=fr
```
Find all unused translation in your app for a specific language file
```shell
php artisan translation:unused --filename=buttons
```
__This example will search unused translation only in file `buttons.php` for all languages in `directories` configured.__
#### Find missing translation
Find all missing translation in your app
```shell
php artisan translation:missing
```
Find all missing translation in your app for specifig namespace
```shell
php artisan translation:missing --namespace=hexadog
```
Find all missing translation in your app for specifig language
```shell
php artisan translation:missing --lang=fr
```
## License
Laravel Translation Manager is open-sourced software licensed under the [MIT license](LICENSE).