Skip to content

NGettext spams Trace output with missing-translation messages (no way to disable?) #45

@Elfgador

Description

@Elfgador

Hi,

I’m using a library that depends on NGettext, and I’m getting a huge amount of Debug/Trace output like:

Translation not found for message id "..."

From reading the source, this comes from:

Trace.WriteLine($"Translation not found for message id "{messageId}".", "NGettext");

Two problems:

This spam happens very frequently in real usage and floods Visual Studio’s Output window.

It’s hard to suppress cleanly because it goes through Trace.WriteLine(message, category) (category = "NGettext"), not through a normal ILogger, and TraceFilter doesn’t reliably filter this overload with the default listener.

Could we add an option to disable these “missing translation” Trace messages (or lower them behind a configurable switch / injected logger), e.g. a static flag, Catalog option, or an event hook?

I’m happy to provide a PR if you can point me to the preferred approach.

Thanks!

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