Skip to content

[Feature]: make handle_missing_translation overridable #136

@kubosuke

Description

@kubosuke

Problem description

In the previous version of gettext-runtime, the functions handle_missing_translation and handle_missing_plural_translation were overridable:
https://github.com/ravensiris/gettext/blob/600e4630fb7db514d464f92e2069a138cf9c68a1/lib/gettext.ex#L633

However, in the latest Kanta v0.5, overriding these functions is no longer allowed:
https://github.com/curiosum-dev/kanta/blob/main/lib/kanta/backend.ex

let's restores the ability to override these fallback functions

Proposed solution

restore overridable

Alternatives considered

No response

Use case

Use case: in our application, when translation values are missing, instead of returning the msgid immediately, we’d like to fall back to the en locale. To achieve this, we need to override these functions.

Desired API/code example

Priority (1-5)

2 - Medium - Would be helpful

Additional Context

No response

Checklist

  • I have searched for existing issues before creating this one
  • I have checked the roadmap in the README
  • This is a feature request, not a bug report or question. For general questions, please use Kanta Slack channel or GitHub Discussions.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions