Skip to content

Use i18n for common strings #280

@avivkeller

Description

@avivkeller
Member

While we can't translate the docs themselves, we can translate some of our constant strings.

Activity

flakey5

flakey5 commented on May 26, 2025

@flakey5
Member

How would these be distributed in releases? Putting them into subfolders like https://nodejs.org/docs/latest/api/<locale>/buffer.html?

AugustinMauroy

AugustinMauroy commented on May 27, 2025

@AugustinMauroy
Member

If I recall correctly, the TSC completely vetoed the translation.

avivkeller

avivkeller commented on May 27, 2025

@avivkeller
MemberAuthor

Can you link that? I thought they vetoed translating the docs themselves, (the files in core), not the strings we use to generate them (the files here).

While we can't provide fully translated docs, we can at least translate some of the commonly used phrases (I.e. "Source Code: ", "Added in: ", etc.)

self-assigned this
on May 27, 2025
AugustinMauroy

AugustinMauroy commented on May 27, 2025

@AugustinMauroy
Member
avivkeller

avivkeller commented on May 28, 2025

@avivkeller
Author
ovflowd

ovflowd commented on May 28, 2025

@ovflowd
Member

The TSC vettoed translation for the API docs. Navigation cues (and other common strings) should be translateable. Unfortunately due to the nature of API docs, these need to be purely on the client-side. In other words the "content" should not be translated, but anything that is layout/component should be translateable.

Meaning:

  • Static generated JSON files part of the JS bundle
  • React does a client-side switch (and stores translation key on a local storage)
  • next-intl also works that way on a client-side-only mode; But since we don't use Next.js here, we gotta use use-intl (https://www.npmjs.com/package/use-intl) which is the underlying core of next-intl
flakey5

flakey5 commented on May 29, 2025

@flakey5
Member

Just confirming- we can do this on the client side w/o requiring js to run in the client's browser, correct?

ovflowd

ovflowd commented on May 29, 2025

@ovflowd
Member

Just confirming- we can do this on the client side w/o requiring js to run in the client's browser, correct?

wdym? React is client side JavaScript running on the Client-Side browser.

flakey5

flakey5 commented on May 29, 2025

@flakey5
Member

wdym? React is client side JavaScript running on the Client-Side browser.

Re nodejs/node#52343 (comment)

ovflowd

ovflowd commented on May 29, 2025

@ovflowd
Member

wdym? React is client side JavaScript running on the Client-Side browser.

Re nodejs/node#52343 (comment)

Ah yes, then it just goes to English :)

8 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ovflowd@avivkeller@flakey5@AugustinMauroy

        Issue actions

          Use i18n for common strings · Issue #280 · nodejs/doc-kit