skip to Main Content

I am working on a Laravel project with multiple language support and I’ve recently added a new key-value pair to my en/messages.php file:

'back' => 'Back'

I have multiple language files for different locales, such as vi, fr, id, etc., and I need to make sure that this new key is added to all of them with the appropriate translations.

Considering the large number of language files, it’s quite challenging to manually check each file to confirm if the translation has been added. Is there an automated way or a tool within Laravel that can help me verify that all language files have been updated accordingly?

I’m looking for a solution that would either:

Alert me if a key is missing in any language file.
Provide a report of missing translations across all language files.
Any suggestions or best practices on how to manage this efficiently would be greatly appreciated!

Thanks!

2

Answers


  1. You can use the Laravel translations checker. Once the package is installed, you can run a check like this:

    php artisan translations:check
    
    Login or Signup to reply.
  2. No, php artisan translations:check is not a default command in Laravel. To check translations, you might need to create a custom command or use a third-party package like Laravel Langman or Laravel Translation Manager. These packages provide functionality for managing and checking translations.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search