Skip to content

feat(service): hideBeforeDisplay #1579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

rbalet
Copy link
Collaborator

@rbalet rbalet commented Aug 4, 2025

Description

Enable the possibility to hide the keys before they have been translated.

@rbalet
Copy link
Collaborator Author

rbalet commented Aug 4, 2025

@CodeAndWeb Note, I can also do the directive, just didn't wanted to add more time if you wouldn't accept this one or if you have a better implementation

@CodeAndWeb
Copy link
Member

CodeAndWeb commented Aug 5, 2025

I think this solution is incomplete: It does not work for - e.g. instant() or directives.

A more complete solution might be to use a MissingTranslationHandler instead. E.g. we could create a

export class SilentMissingTranslationHandler implements MissingTranslationHandler {
    handle(params: MissingTranslationHandlerParams): string {
        return "";
    }
}

and replace it with the "real" one after the first language or fallback language was loaded. I'd prefer this solution since it's more in one place instead of implementing the logic in several places.

Uses could also easily use a handler like this themselves.
It's also possible to register to onLangChange() and update the flag to show the translation keys.

@CodeAndWeb CodeAndWeb closed this Aug 5, 2025
@CodeAndWeb CodeAndWeb reopened this Aug 5, 2025
@rbalet
Copy link
Collaborator Author

rbalet commented Aug 5, 2025

@CodeAndWeb yes you're right and I like the idea :). Shall I let you implement it, as you're more familiar with the missing handler?

If not you can assign it to me and I'll look into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide translation labels until language file is loaded
2 participants