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.

intl-polyfill: show a warning for unknown locales

See original GitHub issue

_Edit: actual enhancement suggestion here: https://github.com/ember-intl/ember-intl/issues/573#issuecomment-390351334_


  • I am on the latest ember-intl version
  • I have searched the issues of this repo and believe that this is not a duplicate

Environment

  • Ember Version: Ember 2.18.2
  • Ember CLI Version: 2.18.2
  • Ember Intl Version: 2.33.2
  • Browser(s): n/a, build issue
  • Node Version: 8.10.0

Steps to Reproduce

ember build --environment=production

Using this config/ember-intl.js:

const env = require('./environment');
module.exports = function (environment) {
    return {
        locales: [
            "de-de",
            "el-gr",
            "en-au",
            "en-gb",
            "en-us",
            "no-no",
        ],
        baseLocale: null,
        autoPolyfill: true,
        disablePolyfill: false,
        publicOnly: true,
    };
};

dist/assets/intl/locales/no-no.js is not written to dist.

6 of the 37 locales in total are missed, but I condensed this code to show the general shape of the issue. Complete set of missing ones:

  • iw-il
  • no-no
  • vi-vi
  • zh-cn
  • zh-hk
  • zh-tw

I tried tracing in the node debugger, and I can see broccoli-cldr-data writing out a no.js file, but I am not sure what then takes that information and writes out the files in the dist/ folder.

I am willing to debug further, but need some pointers as to what to look for, and why a particular locale might be dropped.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jrburkecommented, May 21, 2018

I am still sorting through a solution, but I think I have something working where I modify the locales I set up in the config/ember-intl.js to match one that is in https://github.com/andyearnshaw/Intl.js/tree/master/locale-data/jsonp.

As for what to do for others, I can see generating a warning that mentions the mismatched locale, and a pointer to the list of locales in https://github.com/andyearnshaw/Intl.js/tree/master/locale-data/jsonp as the ones that are supported.

Suggesting a warning vs an error, since other locales could work, and in my situation, I still wanted to build/deploy for those other locales while I sorted out the problem ones. But I understand if generating an error would be preferred. Technically the build did not succeed with the given inputs.

0reactions
stale[bot]commented, Dec 19, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node: Cannot replace Intl to use IntlPolyfill - Stack Overflow
Because the Intl property of the global object is not writable (testing on Node 0.12.2): console.log(Object.getOwnPropertyDescriptor(global ...
Read more >
48 answers on StackOverflow to the most popular Angular ...
I just want to GET a JSON list and show it in the view. ... WARNING: This will import all 50+ operators and...
Read more >
How to Remove the Unknown Locale (QAA-LATN) Language
Your system may show the unknown locale (QAA-LATN) in the language ... Warning: Be very careful as editing the system's registry requires a ......
Read more >
polyfill-library | Yarn - Package Manager
Returns a Promise which resolves to an Object which contains the canonicalised feature definitions filtered for UA. polyfillLibrary.getPolyfillString(opts).
Read more >
Ubuntu 18.04: XAMPP 8.0.3 + Laravel 8.* + PHP 8.
Deprecation Notice + Unknown package has no name defined ... While trying to install Laravel 8, I got the following warning messages:.
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