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

Nested locale object does not work in production #165

Closed
lindesvard opened this issue Sep 13, 2023 · 5 comments · Fixed by #166
Closed

Nested locale object does not work in production #165

lindesvard opened this issue Sep 13, 2023 · 5 comments · Fixed by #166
Labels
bug Something isn't working

Comments

@lindesvard
Copy link
Contributor

lindesvard commented Sep 13, 2023

Hey,

Noticed that nested object did not work for me when I built for production. Looked around in the source code and noticed the locale is not flattened for getLocaleProps. So when create-t tries to do let value = scope ? content[`${scope}.${key}`] : content[key]; it would never find the values since content is a nested object.

Did these changes direct in node modules and it seems to resolve my issue. lindesvard@d6394e5

Using next pages as routing

To Reproduce

  1. Just setup a new project with nested objects as translations.
  2. npm run builld
  3. No values are shown

Expected behavior
Nested object should resolve in correct value and not display the key.

About (please complete the following information):

  • next-international version 0.9.5
  • Next.js version 13.4.19
@lindesvard lindesvard added the bug Something isn't working label Sep 13, 2023
@QuiiBz
Copy link
Owner

QuiiBz commented Sep 13, 2023

You're totally right. Would you like to send a PR since you already have a fork?

@lindesvard
Copy link
Contributor Author

Here you have it. Not sure why vercel complaining tho #166

@QuiiBz
Copy link
Owner

QuiiBz commented Sep 13, 2023

I'll wait a few days before triggering a new patch release, since 1.0.0 was released a few minutes ago.

@QuiiBz
Copy link
Owner

QuiiBz commented Sep 15, 2023

@lindesvard
Copy link
Contributor Author

Thanks! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants