make handle_missing*_translation overridable#135
Open
kubosuke wants to merge 2 commits intocuriosum-dev:mainfrom
Open
make handle_missing*_translation overridable#135kubosuke wants to merge 2 commits intocuriosum-dev:mainfrom
kubosuke wants to merge 2 commits intocuriosum-dev:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
#136
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
This PR restores the ability to override these fallback functions.
(Use case: in our application, when translation values are missing, instead of returning the msgid immediately, we’d like to fall back to the
enlocale. To achieve this, we need to override these functions.)Type of Change
Related Issues
Fixes #
Closes #
Related to #
Changes Made
Testing
Test Environment
1.19.2281.8.0psql 16.91.0Test Cases
Test Commands Run
Documentation
Code Quality
Backward Compatibility
Breaking Changes
Performance Impact
Performance Notes
Translation Management Impact
Translation Impact Notes
Security Considerations
Additional Notes
Screenshots/Examples
Checklist
Reviewer Notes