Giter VIP home page Giter VIP logo

Comments (2)

ijlee2 avatar ijlee2 commented on May 29, 2024 1

Hi, @gzurbach. Thanks for providing your feedback. The error message is coming from @formatjs/intl-messageformat.

For [email protected] and above, you can find the file addon/-private/utils/formatjs.ts in your node_modules folder. Then, you can patch this file (in particular, the function onFormatjsIntlError()) so that v6.x addresses your case:

export function onFormatjsIntlError(error: IntlError): void {
  switch (error.code) {
+     case IntlErrorCode.FORMAT_ERROR: {
+       // Do nothing
+       break;
+     }
+ 
    case IntlErrorCode.MISSING_TRANSLATION: {
      // Do nothing
      break;
    }

    default: {
      throw error;
    }
  }
}

If you are on a version between 6.1.0 and 6.4.1, you can find the corresponding code in addon/services/intl.js (i.e. patch this file instead). The error codes are briefly described in https://github.com/formatjs/formatjs/blob/%40formatjs/intl%402.10.1/website/docs/guides/develop.md#format_error.

I don't know yet what the default for error handling for 7.x will be, so I could only provide a temporary patch as a possible solution. :)

from ember-intl.

gzurbach avatar gzurbach commented on May 29, 2024 1

Thank you for your thorough response, @ijlee2. I appreciate it. I should clarify that I am currently running [email protected].

I prefer not to resort to cloning or branching the library for this particular issue. My intention in reaching out was more of a suggestion for potential inclusion in a future version of ember-intl.

The proposal:

  • For development builds: throw any FORMAT_ERROR.
  • For production builds: consider displaying a warning or gracefully ignoring the error.

Thank you for your consideration!

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.