mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 00:39:49 +00:00
fixed translations
This commit is contained in:
parent
c59cced54b
commit
324b1628f6
@ -147,7 +147,10 @@ export const BrowseStep = ({
|
||||
<Breadcrumbs
|
||||
onChangeFolder={onChangeFolder}
|
||||
as="nav"
|
||||
label="hello"
|
||||
label={formatMessage({
|
||||
id: getTrad('header.breadcrumbs.nav.label'),
|
||||
defaultMessage: 'Folders navigation',
|
||||
})}
|
||||
breadcrumbs={breadcrumbs}
|
||||
currentFolderId={queryObject?.folder}
|
||||
/>
|
||||
|
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import { useIntl } from 'react-intl';
|
||||
|
||||
import {
|
||||
Crumb,
|
||||
@ -10,7 +11,10 @@ import {
|
||||
import { CrumbSimpleMenuAsync } from './CrumbSimpleMenuAsync';
|
||||
import { BreadcrumbsDefinition } from '../../constants';
|
||||
|
||||
export const Breadcrumbs = ({ breadcrumbs, onChangeFolder, currentFolderId, ...props }) => (
|
||||
export const Breadcrumbs = ({ breadcrumbs, onChangeFolder, currentFolderId, ...props }) => {
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
return (
|
||||
<BaseBreadcrumbs {...props}>
|
||||
{breadcrumbs.map((crumb, index) => {
|
||||
if (Array.isArray(crumb)) {
|
||||
@ -37,7 +41,7 @@ export const Breadcrumbs = ({ breadcrumbs, onChangeFolder, currentFolderId, ...p
|
||||
to={onChangeFolder ? undefined : crumb.href}
|
||||
onClick={onChangeFolder && (() => onChangeFolder(crumb.id))}
|
||||
>
|
||||
{crumb.label}
|
||||
{crumb.label?.id ? formatMessage(crumb.label) : crumb.label}
|
||||
</CrumbLink>
|
||||
);
|
||||
}
|
||||
@ -47,12 +51,13 @@ export const Breadcrumbs = ({ breadcrumbs, onChangeFolder, currentFolderId, ...p
|
||||
key={`breadcrumb-${crumb?.id ?? 'root'}`}
|
||||
isCurrent={index + 1 === breadcrumbs.length}
|
||||
>
|
||||
{crumb.label}
|
||||
{crumb.label?.id ? formatMessage(crumb.label) : crumb.label}
|
||||
</Crumb>
|
||||
);
|
||||
})}
|
||||
</BaseBreadcrumbs>
|
||||
);
|
||||
};
|
||||
|
||||
Breadcrumbs.defaultProps = {
|
||||
currentFolderId: undefined,
|
||||
|
@ -1,8 +1,10 @@
|
||||
import getTrad from './getTrad';
|
||||
|
||||
const getBreadcrumbDataML = folder => {
|
||||
let data = [
|
||||
{
|
||||
id: null,
|
||||
label: 'Media Library',
|
||||
label: { id: getTrad('plugin.name'), defaultMessage: 'MediaLibrary' },
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
import getTrad from './getTrad';
|
||||
import getFolderURL from './getFolderURL';
|
||||
|
||||
const getBreadcrumbDataML = (folder, { pathname, query }) => {
|
||||
let data = [
|
||||
{
|
||||
id: null,
|
||||
label: 'Media Library',
|
||||
label: { id: getTrad('plugin.name'), defaultMessage: 'MediaLibrary' },
|
||||
href: folder ? getFolderURL(pathname, query) : undefined,
|
||||
},
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user