question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Node only supports English by default

See original GitHub issue

Test code:

let formatMessage = require("format-message")
formatMessage("{d, date, long}", {d: new Date()}, "ru-RU")

Expected Result: 25 июня 2017 г. Actual Result (Node v8.0): 2017 M06 25

On Node v7.9.0 it gives wrong result too (but at least month is printed (in other language ofc)): June 25, 2017

Moment works fine meanwhile

> moment().locale('ru-RU').format('LL')
< '25 июня 2017 г.'

Seems it’s nodejs problem, so may be use external library for a time?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
TimothyGucommented, Jun 25, 2017

but node should detect this package after I copied this file!

The message is a bug on full-icu’s side: autodetection has not been implemented in Node.js. See https://github.com/unicode-org/full-icu-npm/issues/6 and my PR to help clarify that: https://github.com/unicode-org/full-icu-npm/pull/15.

Sorry about the confusion! I was fairly confused as well when I first used the full-icu package 😄

0reactions
vanwagonetcommented, Sep 16, 2017

It sounds like all that needs to be done here is to document that node internationalization support requires special steps depending on the locales you want to use.

Would a note and a link to https://nodejs.org/api/intl.html be sufficient for this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Internationalization support | Node.js v19.3.0 Documentation
The full ICU data set is provided by Node.js by default. ... includes a subset of ICU data (typically only the English locale)...
Read more >
How can I get the browser language in node.js (express.js)?
You can use req.headers["accept-language"] to get the language/locale the user has set in his browser. For easier support, you may want to ...
Read more >
Node.js Tutorial on Creating a Multilingual Web App | Phrase
So far, our server only supports two languages. If you use languages that are not supported, it will default to English.
Read more >
fallback to default language when node not translated ... - Drupal
However the prefaces are currently in German and English, but are not translated to French yet. So if I set the node languages...
Read more >
Available node language only English - Drupal Answers
That is because you have Set custom language as default for new content. (and the current one as the default). If you want...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found