fix: ja locale labels (#3367)

This commit is contained in:
Erez Rokah 2020-03-05 16:35:24 +01:00 committed by GitHub
parent 39f1307e3a
commit 50837b0068
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 175 additions and 23 deletions

View File

@ -128,6 +128,7 @@ class Workflow extends Component {
handlePublish={publishUnpublishedEntry}
handleDelete={deleteUnpublishedEntry}
isOpenAuthoring={isOpenAuthoring}
collections={collections}
/>
</WorkflowContainer>
);

View File

@ -118,7 +118,7 @@ const CardDate = translate()(({ t, date, author }) => {
});
const WorkflowCard = ({
collectionName,
collectionLabel,
title,
authorLastChange,
body,
@ -132,7 +132,7 @@ const WorkflowCard = ({
}) => (
<WorkflowCardContainer>
<WorkflowLink to={editLink}>
<CardCollection>{collectionName}</CardCollection>
<CardCollection>{collectionLabel}</CardCollection>
<CardTitle>{title}</CardTitle>
{(timestamp || authorLastChange) && <CardDate date={timestamp} author={authorLastChange} />}
<CardBody>{body}</CardBody>
@ -153,7 +153,7 @@ const WorkflowCard = ({
);
WorkflowCard.propTypes = {
collectionName: PropTypes.string.isRequired,
collectionLabel: PropTypes.string.isRequired,
title: PropTypes.string,
authorLastChange: PropTypes.string,
body: PropTypes.string,

View File

@ -134,6 +134,7 @@ class WorkflowList extends React.Component {
handleDelete: PropTypes.func.isRequired,
t: PropTypes.func.isRequired,
isOpenAuthoring: PropTypes.bool,
collections: ImmutablePropTypes.orderedMap,
};
handleChangeStatus = (newStatus, dragProps) => {
@ -161,7 +162,7 @@ class WorkflowList extends React.Component {
// eslint-disable-next-line react/display-name
renderColumns = (entries, column) => {
const { isOpenAuthoring } = this.props;
const { isOpenAuthoring, collections, t } = this.props;
if (!entries) return null;
if (!column) {
@ -202,35 +203,40 @@ class WorkflowList extends React.Component {
return (
<div>
{entries.map(entry => {
const timestamp = moment(entry.getIn(['metaData', 'timeStamp'])).format('MMMM D');
const timestamp = moment(entry.getIn(['metaData', 'timeStamp'])).format(
t('workflow.workflow.dateFormat'),
);
const slug = entry.get('slug');
const editLink = `collections/${entry.getIn(['metaData', 'collection'])}/entries/${slug}`;
const ownStatus = entry.getIn(['metaData', 'status']);
const collection = entry.getIn(['metaData', 'collection']);
const collectionName = entry.getIn(['metaData', 'collection']);
const collectionLabel = collections
?.find(collection => collection.get('name') === collectionName)
?.get('label');
const isModification = entry.get('isModification');
const canPublish = ownStatus === status.last() && !entry.get('isPersisting', false);
return (
<DragSource
namespace={DNDNamespace}
key={`${collection}-${slug}`}
key={`${collectionName}-${slug}`}
slug={slug}
collection={collection}
collection={collectionName}
ownStatus={ownStatus}
>
{connect =>
connect(
<div>
<WorkflowCard
collectionName={collection}
collectionLabel={collectionLabel || collectionName}
title={entry.get('label') || entry.getIn(['data', 'title'])}
authorLastChange={entry.getIn(['metaData', 'user'])}
body={entry.getIn(['data', 'body'])}
isModification={isModification}
editLink={editLink}
timestamp={timestamp}
onDelete={this.requestDelete.bind(this, collection, slug, ownStatus)}
onDelete={this.requestDelete.bind(this, collectionName, slug, ownStatus)}
canPublish={canPublish}
onPublish={this.requestPublish.bind(this, collection, slug, ownStatus)}
onPublish={this.requestPublish.bind(this, collectionName, slug, ownStatus)}
/>
</div>,
)

View File

@ -125,6 +125,14 @@ const cs = {
unknownPreview: {
noPreview: "Žádný náhled pro widget '%{widget}'.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -190,6 +198,7 @@ const cs = {
newPost: 'Nový post',
description:
'%{smart_count} záznam čeká na schválení, %{readyCount} připraven k publikaci. |||| %{smart_count} čeká na schválení, %{readyCount} připraveno k publikaci. ',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date} (%{author})',

View File

@ -133,6 +133,14 @@ const de = {
unknownPreview: {
noPreview: "Keine Vorschau für Widget '%{widget}'.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -199,6 +207,7 @@ const de = {
newPost: 'Neuer Beitrag',
description:
'%{smart_count} Beitrag zur Überprüfung bereit, %{readyCount} bereit zur Veröffentlichung. |||| %{smart_count} Beiträge zur Überprüfung bereit, %{readyCount} bereit zur Veröffentlichung. ',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date} von %{author}',

View File

@ -133,6 +133,14 @@ const en = {
unknownPreview: {
noPreview: "No preview for widget '%{widget}'.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -201,6 +209,7 @@ const en = {
newPost: 'New Post',
description:
'%{smart_count} entry waiting for review, %{readyCount} ready to go live. |||| %{smart_count} entries waiting for review, %{readyCount} ready to go live. ',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date} by %{author}',

View File

@ -109,6 +109,14 @@ const es = {
unknownPreview: {
noPreview: "No existe una vista previa para el widget '%{widget}'.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -172,6 +180,7 @@ const es = {
newPost: 'Nuevo artículo',
description:
'%{smart_count} entrada esperando revisión, %{readyCount} lista para publicar |||| %{smart_count} entradas esperando revisión, %{readyCount} listas para publicar. ',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date} por %{author}',

View File

@ -108,6 +108,14 @@ const fr = {
unknownPreview: {
noPreview: "Pas d'aperçu pour le gadget '%{widget}'.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -171,6 +179,7 @@ const fr = {
newPost: 'Nouvel article',
description:
'%{smart_count} entrée en attente de revue, %{readyCount} prête(s) à être publiée(s). |||| %{smart_count} entrées en attente de revue, %{readyCount} prête(s) à être publiée(s). ',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date} par %{author}',

View File

@ -130,6 +130,14 @@ const gr = {
unknownPreview: {
noPreview: "Δεν υπάρχει προεπισκόπηση για το widget '%{widget}'.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -197,6 +205,7 @@ const gr = {
newPost: 'Νέα δημοσίευση',
description:
'%{smart_count} καταχώρησεις σε αναμονή για αναθεώρηση, %{readyCount} έτοιμες για Live μετάβαση. |||| %{smart_count} καταχωρήσεις σε αναμονή για αναθεώρηση, %{readyCount} έτοιμες για Live μετάβαση. ',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date} από %{author}',

View File

@ -114,6 +114,14 @@ const hu = {
unknownPreview: {
noPreview: "Nincs előnézet a '%{widget}' widget számára.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -178,6 +186,7 @@ const hu = {
newPost: 'New Post',
description:
'%{smart_count} bejegyzés felülvizsgálatra vár, %{readyCount} élesítésre vár. |||| %{smart_count} bejegyzés felülvizsgálatra vár, %{readyCount} élesítésre vár. ',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date}, írta %{author}',

View File

@ -127,6 +127,14 @@ const it = {
unknownPreview: {
noPreview: "Nessuna preview per il widget '%{widget}'.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -194,6 +202,7 @@ const it = {
newPost: 'Nuovo Post',
description:
'%{smart_count} voce attende la revisione, %{readyCount} pronte per la pubblicazione. |||| %{smart_count} voci attendono la revisione, %{readyCount} pronte per la pubblicazione. ',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date} da %{author}',

View File

@ -17,7 +17,7 @@ const ja = {
header: {
content: 'コンテンツ',
workflow: 'ワークフロー',
media: 'データ',
media: 'メディア',
quickAdd: '新規作成',
},
app: {
@ -49,7 +49,7 @@ const ja = {
editor: {
editorControl: {
field: {
optional: 'オプショナル',
optional: '任意',
},
},
editorControlPane: {
@ -130,6 +130,14 @@ const ja = {
unknownPreview: {
noPreview: "'%{widget}'のウィジェットにはプレビューがありません。",
},
headingOptions: {
headingOne: '見出し 1',
headingTwo: '見出し 2',
headingThree: '見出し 3',
headingFour: '見出し 4',
headingFive: '見出し 5',
headingSix: '見出し 6',
},
},
},
mediaLibrary: {
@ -193,6 +201,7 @@ const ja = {
workflowHeading: 'ワークフロー',
newPost: '新規作成',
description: '%{smart_count}件がレビュー中、%{readyCount}件が準備完了です。',
dateFormat: 'M月D日',
},
workflowCard: {
lastChange: '%{author}が%{date}に更新',

View File

@ -136,6 +136,14 @@ const nl = {
unknownPreview: {
noPreview: "Geen voorvertoning voor widget '%{widget}'.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -199,6 +207,7 @@ const nl = {
newPost: 'Nieuw bericht',
description:
'%{smart_count} item wacht op beoordeling, %{readyCount} klaar om live te gaan. |||| %{smart_count} items wachten op beoordeling, %{readyCount} klaar om live te gaan. ',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date} door %{author}',

View File

@ -127,6 +127,14 @@ const pl = {
unknownPreview: {
noPreview: "Brak podglądu dla widżetu '%{widget}'.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -192,6 +200,7 @@ const pl = {
newPost: 'Nowa pozycja',
description:
'%{smart_count} pozycja oczekuje na recenzję, %{readyCount} oczekuje na publikacje. |||| %{smart_count} pozycje oczekują na recenzję, %{readyCount} oczekuje na publikacje. |||| %{smart_count} pozycji oczekuje na recenzje, %{readyCount} oczekuje na publikacje. ',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date} przez %{author}',

View File

@ -113,6 +113,14 @@ const pt = {
unknownPreview: {
noPreview: "Nenhuma pré-visualização para o widget '%{widget}'.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -178,6 +186,7 @@ const pt = {
newPost: 'Nova Publicação',
description:
'%{smart_count} entrada aguardando revisão, %{readyCount} pronta para publicação. |||| %{smart_count} entradas aguardando revisão, %{readyCount} pronta para publicação.',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date} por %{author}',

View File

@ -112,6 +112,14 @@ const ru = {
unknownPreview: {
noPreview: "Нет превью для виджета '%{widget}'.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -177,6 +185,7 @@ const ru = {
newPost: 'Новая запись',
description:
'Число записей, ожидающих проверки — %{smart_count}, готовых к публикации — %{readyCount}. |||| Число записей, ожидающих проверки — %{smart_count}, готовых к публикации — %{readyCount}. ',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date}, %{author}',

View File

@ -135,6 +135,14 @@ const tr = {
unknownPreview: {
noPreview: "'%{widget}' Widget için önizleme yok.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -199,6 +207,7 @@ const tr = {
newPost: 'Yeni Mesaj',
description:
'%{smart_count} girdi incelemeyi bekliyor, %{readyCount} yayına hazır. |||| %{smart_count} girdi incelemeyi bekliyor, %{readyCount} yayınlanmaya hazır. ',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date} tarafından %{author}',

View File

@ -108,6 +108,14 @@ const uk = {
unknownPreview: {
noPreview: "Відсутній перегляд для '%{widget}'.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -170,6 +178,7 @@ const uk = {
workflowHeading: 'Редакція',
newPost: 'Новий запис',
description: '%{smart_count} записів очікують розгляду, %{readyCount} готові до публікації. ',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date} від %{author}',

View File

@ -125,6 +125,14 @@ const zh_Hant = {
unknownPreview: {
noPreview: "無法預覽元件: '%{widget}'.",
},
headingOptions: {
headingOne: 'Heading 1',
headingTwo: 'Heading 2',
headingThree: 'Heading 3',
headingFour: 'Heading 4',
headingFive: 'Heading 5',
headingSix: 'Heading 6',
},
},
},
mediaLibrary: {
@ -189,6 +197,7 @@ const zh_Hant = {
newPost: '建立新的內容',
description:
'%{smart_count} 篇內容正在等待審核, %{readyCount} 篇已經準備進行發布。 |||| %{smart_count} 篇內容正在等待審核, %{readyCount} 篇已經準備進行發布。',
dateFormat: 'MMMM D',
},
workflowCard: {
lastChange: '%{date} by %{author}',

View File

@ -321,6 +321,7 @@ const components = {
display: flex;
justify-content: space-between;
align-items: center;
min-width: max-content;
&:last-of-type {
border-bottom: 0;

View File

@ -48,7 +48,7 @@ const ToolbarToggleLabel = styled.span`
text-align: center;
white-space: nowrap;
line-height: 20px;
width: ${props => (props.offPosition ? '62px' : '70px')};
min-width: ${props => (props.offPosition ? '62px' : '70px')};
${props =>
props.isActive &&
@ -58,15 +58,6 @@ const ToolbarToggleLabel = styled.span`
`};
`;
const headingOptions = {
'heading-one': 'Heading 1',
'heading-two': 'Heading 2',
'heading-three': 'Heading 3',
'heading-four': 'Heading 4',
'heading-five': 'Heading 5',
'heading-six': 'Heading 6',
};
export default class Toolbar extends React.Component {
static propTypes = {
buttons: ImmutablePropTypes.list,
@ -123,6 +114,15 @@ export default class Toolbar extends React.Component {
const showPlugin = ({ id }) => (editorComponents ? editorComponents.includes(id) : true);
const pluginsList = plugins ? plugins.toList().filter(showPlugin) : List();
const headingOptions = {
'heading-one': t('editor.editorWidgets.headingOptions.headingOne'),
'heading-two': t('editor.editorWidgets.headingOptions.headingTwo'),
'heading-three': t('editor.editorWidgets.headingOptions.headingThree'),
'heading-four': t('editor.editorWidgets.headingOptions.headingFour'),
'heading-five': t('editor.editorWidgets.headingOptions.headingFive'),
'heading-six': t('editor.editorWidgets.headingOptions.headingSix'),
};
return (
<ToolbarContainer>
<div>