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: ignore empty lang value #1162 #1163

Merged
merged 1 commit into from Nov 4, 2023
Merged

Conversation

timotew
Copy link
Contributor

@timotew timotew commented Oct 26, 2023

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[x ] Bug fix
[ ] New feature
[ ] Other, please explain:

What changes did you make? (Give an overview)
Ignore empty translations for generated pages.

Which issue (if any) does this pull request address?

#1162

Is there anything you'd like reviewers to focus on?

@nightire
Copy link

The current fix is not enough because I18nProvider also suffered from this. Below is what I saw with my local building:

tx-support:build: RangeError: Incorrect locale information provided
tx-support:build:     at new PluralRules (<anonymous>)
tx-support:build:     at I18nProvider (/Users/nightire/Code/github.com/choice-form/tx-hub/node_modules/.pnpm/next-translate@2.6.1_next@14.0.0_react@18.2.0/node_modules/next-translate/lib/cjs/I18nProvider.js:57:23)
tx-support:build:     at Wc (/Users/nightire/Code/github.com/choice-form/tx-hub/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
tx-support:build:     at Zc (/Users/nightire/Code/github.com/choice-form/tx-hub/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
tx-support:build:     at Z (/Users/nightire/Code/github.com/choice-form/tx-hub/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
tx-support:build:     at Zc (/Users/nightire/Code/github.com/choice-form/tx-hub/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
tx-support:build:     at Z (/Users/nightire/Code/github.com/choice-form/tx-hub/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
tx-support:build:     at Zc (/Users/nightire/Code/github.com/choice-form/tx-hub/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
tx-support:build:     at Z (/Users/nightire/Code/github.com/choice-form/tx-hub/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
tx-support:build:     at $c (/Users/nightire/Code/github.com/choice-form/tx-hub/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)

So I made the exact change here, and it finally works:

const ignoreLang = localesToIgnore.includes(lang)

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.

Thanks @timotew

@aralroca
Copy link
Owner

aralroca commented Nov 4, 2023

@esupper thanks, I'm going to do this change in another PR

@timotew
Copy link
Contributor Author

timotew commented Nov 4, 2023

Thanks @aralroca and @esupper . Unfortunately, I have not had the time to reproduce the issues that @nightire mentioned and that's why I have not added it to this change.

@aralroca aralroca merged commit 4d0d4d2 into aralroca:master Nov 4, 2023
6 checks passed
@aralroca
Copy link
Owner

aralroca commented Nov 4, 2023

No worry. Thank you @timotew so much for the contribution!! @all-contributors please add @timotew for code

Copy link
Contributor

@aralroca

I couldn't determine any contributions to add, did you specify any contributions?
Please make sure to use valid contribution names.

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

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

4 participants