guigrpa / mady

An easy-to-use tool to manage and translate ICU MessageFormat messages
MIT License
90 stars 11 forks source link

MessageFormat translations resulting in warning messages #32

Open fidelpita opened 4 years ago

fidelpita commented 4 years ago

When using MessageFormat translations such as: console.log(_t("someContext_{NUM, plural, one{1 hamburger} other{# hamburgers}}", { NUM: 2 })); the following warning is generated: Expected '===' and instead saw '==' at the following return line:

var es = function(n, ord) {
  if (ord) return 'other';
  return (n == 1) ? 'one' : 'other';
};

Perhaps the messageformat dependency needs to be updated? Context: using the latest version of create-react-app