定制 sertxudeveloper/laravel-translations-checker 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sertxudeveloper/laravel-translations-checker

最新稳定版本:v1.0.1

Composer 安装命令:

composer require sertxudeveloper/laravel-translations-checker

包简介

Check Laravel translation files for missing keys, files, and empty values. Integrates with CI/CD pipelines.

README 文档

README

Translations Checker

Laravel Translations Checker

Codecov Test coverage

Check Laravel translation files for missing translations. Based on the package LarsWiegers/laravel-translations-checker.

This package scans your Laravel translation files and reports:

  • Missing translation files across languages
  • Translation keys that exist in one language but not others
  • Empty or blank translation values

Requirements

This package requires PHP 8.2+ and Laravel 11.0+.

Installation

You can install the package via composer:

composer require sertxudeveloper/laravel-translations-checker

Usage

Run the check command to scan your translation files:

php artisan translations:check

By default, it checks the lang directory in your application. You can specify a different directory:

php artisan translations:check --directory=resources/lang

The command returns exit code 1 if any issues are found, making it suitable for CI/CD pipelines.

Example output

Missing translations:
- The language es (resources/lang/es) is missing the file (auth.php)
- es.validation.required

Empty translations:
- en.messages.welcome (empty value)

Using the Service

You can also use the underlying service in your own code:

use SertxuDeveloper\TranslationsChecker\Services\TranslationCheckerService;

$checker = app(TranslationCheckerService::class);
$result = $checker->check(resource_path('lang'));

$result['missingFiles'];        // Files missing in some languages
$result['missingTranslations']; // Keys missing in some languages
$result['emptyTranslations'];   // Keys with empty values

Testing

This package contains tests. Run them using:

composer test

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.



Copyright © 2026 Sertxu Developer

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-27