Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report missing translations #827

Open
khalyomede opened this issue Dec 25, 2023 · 0 comments
Open

Report missing translations #827

khalyomede opened this issue Dec 25, 2023 · 0 comments

Comments

@khalyomede
Copy link

khalyomede commented Dec 25, 2023

Problem Statement

I just stumble upon a feature in the documentation of Laravel 10 that allows us to perform any action when the framework encounter a missing translation.

Solution Brainstorm

To be able to report a missing translation by opt-in for Sentry to catch it:

// app/Providers/AppServiceProvider.php

public function boot(): void
{
    Lang::handleMissingKeysUsing(function (string $key, array $replacements, string $locale) {
        Sentry::reportMissingTranslation($key, $replacements, $locale);
 
        return $key;
    });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants