Translation Checker
Last updated on by Yannick Lyn Fatt
Struggling to keep your multilingual Laravel application's translations up-to-date? Casper Bottelet's Translation Checker is the solution. This package scans your project's code for strings that need translation and compares them to your language files. If it finds a missing translation key, it will add it with an empty value, making it easy for you to fill in the correct translation. What is also nice about this package is that even though it works with Laravel, it supports various frontend frameworks like Vue.js, React, and Svelte as well.
To install this package, run:
composer require bottelet/translation-checker --dev
Next you can use the versatile check
command to check, manage, and update translations:
php artisan translations:check en
The Translation Checker can also be configured to use translation services (from Google, OpenAI or DeepL), specify source paths, and define the language folder. You can publish a configuration file with the following command:
php artisan vendor:publish --provider="Bottelet\TranslationChecker\TranslationCheckerServiceProvider"
The package has some additional commands that you can also use:
-
translations:clean
- Will clean translations by removing unused keys -
translations:find-missing
- Will find and add any missing translations -
translations:sort
- Will sort your translation files -
translations:sync
- Will sync translations between language files
Learn more about this package by reading the documentation and view the source code on Github at Bottelet/translation-checker.