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

Fix types + improve config loader #893

Merged
merged 5 commits into from
Aug 18, 2022
Merged

Fix types + improve config loader #893

merged 5 commits into from
Aug 18, 2022

Conversation

Dragate
Copy link
Contributor

@Dragate Dragate commented Aug 14, 2022

@Dragate Dragate changed the title Bug Fix loader & I18nConfig type Aug 14, 2022
@Dragate Dragate changed the title Fix loader & I18nConfig type Fix/Improve types Aug 14, 2022
@Dragate Dragate changed the title Fix/Improve types Fix types Aug 14, 2022
@@ -50,11 +51,10 @@ export default function nextTranslate(nextConfig: any = {}) {
...nextConfig,
i18n: {
...i18n,
...restI18n,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be deleted. What should be done is to remove the restI18n properties that are next-translate properties and not i18n properties. That is, make sure that everything in restI18n are properties of i18n's Next.js.

Copy link
Contributor Author

@Dragate Dragate Aug 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be deleted. What should be done is to remove the restI18n properties that are next-translate properties and not i18n properties. That is, make sure that everything in restI18n are properties of i18n's Next.js.

restI18n has no properties that are valid for Next.js. locales & defaultLocale are added seperately afterwards, domains & localeDetection are not used by next-translate and will be within the i18n spread (not restI18n).

image

Copy link
Owner

@aralroca aralroca Aug 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many people use the i18n.js file to put all the features of Next-translate and Next.js, to have it together in one place.

For example localeDetection: false, or domains. https://nextjs.org/docs/advanced-features/i18n-routing

The thing is that here we should remove the Next-translate ones so that only the Next.js ones are passed.

Copy link
Contributor Author

@Dragate Dragate Aug 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see now. Never realised that next.js properties could be declared in next-translate instead, even though the plugin has no use for them. I'll update the PR soon enough.

@Dragate Dragate requested a review from aralroca August 16, 2022 15:55
Copy link
Owner

@aralroca aralroca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you very much for your contribution!

@aralroca aralroca merged commit 66abd43 into aralroca:canary Aug 18, 2022
@aralroca
Copy link
Owner

@all-contributors please add @Dragate for code

@allcontributors
Copy link
Contributor

@aralroca

I've put up a pull request to add @Dragate! 🎉

@aralroca
Copy link
Owner

@Dragate I prereleased 1.6.0-canary.1 with your changes.

@aralroca aralroca changed the title Fix types Fix types + improve config loader Aug 29, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants