formatjs / formatjs-old

The monorepo home to all of the FormatJS related libraries.
https://formatjs.io/
156 stars 53 forks source link

plural - IE 11 #178

Closed sapottier closed 5 years ago

sapottier commented 5 years ago

Which package? "intl-messageformat": "^7.2.1"

Describe the bug IE11 return an error like "can't bind property 'bind' of null" it works with chrome (sorry for approximation. IE translate it in french...)

To Reproduce const translation = '{itemCount, plural, =0 {no items} one {1 item} other {{itemCount} items}}' new IntlMessageFormat(translation, local).format(variable);

the line below works const translation = '{itemCount} items'

Expected behavior A clear and concise description of what you expected to happen.

longlho commented 5 years ago

Did you polyfill Intl.PluralRules? We have @formatjs/intl-pluralrules to polyfill

On Tue, Sep 10, 2019 at 3:13 AM Simon-Adam Pottier notifications@github.com wrote:

Which package? "intl-messageformat": "^7.2.1"

Describe the bug IE11 return an error like "can't bind property 'bind' of null" it works with chrome (sorry for approximation. IE translate it in french...)

To Reproduce const translation = '{itemCount, plural, =0 {no items} one {1 item} other {{itemCount} items}}' new IntlMessageFormat(translation, local).format(variable);

Expected behavior A clear and concise description of what you expected to happen.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/formatjs/formatjs/issues/178?email_source=notifications&email_token=AABQM32NZX3ND75NHJEU6WTQI5CKBA5CNFSM4IVD3QJKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKLS5UQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AABQM333UGXHMOT5QYKRVE3QI5CKBANCNFSM4IVD3QJA .

sapottier commented 5 years ago

Considering documentation, I don't need it ?

This package assumes that the Intl global object exists in the runtime. Intl is present in all modern browsers (IE11+) and Node (with full ICU). The Intl methods we rely on are:

longlho commented 5 years ago

The global Intl object is available in IE11 but not all Intl APIs are.

On Tue, Sep 10, 2019 at 7:36 AM Simon-Adam Pottier notifications@github.com wrote:

Considering documentation, I don't need it ?

This package assumes that the Intl global object exists in the runtime. Intl is present in all modern browsers (IE11+) and Node (with full ICU). The Intl methods we rely on are:

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/formatjs/formatjs/issues/178?email_source=notifications&email_token=AABQM33HE4CJ6TTS3Y6H7N3QI6BC5A5CNFSM4IVD3QJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6KYZRI#issuecomment-529894597, or mute the thread https://github.com/notifications/unsubscribe-auth/AABQM3YRUAKJG6XMZLBE2M3QI6BC5ANCNFSM4IVD3QJA .

sapottier commented 5 years ago

My bad... Thank you it works :) (maybe the documentation need some clarification) (sorry for my english)

longlho commented 5 years ago

PR to improve doc is always welcome :)