react-intl 4.1.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/formatters/message.js +3 -2
- package/dist/react-intl.js +2 -2
- package/dist/react-intl.js.map +1 -1
- package/dist/react-intl.min.js +1 -1
- package/dist/react-intl.min.js.map +1 -1
- package/lib/formatters/message.js +3 -2
- package/package.json +1 -1
- package/src/formatters/message.ts +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [4.1.1](https://github.com/formatjs/react-intl/compare/v4.1.0...v4.1.1) (2020-03-06)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* dont warn if locale is the same as defaultLocale ([c8b178b](https://github.com/formatjs/react-intl/commit/c8b178b1e825b3e1abc2417c3ec60d92ab1911f6)), closes [#1594](https://github.com/formatjs/react-intl/issues/1594)
|
|
11
|
+
|
|
5
12
|
## [4.1.0](https://github.com/formatjs/react-intl/compare/v4.0.0...v4.1.0) (2020-03-05)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -71,10 +71,11 @@ function formatMessage(_a, state, messageDescriptor, values) {
|
|
|
71
71
|
(defaultMessage ? ', using default message as fallback.' : ''), e));
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
else
|
|
74
|
+
else if (!defaultMessage ||
|
|
75
|
+
(locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {
|
|
75
76
|
// This prevents warnings from littering the console in development
|
|
76
77
|
// when no `messages` are passed into the <IntlProvider> for the
|
|
77
|
-
// default locale
|
|
78
|
+
// default locale.
|
|
78
79
|
onError(new error_1.ReactIntlError("MISSING_TRANSLATION" /* MISSING_TRANSLATION */, "Missing message: \"" + id + "\" for locale: \"" + locale + "\"" +
|
|
79
80
|
(defaultMessage ? ', using default message as fallback.' : '')));
|
|
80
81
|
}
|
package/dist/react-intl.js
CHANGED
|
@@ -5630,10 +5630,10 @@
|
|
|
5630
5630
|
/* FORMAT_ERROR */
|
|
5631
5631
|
, "Error formatting message: \"".concat(id, "\" for locale: \"").concat(locale, "\"") + (defaultMessage ? ', using default message as fallback.' : ''), e));
|
|
5632
5632
|
}
|
|
5633
|
-
} else {
|
|
5633
|
+
} else if (!defaultMessage || locale && locale.toLowerCase() !== defaultLocale.toLowerCase()) {
|
|
5634
5634
|
// This prevents warnings from littering the console in development
|
|
5635
5635
|
// when no `messages` are passed into the <IntlProvider> for the
|
|
5636
|
-
// default locale
|
|
5636
|
+
// default locale.
|
|
5637
5637
|
onError(new ReactIntlError("MISSING_TRANSLATION"
|
|
5638
5638
|
/* MISSING_TRANSLATION */
|
|
5639
5639
|
, "Missing message: \"".concat(id, "\" for locale: \"").concat(locale, "\"") + (defaultMessage ? ', using default message as fallback.' : '')));
|