Блог Серії
Кар'єра
Вакансії Компанії
Навчання
Співбесіди Тестування Відео
Екосистема
Пакети Ресурси Проєкти
Інше
Події Про нас

Translation Checker

bottelet/translation-checker
2.0.0 131 62.4k 30 грудня 2025 2
На GitHub

Пакет для перевірки перекладів у Laravel, який дозволяє знаходити, додавати та перекладати відсутні рядки.

Поділитись

README

Translation Checker

Easily translate missing translations with AI, find missing translations you forgot to add to your language files, and maintain translations in your project. It provides a set of commands to help with language files, ensuring consistency and completeness across your translations. It works with Laravel and supports various frontend frameworks like Vue.js, React, and Svelte.

This package is only intended for Laravel's recommended approach to handle translation files. See Laravel Docs

How it works

  1. Scan Source Files: The system looks through your code for strings that need translation.
  2. Check Language Files: It then checks if these strings exist in your language files.
  3. Use AI to translate missing keys: It adds the missing key with empty values if there is no translation service used.

Example:

lang.json

{
  "test.value": "Value"
}

lang.php

return [
  'test.value' => 'Value',
];

TestClass.php

class TestClass
{
    public function getValue()
    {
        return __('translate this string');
    }
}
php artisan translations:check en

lang.json

{
  "test.value": "Value",
  "translate this string": null
}

lang.php

return [
  'test.value' => 'Value',
  'translate this string' => null,
];

The reason we default to null when no translation service are used is because it defaults to the key used in the function call.

Quick Start

Install the package via composer:

  composer require bottelet/translation-checker --dev

Usage

Translation Checker provides several commands to manage your translations. The most versatile is the check command:

  php artisan translations:check en 

You can also easily find all sync translations between all files:

  php artisan translations:sync en

This will take all translations from the source files and sync them to all your other language files.

For detailed information on all available commands and their usage, refer to the documentation.

Testing

Run the tests with:

  ./vendor/bin/phpunit

Run PHPStan to check for code quality:

  ./vendor/bin/phpstan

Documentation

For full documentation, visit our GitHub documentation page.

If you encounter any issues or have suggestions, please create an issue on GitHub.

License

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

Коментарі

Увійдіть, щоб залишити коментар

Будьте першим, хто залишить коментар!

Схожі пакети

Laravel Debugbar

barryvdh/laravel-debugbar

Інтеграція PHP Debugbar у Laravel для відлагодження та аналізу роботи додатку.

19,256 v4.3.0 13 5

Larastan

nunomaduro/larastan

Larastan — це розширення phpstan/phpstan для Laravel, яке дозволяє виявляти помилки у коді без його запуску.

6,429 v3.10.0 13 6

Laravel Backup

spatie/laravel-backup

Пакет для створення резервних копій вашого Laravel-додатку.

5,996 10.3.0 13 6

Clockwork

itsgoingd/clockwork

PHP інструменти розробки, доступні безпосередньо у браузері.

5,941 v5.3.5 5

Telescope

laravel/telescope

Елегантний помічник для налагодження фреймворку Laravel, який допомагає розробникам в розробці та тестуванні додатків.

5,193 v5.20.0 13 5

Log Viewer

opcodesio/log-viewer

Швидкий та простий у використанні переглядач логів для вашої Laravel-програми.

4,362 v3.24.2 13 5