Translation Checker

Translation Checker stats

Downloads
357
Stars
35
Open Issues
0
Forks
4

View on GitHub →

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

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.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Bottelet Translation Checker Related Articles

Translation Checker image

Translation Checker

Read article
Typesense Search logo

Typesense Search

Typesense is an open source, blazing-fast search engine, optimized for helping you build delightful search experiences for your sites and apps. Natively integrated with Laravel Scout.

Typesense Search
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Acquaint Softtech logo

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
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Blastup logo

Blastup

Blastup provides social media enhancement services including buying Instagram likes, followers, and views, with features like instant delivery and a variety of packages to suit different needs.

Blastup
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit