Accept-Language header worked before 2.0 update as described here
, but after 2.0 it ignores this header
I'll have to take a look at this. I thought we had test coverage on this, if not we should add them.
Can you create a GitHub issue with Steps to recreate?
yes shure
@dribbens I started to describe the issue and I thought why don't I replace fetch function provided by node to fetch function provided by sveltekit (I use payload with sveltekit app) and it worked! I got localized error.
But I am still confused about the reason. Headers are the same, maybe you added some additional conditions in v2?
here is my fetch function:
export const login = async ({ fetch, email, password }: LoginParams) => {
return fetch(
${BACKEND_URL}/api/users/login
, {
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
'Accept-Language': 'ru'
},
body: JSON.stringify({
email,
password
}),
});
}
I don't think the function for fetch would matter. Nothing changes AFAIK for 2.0 regarding the i18n support, same package, maybe a version change but nothing that would be breaking.
If anything it would be a caching situation or something else even more obsecure.
If you can reproduce the problem, please open an issue on github
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.