Skip to content

Report missing translations #827

Closed as not planned
Closed as not planned
@khalyomede

Description

@khalyomede

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;
    });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions