Render FormattedMessage translations into React.Fragment by default (#38398)
This commit is contained in:
@@ -137,11 +137,7 @@ const preview: Preview = {
|
|||||||
}, [currentLocale, currentLocaleData]);
|
}, [currentLocale, currentLocaleData]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<IntlProvider
|
<IntlProvider locale={currentLocale} messages={currentLocaleData}>
|
||||||
locale={currentLocale}
|
|
||||||
messages={currentLocaleData}
|
|
||||||
textComponent='span'
|
|
||||||
>
|
|
||||||
<Story />
|
<Story />
|
||||||
</IntlProvider>
|
</IntlProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useState, useCallback, useRef, useId, Fragment } from 'react';
|
import { useState, useCallback, useRef, useId } from 'react';
|
||||||
|
|
||||||
import { FormattedMessage, useIntl } from 'react-intl';
|
import { FormattedMessage, useIntl } from 'react-intl';
|
||||||
|
|
||||||
@@ -84,7 +84,6 @@ export const AltTextBadge: React.FC<{ description: string }> = ({
|
|||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='alt_text_badge.title'
|
id='alt_text_badge.title'
|
||||||
defaultMessage='Alt text'
|
defaultMessage='Alt text'
|
||||||
tagName={Fragment}
|
|
||||||
/>
|
/>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Fragment, useCallback, useRef, useState } from 'react';
|
import { useCallback, useRef, useState } from 'react';
|
||||||
|
|
||||||
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
||||||
|
|
||||||
@@ -100,14 +100,12 @@ const RevokeControls: React.FC<{
|
|||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='collections.detail.accept_inclusion'
|
id='collections.detail.accept_inclusion'
|
||||||
defaultMessage='Okay'
|
defaultMessage='Okay'
|
||||||
tagName={Fragment}
|
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button secondary onClick={confirmRevoke}>
|
<Button secondary onClick={confirmRevoke}>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='collections.detail.revoke_inclusion'
|
id='collections.detail.revoke_inclusion'
|
||||||
defaultMessage='Remove me'
|
defaultMessage='Remove me'
|
||||||
tagName={Fragment}
|
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -143,7 +141,6 @@ const SensitiveScreen: React.FC<{
|
|||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='content_warning.show'
|
id='content_warning.show'
|
||||||
defaultMessage='Show anyway'
|
defaultMessage='Show anyway'
|
||||||
tagName={Fragment}
|
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -205,7 +202,6 @@ export const CollectionAccountsList: React.FC<{
|
|||||||
values={{
|
values={{
|
||||||
author: <SimpleAuthorName id={collection.account_id} />,
|
author: <SimpleAuthorName id={collection.account_id} />,
|
||||||
}}
|
}}
|
||||||
tagName={Fragment}
|
|
||||||
/>
|
/>
|
||||||
</h3>
|
</h3>
|
||||||
<Article
|
<Article
|
||||||
@@ -231,7 +227,6 @@ export const CollectionAccountsList: React.FC<{
|
|||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='collections.detail.other_accounts_in_collection'
|
id='collections.detail.other_accounts_in_collection'
|
||||||
defaultMessage='Others in this collection:'
|
defaultMessage='Others in this collection:'
|
||||||
tagName={Fragment}
|
|
||||||
/>
|
/>
|
||||||
</h3>
|
</h3>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Fragment, useCallback, useMemo } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
|
|
||||||
import { FormattedMessage, useIntl } from 'react-intl';
|
import { FormattedMessage, useIntl } from 'react-intl';
|
||||||
|
|
||||||
@@ -413,7 +413,6 @@ const LanguageField: React.FC = () => {
|
|||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='collections.collection_language_none'
|
id='collections.collection_language_none'
|
||||||
defaultMessage='None'
|
defaultMessage='None'
|
||||||
tagName={Fragment}
|
|
||||||
/>
|
/>
|
||||||
</option>
|
</option>
|
||||||
{languages?.map(([code, name, localName]) => (
|
{languages?.map(([code, name, localName]) => (
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ export const IntlProvider: React.FC<
|
|||||||
locale={locale}
|
locale={locale}
|
||||||
messages={messages}
|
messages={messages}
|
||||||
onError={onProviderError}
|
onError={onProviderError}
|
||||||
textComponent='span'
|
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
Reference in New Issue
Block a user