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

src: initial localization support (work in progress) #3413

Closed
wants to merge 1 commit into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Oct 17, 2015

This is a work in progress effort to introduce the optional
ability to localize node's own outputs. Currently, Node (and V8)
outputs english only error, debug and help output. This is a step
towards allowing translated versions of node to be built.

Currently, this is hidden behind the --with-intl=full-icu switch.
This is because there are certain capabilities of ICU that are
only enabled with the full data set.

This is a work in progress that SHOULD NOT BE LANDED in master yet.

/cc @srl295 @mhdawson

@jasnell jasnell added the wip Issues and PRs that are still a work in progress. label Oct 17, 2015
@jasnell jasnell changed the title src: initial localization support src: initial localization support (work in progress) Oct 17, 2015
This is a work in progress effort to introduce the *optional*
ability to localize node's own outputs. Currently, Node (and V8)
outputs english only error, debug and help output. This is a step
towards allowing translated versions of node to be built.

Currently, this is hidden behind the --with-intl=full-icu switch.
This is because there are certain capabilities of ICU that are
only enabled with the full data set.

This is a work in progress that SHOULD NOT BE LANDED in master yet.
@mscdex mscdex added the i18n-api Issues and PRs related to the i18n implementation. label Oct 17, 2015
@kkoopa
Copy link

kkoopa commented Oct 20, 2015

The good thing about having only one language is that you can search the Internet for error messages and triage bug reports from users and such. It can already be difficult when errors come from the operating system With internationalization comes the need for some sort of identifier being printed for each message, so that one may know what that message actually is, but that also requires a lookup table for identifiers to their original messages. Does this functionality exist in ICU?

@jasnell
Copy link
Member Author

jasnell commented Oct 20, 2015

ICU provides the message bundle mechanism. We would provide the actual lookup. It's not yet implemented within this PR, but my intent is to include the message identifier whenever a localized message is output. I was then planning to implement a simple userland utility installable from npm that would explain every error code with a localized description. e.g. something like...

$ npm install -g nexp
$ nexp NODE_ERR_001
...description printed here...

@kkoopa
Copy link

kkoopa commented Oct 20, 2015

That sounds like a good plan. Just thought I'd mention this concern, but it is good that it has already been thought of.

On October 20, 2015 7:47:12 PM GMT+03:00, James M Snell notifications@github.com wrote:

ICU provides the message bundle mechanism. We would provide the actual
lookup. It's not yet implemented within this PR, but my intent is to
include the message identifier whenever a localized message is output.
I was then planning to implement a simple userland utility installable
from npm that would explain every error code with a localized
description. e.g. something like...

$ npm install -g nexp
$ nexp NODE_ERR_001
...description printed here...

Reply to this email directly or view it on GitHub:
#3413 (comment)

@jasnell jasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Oct 21, 2015
@rvagg
Copy link
Member

rvagg commented Oct 21, 2015

Quick comment while I'm scanning the code -- maybe the l10n directory should be in the root rather than deps which are mostly things that are external and we don't normally touch unless we get upstream updates. Unless the intention is for l10n to exist in a separate repo and actually be a proper dep (might be a good idea!)?

@jasnell
Copy link
Member Author

jasnell commented Oct 21, 2015

Yep, that will need to be worked out. One of the reasons I put it into deps is because of the optional ICU dependency. If ICU is not included in the build, the l10n dep is not built and linked in. However, because of the need for keeping the messages in sync with the source, having it out as a dependency doesn't make the most sense in the long run. As I said on the TC call, we need to figure out the "least annoying" way to set this up.

As an aside: right now ICU support is still optional in the build by default. It may be time to revisit that and make ICU build by default (e.g. make --with-intl=small-icu a default.

@jasnell jasnell closed this Jan 8, 2016
bnoordhuis added a commit to bnoordhuis/io.js that referenced this pull request Jul 22, 2022
Original commit log follows:

darwin: translate EPROTOTYPE to ECONNRESET (nodejs#3413)

macOS versions 10.10 and 10.15 - and presumbaly 10.11 to 10.14, too -
have a bug where a race condition causes the kernel to return EPROTOTYPE
because the socket isn't fully constructed.

It's probably the result of the peer closing the connection and that is
why libuv translates it to ECONNRESET.

Previously, libuv retried until the EPROTOTYPE error went away but some
VPN software causes the same behavior except the error is permanent, not
transient, turning the retry mechanism into an infinite loop.

Refs: libuv/libuv#482
Refs: libuv/libuv#3405
Fixes: nodejs#43916
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-api Issues and PRs related to the i18n implementation. semver-major PRs that contain breaking changes and should be released in the next major version. wip Issues and PRs that are still a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants