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

Variables in the target language #6

Open
HenLab opened this issue Apr 28, 2023 · 2 comments
Open

Variables in the target language #6

HenLab opened this issue Apr 28, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@HenLab
Copy link

HenLab commented Apr 28, 2023

The script also sets variables in the target language, e.g. :number words -> then :nummer words. But the result should be :number wrote.

@Saigesp
Copy link
Owner

Saigesp commented May 27, 2023

Hi @HenLab, thanks for the warning.

The way you define variables is quite specific to the environment/framework you use, so there is no simple common solution to solve this.

When I have some more time I will look for a solution. If you or anyone else finds one, you can make a PR and I will review it as soon as possible.

Best regards,

@Saigesp Saigesp added the enhancement New feature or request label May 27, 2023
@fletchgqc
Copy link

Some other tools have included it.
For example https://github.com/gmonarque/go-json-translate says

Supports variables in the translated text. For example, hello, {name} won't be translated to bonjour, {prénom} but to bonjour, {name} Available enclosure tags are: {}, #{} and []. It's very easy to add new ones.

https://github.com/leolabs/json-autotranslate?tab=readme-ov-file

Under available matchers they say

icu (default, matches ICU MessageFormat interpolations)
i18next (matches i18next interpolations)
sprintf (matches sprintf-style interpolations like %s)
none (doesn't match any interpolations)

Maybe just start with ICU

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

3 participants