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

refactor: capitalize locales when creating i18n config #6048

Merged
merged 3 commits into from
Dec 8, 2021

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Dec 4, 2021

Motivation

Locale labels must be initially uppercased, because it is currently renders as lower-cased for active item in dropdown.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Before After
image image

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@lex111 lex111 added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Dec 4, 2021
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Dec 4, 2021
@netlify
Copy link

netlify bot commented Dec 4, 2021

✔️ [V2]

🔨 Explore the source changes: 774a495

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61b0a24fcf73b200089fd3a5

😎 Browse the preview: https://deploy-preview-6048--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Dec 4, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 79
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-6048--docusaurus-2.netlify.app/

@github-actions
Copy link

github-actions bot commented Dec 4, 2021

Size Change: +478 B (0%)

Total Size: 657 kB

Filename Size Change
website/build/assets/css/styles.********.css 101 kB -88 B (0%)
website/build/assets/js/main.********.js 486 kB +736 B (0%)
website/build/index.html 29.3 kB -170 B (-1%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 40.1 kB

compressed-size-action

@Josh-Cena
Copy link
Collaborator

Why not just add style={{textTransform: 'capitalize'}} to the dropdown label? Would there be any other concerns?

@lex111
Copy link
Contributor Author

lex111 commented Dec 4, 2021

Yes, we can do that, but then we will have two style attributes with the same purpose. So isn't it better to normalize a locale label and just use it without any CSS?

@Josh-Cena Josh-Cena added the status: awaiting review This PR is ready for review, will be merged after maintainers' approval label Dec 7, 2021
Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

LGTM thanks

packages/docusaurus/src/server/i18n.ts Outdated Show resolved Hide resolved
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
@Josh-Cena Josh-Cena removed the status: awaiting review This PR is ready for review, will be merged after maintainers' approval label Dec 8, 2021
@Josh-Cena Josh-Cena merged commit 68b75bf into main Dec 8, 2021
@Josh-Cena Josh-Cena deleted the lex111/capit-langs branch December 8, 2021 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants