Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Fix Navigation Locale#3076

Merged
ovflowd merged 19 commits into
nodejs:mainfrom
RavenColEvol:fix-locale
Dec 20, 2022
Merged

Fix Navigation Locale#3076
ovflowd merged 19 commits into
nodejs:mainfrom
RavenColEvol:fix-locale

Conversation

@RavenColEvol

@RavenColEvol RavenColEvol commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

Description

This PR targets the issue of Localisation of Navigation bar and support for localised navigation text for navigation bar.
Screenshot 2022-12-06 at 12 32 33 AM
Screenshot 2022-12-06 at 12 36 18 AM

Related Issues

Fixed #2964 #3046

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npm run lint:js -- --fix and/or npm run lint:md -- --fix for my JavaScript and/or Markdown changes.
    • This is important as most of the cases your code changes might not be correctly linted
  • I have run npm run test to check if all tests are passing, and/or npm run test -- -u to update snapshots if I created and/or updated React Components.
  • I have checked that the build works locally and that npm run build work fine.
  • I've covered new added functionality with unit tests if necessary.

@benhalverson benhalverson added the create-preview Generate preview on staging.nodejs.dev label Dec 6, 2022
@benhalverson benhalverson temporarily deployed to firebase-staging December 6, 2022 03:29 Inactive
@github-actions github-actions Bot removed the create-preview Generate preview on staging.nodejs.dev label Dec 6, 2022
@github-actions

github-actions Bot commented Dec 6, 2022

Copy link
Copy Markdown

Please find a preview at: https://staging.nodejs.dev/3076/

@benhalverson

Copy link
Copy Markdown
Member

@RavenColEvol please run npm run format locally to fix the linter issues.

@RavenColEvol

Copy link
Copy Markdown
Contributor Author

@benhalverson I've ran the format command and merged the main changes please review and let me know if any changes required.

@benhalverson benhalverson added the create-preview Generate preview on staging.nodejs.dev label Dec 6, 2022
@benhalverson benhalverson temporarily deployed to firebase-staging December 6, 2022 04:36 Inactive
@github-actions github-actions Bot removed the create-preview Generate preview on staging.nodejs.dev label Dec 6, 2022
@github-actions

github-actions Bot commented Dec 6, 2022

Copy link
Copy Markdown

Please find a preview at: https://staging.nodejs.dev/3076/

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Base: 66.02% // Head: 67.59% // Increases project coverage by +1.57% 🎉

Coverage data is based on head (dfafdf1) compared to base (fd57b87).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3076      +/-   ##
==========================================
+ Coverage   66.02%   67.59%   +1.57%     
==========================================
  Files         118      146      +28     
  Lines        1351     1682     +331     
  Branches      342      392      +50     
==========================================
+ Hits          892     1137     +245     
- Misses        422      500      +78     
- Partials       37       45       +8     
Impacted Files Coverage Δ
src/templates/blog.tsx 0.00% <0.00%> (-100.00%) ⬇️
util-node/getNodeReleasesData.js 91.30% <0.00%> (-6.32%) ⬇️
src/__fixtures__/page.tsx 94.11% <0.00%> (-5.89%) ⬇️
src/pages/index.tsx 100.00% <0.00%> (ø)
src/templates/api.tsx 0.00% <0.00%> (ø)
src/templates/learn.tsx 100.00% <0.00%> (ø)
util-node/createSlug.js 100.00% <0.00%> (ø)
util-node/getNvmData.js 100.00% <0.00%> (ø)
src/hooks/useOnScreen.tsx 100.00% <0.00%> (ø)
src/pages/about/index.tsx 100.00% <0.00%> (ø)
... and 186 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ovflowd

ovflowd commented Dec 6, 2022

Copy link
Copy Markdown
Member

These changes are super cool, but sadly are problematic as you're doing the language filtering in the client-side.

The actual "data" of the navigation is after build-time stored in a JSON file for each page called "page-data.json", I can see this file increasing its size tenfold for every language that we support 😅

Could you maybe think about a way where the filtering of the language could be done within the nodeCreation?

@RavenColEvol

Copy link
Copy Markdown
Contributor Author

@ovflowd Can you please check now

@RavenColEvol

Copy link
Copy Markdown
Contributor Author

@benhalverson can you add the preview tag?

@AugustinMauroy

Copy link
Copy Markdown
Member

Have you added a way to translate the category titles?

@RavenColEvol

Copy link
Copy Markdown
Contributor Author

@AugustinMauroy right now we don't store the title translation in learnEdges that's why I've only added it for subparts.

@AugustinMauroy

Copy link
Copy Markdown
Member

Nice!

Comment thread gatsby-node.js Outdated
@RavenColEvol RavenColEvol requested a review from ovflowd December 6, 2022 17:49
@benhalverson benhalverson added the create-preview Generate preview on staging.nodejs.dev label Dec 6, 2022
@github-actions github-actions Bot removed the create-preview Generate preview on staging.nodejs.dev label Dec 6, 2022
@github-actions

github-actions Bot commented Dec 6, 2022

Copy link
Copy Markdown

Please find a preview at: https://staging.nodejs.dev/3076/

@ovflowd

ovflowd commented Dec 6, 2022

Copy link
Copy Markdown
Member

@RavenColEvol I'm going to give a deeper review as soon as I'm able to, sorry 😅

@AugustinMauroy AugustinMauroy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great work! I don't see any mistakes.
Thanks for your first contribution! Welcome

@RavenColEvol

Copy link
Copy Markdown
Contributor Author

@RavenColEvol I'm going to give a deeper review as soon as I'm able to, sorry 😅

Sure @ovflowd

@RavenColEvol

Copy link
Copy Markdown
Contributor Author

@ovflowd did you get a chance to review the code?

@ovflowd

ovflowd commented Dec 8, 2022

Copy link
Copy Markdown
Member

Does it look like I had a chance? 😅 (Have patience please. There’s no rush for releasing this 🙃)

@ovflowd ovflowd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall a nice change, I believe there are things that can be improved if you revise your logic complexity.

Comment thread gatsby-node.js
Comment thread util-node/createLearnPages.js Outdated
Comment thread util-node/createLearnPages.js Outdated
@RavenColEvol

Copy link
Copy Markdown
Contributor Author

@ovflowd tried to refactor the code by creating more utility functions.

@ovflowd

ovflowd commented Dec 18, 2022

Copy link
Copy Markdown
Member

Thanks! Will give an 👀

@ovflowd ovflowd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Honestly, the code looks good enough for an initial version! Thank you so much for all your hard work! 💖

Let's get this merged!

@ovflowd ovflowd merged commit d108d03 into nodejs:main Dec 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat(nav) I18n working

6 participants