Giter Club home page Giter Club logo

Comments (7)

longlho avatar longlho commented on June 11, 2024 3

yeah you'd need to import en locale data as well. polyfill-force overrides the native implementation so for whichever locale you want you'd have to import those data separately

from ember-intl.

longlho avatar longlho commented on June 11, 2024 1

Ok then looks like u do need them all then but you should look into why. It's a bit odd that an app need to render multiple locales at the same time

from ember-intl.

longlho avatar longlho commented on June 11, 2024

You have to import polyfill-force

from ember-intl.

olenderhub avatar olenderhub commented on June 11, 2024

You have to import polyfill-force

Hello, thank you for reply.

With

import '@formatjs/intl-numberformat/polyfill-force';
import '@formatjs/intl-numberformat/locale-data/so';

I have a problem with:

Uncaught Error: [@formatjs/intl Error MISSING_DATA] Missing locale data for locale: "en-us" in Intl.NumberFormat. Using default locale: "en-us" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details 

(I don't use "en-us" language, in my folder I have en, es, ko, vi, zh, ar)

not sure why without polyfill-force it allows me to use en-us and with it not

from ember-intl.

olenderhub avatar olenderhub commented on June 11, 2024

@longlho thank you for help

with

import '@formatjs/intl-numberformat/polyfill-force';
import '@formatjs/intl-numberformat/locale-data/en';
import '@formatjs/intl-numberformat/locale-data/es';
import '@formatjs/intl-numberformat/locale-data/ar';
import '@formatjs/intl-numberformat/locale-data/ko';
import '@formatjs/intl-numberformat/locale-data/so';
import '@formatjs/intl-numberformat/locale-data/vi';
import '@formatjs/intl-numberformat/locale-data/zh';

import '@formatjs/intl-datetimeformat/polyfill-force'
import '@formatjs/intl-datetimeformat/locale-data/so';
import '@formatjs/intl-datetimeformat/locale-data/en';
import '@formatjs/intl-datetimeformat/locale-data/ar';
import '@formatjs/intl-datetimeformat/locale-data/es';
import '@formatjs/intl-datetimeformat/locale-data/ko';
import '@formatjs/intl-datetimeformat/locale-data/vi';
import '@formatjs/intl-datetimeformat/locale-data/zh';

this works to me :) (I forgot to write that also I had zh)

from ember-intl.

longlho avatar longlho commented on June 11, 2024

It's a lot of data so I'd recommend you load each locale conditionally

from ember-intl.

olenderhub avatar olenderhub commented on June 11, 2024

It's a lot of data, so I'd recommend you load each locale conditionally

Do you have an example of how to do it conditionally? In my app, when I remove any of these imports then I got an error at the beginning of the app (not sure why, because it looks like I need all of them at the beginning)

from ember-intl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.