项目作者: VetonMuhaxhiri

项目描述 :
One Artisan command to find missing translations
高级语言: PHP
项目地址: git://github.com/VetonMuhaxhiri/Laravel-find-missing-translations.git


One command to find missing translations in Laravel application

Laravel artisan command to list all your untranslated words.

Prerequisites

There is no prerequisites for this command to work, you just need to follow the installing process.

Installing

Installing this command is easy, you can use composer or do it manually :

Composer

  1. composer require veton-muhaxhiri/laravel-command-to-find-missing-translations

By running composer command you will have everything setup and ready to be used.

Manually

  1. git clone the repository, or just download it.
  2. copy “src/Commands/FindMissingTranslations.php” file to /app/Console/Commands of your laravel project.

By completing this steps the command should work, unless the command is not loaded automaticly.
To load the command go to app/Console/Kernel.php and add the class name to the $commands property.

  1. protected $commands = [
  2. Commands\FindMissingTranslations::class
  3. ];

Lumen

In Laravel Lumen we just need one extra step, go open bootstrap/app.php file and register the service provider by adding the line

  1. ## Running the command
  2. The command expects two arguments :
  3. 1. **language directory** - Relative path of language directory for ex. /resources/lang is a directory that contains all supported language in your laravel app.
  4. 2. **base language** - Base language for ex. "en". All other languages are compared to this language.
  5. Inside of **language directory**
  6. ![Language directory](https://i.imgur.com/eXGlUI8.png)
  7. While **base language** should be one of the language listed in the picture.
  8. ### Example

$ php artisan translations:missing /resources/lang en
```
Proof of concept

Features

Recursive

Detects missing words in multilevel array for ex.
Multilevel array

Missing files

Detects missing files, for ex. if file with translation named “posts.php” exists in english but not in deutsch.

Authors