Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

getFixedExists should support function getFixedT #2165

Open
gerwinbrunner opened this issue Mar 28, 2024 · 1 comment
Open

getFixedExists should support function getFixedT #2165

gerwinbrunner opened this issue Mar 28, 2024 · 1 comment

Comments

@gerwinbrunner
Copy link

馃殌 Feature Proposal

I think it would be good to have a getFixedExists function similar to the getFixedT

Motivation

When you do translations on the server side - i.e. emails that are language-specific - then you want to explicitly set a language.
For that the getFixedT function comes in handy.

It would also be great in this scenario to have the same language restricted getFixedExists function.

Example

const t = getFixedT('de');
const exists = getFixedExists('de');

if (exists(email.feature.text)) {
const text = t('email.feature.text')
// do more useful stuff here
}

@gerwinbrunner gerwinbrunner changed the title getFixedExists getFixedExists should support function getFixedT Mar 28, 2024
@adrai
Copy link
Member

adrai commented Mar 28, 2024

feel free to provide a PR with tests

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

No branches or pull requests

2 participants