Skip to content

Gatsby V4, optimizations, and progress on spanish translation#318

Merged
SableRaf merged 123 commits intomainfrom
translation-es
Sep 8, 2022
Merged

Gatsby V4, optimizations, and progress on spanish translation#318
SableRaf merged 123 commits intomainfrom
translation-es

Conversation

@runemadsen
Copy link
Copy Markdown
Member

This PR turned into quite the upgrade for the code of the website. There should be no changes in design or content, but a number of improvements have been made:

  • Gatsby V4. The website is now updated from Gatsby 3 to 4, which should make the build process a lot faster and the local development experience nicer.
  • Node 16. The website didn't have a stated Node version, but was running with Node 12 in the GitHub Actions. The repo now has a .nvmrc file stating the Node version, and the GitHub Actions have been upgraded to use same version: Node 16.
  • Updated packages. I have updated most packages to their newest versions. Since Gatsby doesn't support ESM packages yet, I had to keep some packages one version below their newest, but there are no dependency issues and everything seems to work.
  • Better build process. I optimized the way we generate nodes in the build process, so we don't generate duplicate content. I also changed the way we save the name field in every node to not include the locale, which makes the logic easier on many of the pages when it comes to translations.
  • New hooks. I implemented two news hooks to be used for translated content: useTranslations and useTranslationsWithEnglishBase. They are both documented and used on some pages. As we get ready to publish the first real translation, they might be used even more.
  • Spanish translation files. This PR also adds a bunch of files for the Spanish translation. I currently disabled the translation, so the files won't get used and the build process will not slow down. As we get closer to finishing the translation, it will be very easy to enable it again.
  • Fix libraries search. The libraries search had a problem where categories would shuffle around. I fixed it while making a more friendly version of the useFilteredArray hook.
  • Fix build issue for examples. There was a build issue where the site would sometimes fail when building. This was because the examples would sometimes mistakenly try to load the png file instead of the json file in the example folder, and this would lead to an error when trying to read the JSON. This has been fixed and the site should build now.

@SableRaf This is a rather large pull request, and I have tested it as much as I can. If you could give it a good look on your local computer, that would make me feel a lot better. Here are the steps for making it run:

  • Make sure you're running Node 16. I use nvm for this.
  • Delete your node_modules folder
  • Run npm install
  • Then run npm run dev

Let me know if you run into any issues!

This fixes #317

oruburos and others added 30 commits June 17, 2021 23:40
…site

� Conflicts:
�	content/tutorials/text/2d-array/index.es.mdx
�	i18n/react-intl/en.json
�	src/components/character/Donate.js
�	src/pages/index.js
…site

� Conflicts:
�	package-lock.json
�	package.json
�	src/components/Topbar.js
�	src/pages/404.js
�	src/pages/index.js
�	src/pages/libraries.js
�	src/pages/reference.js
� Conflicts:
�	content/tutorials/text/2darray/index.es.mdx
� Conflicts:
�	content/tools/archive-sketch/archive-sketch.es.json
� Conflicts:
�	content/examples/Basics/Arrays/Array/Array.es.json
�	content/examples/Basics/Arrays/Array/Array.es.pde
�	content/examples/Basics/Control/Conditionals1/Conditionals1.es.json
�	content/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflake.es.json
@runemadsen runemadsen requested a review from SableRaf September 1, 2022 14:21
@runemadsen runemadsen self-assigned this Sep 1, 2022
@SableRaf
Copy link
Copy Markdown
Collaborator

SableRaf commented Sep 2, 2022

Thanks @runemadsen for the detailed instructions! I have tried your branch locally and everything seems to run fine as far as I can tell. Are there specific tests you would like me to run?

@runemadsen
Copy link
Copy Markdown
Member Author

Great! As long as you have gone through all the major sections on the website (which I also did), and it looks good, I think we're good to go!

@SableRaf
Copy link
Copy Markdown
Collaborator

SableRaf commented Sep 7, 2022

Hey @runemadsen

I found one thing that looks broken: images in the "Environment" part don't seem to load. This is the same in the English and Spanish versions.

image

node version: v16.17.0.
Tested on:

  • Chrome Version 105.0.5195.102 (Official Build) (arm64)
  • Safari Version 15.6.1 (17613.3.9.1.16)

@runemadsen
Copy link
Copy Markdown
Member Author

Thanks for this! I can't replicate it on my own machine. Can you try running npm run clean and then npm run dev to see if it fixes it? It might be a cache problem.

@SableRaf
Copy link
Copy Markdown
Collaborator

SableRaf commented Sep 8, 2022

Thanks for this! I can't replicate it on my own machine. Can you try running npm run clean and then npm run dev to see if it fixes it? It might be a cache problem.

That did it!

I have another question: you wrote that the Spanish version is disabled but the menu does appear when I run the website locally and I can switch to Spanish with the incomplete translation. Is this content supposed to be hidden?

image

@runemadsen
Copy link
Copy Markdown
Member Author

Great! About the spanish translation: I had forgotten to remove the config. I just pushed a fix to remove it, so you should be able to pull and the language selector should be gone after a restart.

@SableRaf SableRaf merged commit 0ccea2f into main Sep 8, 2022
@SableRaf
Copy link
Copy Markdown
Collaborator

SableRaf commented Sep 8, 2022

Thanks @runemadsen! I did a last test and everything looks good. Merged and will do a new release of the website today as there have been quite a few changes since last week :)

@runemadsen
Copy link
Copy Markdown
Member Author

Excellent! Keep me posted on how it goes!

@SableRaf SableRaf deleted the translation-es branch February 1, 2023 11:09
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.

Get optimizations from translation-es into main with ignored translations

4 participants