Package

Bottelet Translation Checker

A translation checker package for Laravel, find, add, and translate missing strings

Package

bottelet/translation-checker

View on GitHub →

Translation Checker

Translation Checker is tool designed to help you find translations you forgot to add to your language files, check, 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.

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. Add missing translation 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 

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

Testing

Run the tests with:

./vendor/bin/phpunit

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.

Bottelet Translation Checker Related Articles

Translation Checker image

Translation Checker

Read article
Building a Laravel Translation Package – Handling Missing Translation Keys image

Building a Laravel Translation Package – Handling Missing Translation Keys

Read article
Find Missing Translations with the Laravel Translations Checker image

Find Missing Translations with the Laravel Translations Checker

Read article
Building a Laravel Translation Package – The Database Driver image

Building a Laravel Translation Package – The Database Driver

Read article
Building a Laravel Translation Package – Building The Frontend image

Building a Laravel Translation Package – Building The Frontend

Read article
Building a Laravel Translation Package – Wiring Up The Frontend image

Building a Laravel Translation Package – Wiring Up The Frontend

Read article

Let your users buy domains without leaving your app

If your Laravel app gives users a site, a storefront, or a workspace, they’ll eventually want their own domain. The name.com API lets them search, register, and connect one without leaving your product. It’s a clean REST API, so Laravel’s HTTP client is all you need.

Let your users buy domains without leaving your app

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift