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.
@@ -48,10 +48,11 @@ export function formatMessage({ locale, formats, messages, defaultLocale, defaul
48
48
  (defaultMessage ? ', using default message as fallback.' : ''), e));
49
49
  }
50
50
  }
51
- else {
51
+ else if (!defaultMessage ||
52
+ (locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {
52
53
  // This prevents warnings from littering the console in development
53
54
  // when no `messages` are passed into the <IntlProvider> for the
54
- // default locale, and a default message is in the source.
55
+ // default locale.
55
56
  onError(new ReactIntlError("MISSING_TRANSLATION" /* MISSING_TRANSLATION */, `Missing message: "${id}" for locale: "${locale}"` +
56
57
  (defaultMessage ? ', using default message as fallback.' : '')));
57
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-intl",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.",
5
5
  "keywords": [
6
6
  "intl",
@@ -159,10 +159,13 @@ export function formatMessage<T>(
159
159
  )
160
160
  );
161
161
  }
162
- } else {
162
+ } else if (
163
+ !defaultMessage ||
164
+ (locale && locale.toLowerCase() !== defaultLocale.toLowerCase())
165
+ ) {
163
166
  // This prevents warnings from littering the console in development
164
167
  // when no `messages` are passed into the <IntlProvider> for the
165
- // default locale, and a default message is in the source.
168
+ // default locale.
166
169
  onError(
167
170
  new ReactIntlError(
168
171
  ReactIntlErrorCode.MISSING_TRANSLATION,