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

feat: create i18n package #6945

Closed
wants to merge 5 commits into from
Closed

Conversation

araujogui
Copy link
Member

@araujogui araujogui commented Jul 24, 2024

Description

Create i18n package

Validation

Related Issues

Related to #5405

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npm run format to ensure the code follows the style guide.
  • I have run npm run test to check if all tests are passing.
  • I have run npx turbo build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

Copy link

vercel bot commented Jul 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Aug 11, 2024 5:45pm

@@ -0,0 +1,6 @@
{
"name": "@nodejs/i18n",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a fan of this scope, we should have one specific to the website because this one is also used apr undici. The packages in nodejs are user packages, so it's not the best idea. But there's also @node-core, which doesn't fit either because it's intended for node core 😁.
So for me it would be necessary to have a scope specific to the website project.

Copy link
Member

Choose a reason for hiding this comment

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

I think it should be "@node-core/website-i18n" and the current "@nodejs/website" on (apps/site) should be "@node-core/website"

Copy link
Collaborator

Choose a reason for hiding this comment

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

i am fine with that - one thing to keep in mind is that we cannot anticipate how people will use these packages once split out. @node-core/website-i18n could suddenly become very useful to someone downstream. That's not to say we should optimize for unknown, but I do like re-use.

@AugustinMauroy
Copy link
Contributor

the config is in the i18n package but shouldn't it be dependent on the web app in question, i.e. there will be a config for nodejs.org but if there's another app it will have its own config.

In this case, you could have a config for the app that just gives the language enabled or not.

@ovflowd
Copy link
Member

ovflowd commented Jul 28, 2024

FYI, the i18n package is missing a build script

image

I'm not sure a build-step is needed, since right now the i18n package only has a bunch of JSONs; And I don't think the i18n package needs anything else 🤔

cc @bmuenzenmeyer or @canerakdas any idea of what the i18n package should have else?

@ovflowd
Copy link
Member

ovflowd commented Jul 28, 2024

the config is in the i18n package but shouldn't it be dependent on the web app in question, i.e. there will be a config for nodejs.org but if there's another app it will have its own config.

In this case, you could have a config for the app that just gives the language enabled or not.

I think it is the other way around. site dependsOn i18n

@AugustinMauroy
Copy link
Contributor

I think it is the other way around. site dependsOn i18n

you're not wrong. The question to make the right choice is: are the translation keys package/app dependent or shared, in simple terms do we have one JSON per language or one JSON per language per app/package.
I think a JSON per language is more interesting. So yes, whether enabled or not should be in the I18n package.

@@ -1,6 +1,6 @@
'use strict';
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO this file should be on package i18n. So it's can be share between multiple apps.

Copy link
Collaborator

Choose a reason for hiding this comment

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

agree

Copy link

github-actions bot commented Aug 9, 2024

Note

Your Pull Request seems to be updating Translations of the Node.js Website.

Whilst we appreciate your intent; Any Translation update should be done through our Crowdin Project.
We recommend giving a read on our Translation Guidelines.

Thank you!

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.

4 participants