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

Translation is always returning english when passing arguments on the server. #234

Open
Jessedev1 opened this issue Feb 8, 2024 · 2 comments

Comments

@Jessedev1
Copy link

Hi,

I am experiencing some problems when translating text server-side using arguments.
The projects contains two languages: English (default) and Dutch.

en.i18n.json
{ "This is a message": "This is a test message: %s" }

nl.i18n.json
{ "This is a message": "Dit is een test bericht: %s" }

When I do not pass the argument everything works fine:
TAPi18n.__("This is a message", null, "nl"): "Dit is een test bericht: %s"

When I do pass the argument the text will always return in english:
TAPi18n.__("This is a message", "Hallo Wereld!", "nl"): "This is a test message: Hallo Wereld!"


This only occurs when using on server-side. At client-side everything works fine since we can use the setLanguage() function there. The issue seems to be a problem with the extra lang_tag parameter.

Is there someway to fix this on our side, or is this an issue in the package?
Looking forward hearing from you!

Regards,
Jesse

@Jessedev1
Copy link
Author

This issue still occurs. Temporary fix for my code was to remove all messages with variables on server-side.
Hope you can fix this.

@theosp
Copy link
Collaborator

theosp commented Jul 25, 2024

If your time will permit please come up with a demo repository with reproduction of this bug 🙏

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