Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: add translation hooks and packages #1980
feat: add translation hooks and packages #1980
Changes from 4 commits
c5f769e
8e85551
e72be06
ab1262c
61c4e4b
5436b9b
6b7c68c
0460db0
4765486
2fe7a34
57aab78
1a7cd84
7778d3a
27dccdf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kindly wrap this in a function and then return the required response from the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this is not my implementation. It is suggested by the plugin author since were in need to use the static site built due to Netlify restrictions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please share the source you are following to create this file?
IMHO, even if we have to implement such logic, I don't think it will make any difference while implementing it inside functions. Reason why I'm asking for making it as a function is that we should work on code quality as well, instead of just writing it as plain implementation of js. Also, it will be easier to add unit tests (later on) for this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I totally agree with your points.
I am following this package. Their one of the examples is what I tried imitating in our project.
The reason to use this package is that previously I was using the next-i18next package to handle the translation-related logic, and everything was going smoothly inside the local dev. environment.
As I pushed that code, it became useless because Netlify cannot process translations on the server, and need pre-generated translations.
Another option was to use a Node.JS environment to host the website, but that doesn't seem viable.