globalizejs / globalizejs/globalize

When compiled for production, `Globalize.locale()` returns string

Open
#621 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.8k
Forks
585
PR merge metrics
No merged PRs in 30d

Description

If you add a `console.log(Globalize.locale())` in the `app-npm-webpack` example app (for example here https://github.com/jquery/globalize/blob/c6cd869fd5a6518eab0595503be85b6b29a7b43f/examples/app-npm-webpack/app/index.js#L3), you get different results in development and production.

In development you get a `Cldr` instance:

```
Cldr {ee: EventEmitter, attributes: Object, locale: "en"}
```

In production you only get a string:

```
en
```

I'm getting bitten by this in my own app (where I need to access the `attributes` field of the `Cldr` instance), and wanted to verify that the example app had the same problem.

@rxaviers what's your take? Am I missing something?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.