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(i18n): use Lato and NotoSansJP fonts for Japanese #1032

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

sidemt
Copy link
Member

@sidemt sidemt commented Oct 16, 2024

Checklist:

Closes #XXXXX

While I was looking at the PR about Japanese font in the main repo, I realized my mistakes in this repo.

Changes:

  • load both Lato and NotoSansJP when the language is set to Japanese, so that the alphabet and numbers are displayed in Lato while using NotoSansJP for other Japanese characters.
  • use NotoSansJP everywhere, not only in the post body.
Screenshots (Japanese):

スクリーンショット 2024-10-16 204730

スクリーンショット 2024-10-16 204808

スクリーンショット 2024-10-16 205307

I don't know how to run the English build locally with the current code, so I checked the Chinese build to make sure this change doesn't affect other languages.

Screenshots (Chinese):

スクリーンショット 2024-10-16 210438

@sidemt sidemt requested a review from a team as a code owner October 16, 2024 12:26
Copy link
Contributor

@scissorsneedfoodtoo scissorsneedfoodtoo left a comment

Choose a reason for hiding this comment

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

Tested locally and everything LGTM! 👍

Really like the way that you use CSS variables here to swap between fonts. That's a really neat technique.

@scissorsneedfoodtoo scissorsneedfoodtoo merged commit b8b22f9 into main Oct 18, 2024
17 checks passed
@scissorsneedfoodtoo scissorsneedfoodtoo deleted the fix/japanese-font branch October 18, 2024 09:44
@scissorsneedfoodtoo
Copy link
Contributor

To test English locally, the easiest way to do that is to use the command we use for e2e tests, npm run start:ci:english. That should use some mock Hashnode posts we have in a local JSON file.

We also have Dockerized Chinese and Spanish Ghost instances, so if you have Docker and Docker Compose set up, you could run npm run start:containers, then npm run start:ci:<chinese or espanol> to do quick Chinese / Spanish builds locally.

But since Chinese and Spanish don't have too many published posts, I usually set the language in the .env file and do a quick build using live data with npm start.

@sidemt
Copy link
Member Author

sidemt commented Oct 18, 2024

To test English locally, the easiest way to do that is to use the command we use for e2e tests, npm run start:ci:english. That should use some mock Hashnode posts we have in a local JSON file.

Thanks, @scissorsneedfoodtoo! This was the information I was looking for. I thought it doesn't work because the npm run start:containers command doesn't seem to start the English container anymore.

@scissorsneedfoodtoo
Copy link
Contributor

No problem, @sidemt! Thank you again for this fix.

About the English container, yes, that's right. We recently removed that container and updated the tests to reflect our current setup where the English publication is sourced from Hashnode and the other publications are sourced from Ghost.

You should still be able to use npm run start:ci:english, but now the data will come from JSON files with some mock HN posts and pages.

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.

2 participants