Skip to content

Optionally warn about missing translations #410

@PJUllrich

Description

@PJUllrich

Functions like dgettext/4 and dngettext/4 silently fall back to the transalation in default.po if a translation doesn't exist in the PO file of the given domain.

Would it be possible to throw a warning or error if Gettext silently falls back to a default translation? Just optionally, if e.g. a configuration flag is set.

My current problem is that I have to create a domain PO file by hand because I'm dynamically fetching the translation based on some user configuration. I don't want to translate all entries from the default.po though, but only a few key words that are different between e.g. organizations. This means that I can't use (I think) mix gettext to extract the domain-specific translations and I have to manually find and add all domain-specific words. However, I can run the phoenix project and would like Gettext to throw a warning whenever it doesn't find a domain-specific keyword in the domain.po file. This way, I could quickly identify the missing translations.

Thank you for your help :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions