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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining defaultVariables value in Tolgee config #3292

Open
amir2mi opened this issue Jan 2, 2024 · 6 comments
Open

Defining defaultVariables value in Tolgee config #3292

amir2mi opened this issue Jan 2, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@amir2mi
Copy link

amir2mi commented Jan 2, 2024

 interpolation: {
    defaultVariables: {
      brandName: 'test',
    },
  },

I did not find this option using solely Tolgee, it is available in i18next and helps to have minimal translations without the need to define some variables every time.

@stepan662 stepan662 self-assigned this Jan 2, 2024
@stepan662 stepan662 added the enhancement New feature or request label Jan 2, 2024
@stepan662
Copy link
Collaborator

I don't like this approach very much, it makes things easier, but also can feel more like magic, because it makes it harder to see where is the parameter coming from. Also, you can do this easily by creating your custom T component or t function where you pass this manually.

@stepan662
Copy link
Collaborator

What do you think @JanCizmar

@JanCizmar
Copy link
Contributor

The only issue I see in creating the custom T or t is that the extractor wouldn't understand these. Apart from this I agree.

@stepan662
Copy link
Collaborator

I'd be for making the extractor more relaxed, e.g. not to check where is the <T> component coming from.

@empz
Copy link

empz commented Sep 23, 2024

This hasn't been implemented, right? Issue was closed as completed, but I can't find anywhere how to do this.

@stepan662
Copy link
Collaborator

Hello, you are right. I can reopen this, but I'm still not sure if it's a good approach. Global settings are powerful, however make it harder for code readability.

@stepan662 stepan662 reopened this Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants