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

returned value from parse breaks translation #166

Open
osama1403 opened this issue Jan 5, 2025 · 2 comments
Open

returned value from parse breaks translation #166

osama1403 opened this issue Jan 5, 2025 · 2 comments

Comments

@osama1403
Copy link

🐛 Bug Report

returned value from parse breaks translation

To Reproduce

if you use parse to process backend data .. it cause the t function to return missing key

simple example:

in init:

backend:{
loadPath: 'path to load',
parse:(data: any) => {
return{
En: {
translation: {
hello: "hello"
}
},
Ar: {
translation: {
hello: "مرحبا"
}
}
}
}

in component :
t(hello) => missing key

although if you use the same returned object in 'resources' then it works ..

Expected behavior

to work properly

A clear and concise description of what you expected to happen.

Your Environment

  • runtime version: browser
    -i18next-htttp-backend version: ^3.0.1
  • i18next version: "^24.2.0"
  • os: Windows
@adrai
Copy link
Member

adrai commented Jan 5, 2025

Please provide a minimal but complete reproducible example repository or codesandbox... not just fragments of unformatted code snippets.

@adrai
Copy link
Member

adrai commented Jan 5, 2025

btw: your parse function returns the wrong data anyway...
you should return the translation resources for a specific language and namespace......

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