Adapt getT to Next app router
PhilipAngelinNE opened this issue · comments
Philip Angelin commented
What version of this package are you using?
2.0.5
What problem do you want to solve?
In the pages router you could get locale from the props functions and use the getT
function with that. But Next no longer passes a locale to page components (RSC), so you have no way to translate with your helper function.
The function doesn't seem to work in app router anyway, I can't get it to translate anything like this:
const t = await getT('sv', 'common');
console.log(t('test')); // Should return 'Test' which I have in the /locales directory.
What do you think is the correct solution to this problem?
No idea frankly, I don't have that expertise.
Are you willing to submit a pull request to implement this change?
No.