sepremex/laramissingkey

Manage language files with ease.

1.0.1 2025-06-05 00:17 UTC

This package is auto-updated.

Last update: 2025-06-05 00:36:27 UTC


README

Because sometimes... you just want your damn translation keys in place.

🤦 Why this package exists?

So... imagine working on a glorious Laravel app, multilingual AF, international ambitions, flags everywhere, buttons for French, Spanish, Martian, whatever.
Now imagine you're 42 routes deep, blade templates everywhere, controllers echoing __('Welcome') like gospel...

And then... you realize Laravel doesn't give a damn if you're missing keys.
Worse, those heroic packages that promise to find and sync them?

  • Some are abandoned.
  • Some scan only half your app.
  • Some inject routes in your vendor folders like they own your project.
  • One even needed me to click a damn UI to sync keys.

😐 Nah. We got fed up.
So, we did what any pissed-off dev does: we wrote our own package.

💡 What does it do?

This thing runs:

php artisan lmissingkey:sync

And it does the following:

  1. Searches your entire app/ and resources/views/ for translation keys like __('key') and @lang('key')
  2. Reads all existing language files (both .json and .php grouped ones)
  3. Finds which keys are missing
  4. Appends only valid flat keys to the correct /lang/{locale}.json file
    • No duplicating auth.failed in the wrong place
    • No overwriting your carefully handcrafted artisan translations
  5. Ignores anything Laravel might do to screw it up. Because trust issues.

🚀 Install

composer require sepremex/laramissingkey

🛠️ Usage

php artisan lmissingkey:sync

Boom. Missing keys get written into the right files.

❓ What it doesn't do (yet...)

  • Doesn't edit your /lang/{locale}/*.php files (we're working on that)
  • Doesn't translate for you (we're good, but not Google Translate on steroids)
  • Doesn't throw glitter when it finds keys (maybe later)

🧠 Why not just fix existing packages?

Because some of them were written in 2016...
...by developers who now work for Meta, or raise goats in the Alps, or just don’t reply to GitHub issues anymore.

So we said:

"Let’s do it ourselves. And do it better."

❤️ Credits

Brought to you by a highly caffeinated developer tired of missing __('Submit') for the 20th time.
Powered by rage, sarcasm, and love for clean code.

🐍 License

MIT. Fork it, break it, sell it to Elon, just don’t make it worse.