feat: translations support

This commit is contained in:
Markos Gogoulos
2024-10-04 13:17:40 +03:00
committed by GitHub
parent ef4067cbdd
commit 4992cc425c
84 changed files with 2303 additions and 161 deletions

View File

@@ -6,6 +6,8 @@ import { PageActions, MediaPageActions } from '../../utils/actions/';
import { formatInnerLink, publishedOnDate } from '../../utils/helpers/';
import { PopupMain } from '../_shared/';
import CommentsList from '../comments/Comments';
import { replaceString } from '../../utils/helpers/';
import { translateString } from '../../utils/helpers/';
function metafield(arr) {
let i;
@@ -48,7 +50,7 @@ function MediaAuthorBanner(props) {
</a>
</span>
{PageStore.get('config-media-item').displayPublishDate && props.published ? (
<span className="author-banner-date">Published on {publishedOnDate(new Date(props.published))}</span>
<span className="author-banner-date">{translateString("Published on")} {replaceString(publishedOnDate(new Date(props.published)))}</span>
) : null}
</div>
</div>
@@ -76,8 +78,8 @@ function EditMediaButton(props) {
}
return (
<a href={link} rel="nofollow" title="Edit media" className="edit-media">
EDIT MEDIA
<a href={link} rel="nofollow" title={translateString("Edit media")} className="edit-media">
{translateString("EDIT MEDIA")}
</a>
);
}
@@ -90,8 +92,8 @@ function EditSubtitleButton(props) {
}
return (
<a href={link} rel="nofollow" title="Edit subtitle" className="edit-subtitle">
EDIT SUBTITLE
<a href={link} rel="nofollow" title={translateString("Edit subtitle")} className="edit-subtitle">
{translateString("EDIT SUBTITLE")}
</a>
);
}
@@ -195,12 +197,12 @@ export default function ViewerInfoContent(props) {
</button>
) : null}
{tagsContent.length ? (
<MediaMetaField value={tagsContent} title={1 < tagsContent.length ? 'Tags' : 'Tag'} id="tags" />
<MediaMetaField value={tagsContent} title={1 < tagsContent.length ? translateString('Tags') : translateString('Tag')} id="tags" />
) : null}
{categoriesContent.length ? (
<MediaMetaField
value={categoriesContent}
title={1 < categoriesContent.length ? 'Categories' : 'Category'}
title={1 < categoriesContent.length ? translateString('Categories') : translateString('Category')}
id="categories"
/>
) : null}
@@ -215,7 +217,7 @@ export default function ViewerInfoContent(props) {
) : null}
<PopupTrigger contentRef={popupContentRef}>
<button className="remove-media">DELETE MEDIA</button>
<button className="remove-media">{translateString("DELETE MEDIA")}</button>
</PopupTrigger>
<PopupContent contentRef={popupContentRef}>