small i18n fixes

This commit is contained in:
zeppi 2021-06-18 18:39:58 -04:00 committed by jessopb
parent fbcb740dc9
commit 13c2c8a9ab
5 changed files with 19 additions and 9 deletions

View file

@ -1988,5 +1988,11 @@
"Chat": "Chat",
"Tipped": "Tipped",
"Fromage": "Fromage",
"added to": "added to",
"Item %action% Watch Later": "Item %action% Watch Later",
"In Watch Later": "In Watch Later",
"Item added to Watch Later": "Item added to Watch Later",
"Your publish is being confirmed and will be live soon": "Your publish is being confirmed and will be live soon",
"Clear Edits": "Clear Edits",
"--end--": "--end--"
}

View file

@ -11,11 +11,11 @@ import {
selectUpdatingCollection,
selectCreateCollectionError,
selectBalance,
doClearCollectionErrors,
selectCreatingCollection,
makeSelectCollectionForId,
makeSelectUrlsForCollectionId,
makeSelectClaimIdsForCollectionId,
ACTIONS as LBRY_REDUX_ACTIONS,
} from 'lbry-redux';
import { doOpenModal } from 'redux/actions/app';
@ -47,7 +47,7 @@ const perform = (dispatch) => ({
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
publishCollectionUpdate: (params) => dispatch(doCollectionPublishUpdate(params)),
publishCollection: (params, collectionId) => dispatch(doCollectionPublish(params, collectionId)),
clearCollectionErrors: () => dispatch(doClearCollectionErrors()),
clearCollectionErrors: () => dispatch({ type: LBRY_REDUX_ACTIONS.CLEAR_COLLECTION_ERRORS }),
});
export default connect(select, perform)(CollectionPage);

View file

@ -21,6 +21,7 @@ import { INVALID_NAME_ERROR } from 'constants/claim';
import SUPPORTED_LANGUAGES from 'constants/supported_languages';
import * as PAGES from 'constants/pages';
import analytics from 'analytics';
import * as ICONS from '../../constants/icons';
const LANG_NONE = 'none';
const MAX_TAG_SELECT = 5;
@ -86,6 +87,7 @@ function CollectionForm(props: Props) {
collection,
collectionUrls,
collectionClaimIds,
clearCollectionErrors,
} = props;
const activeChannelName = activeChannelClaim && activeChannelClaim.name;
let prefix = IS_WEB ? `${DOMAIN}/` : 'lbry://';
@ -163,6 +165,7 @@ function CollectionForm(props: Props) {
React.useEffect(() => {
const collectionClaimIds = JSON.parse(collectionClaimIdsString);
setParams({ ...params, claims: collectionClaimIds });
clearCollectionErrors();
}, [collectionClaimIdsString, setParams]);
function handleLanguageChange(index, code) {
@ -228,12 +231,16 @@ function CollectionForm(props: Props) {
setParams({ ...params, channel_id: activeChannelId });
}
}, [activeChannelId, incognito, setParams]);
const itemError = !params.claims.length ? __('Cannot publish empty list') : '';
const submitError = nameError || bidError || itemError || updateError || createError;
return (
<>
<div className={classnames('main--contained', { 'card--disabled': disabled })}>
<div>
<Button button="close" label={__('New')} icon={ICONS.REFRESH} onClick={() => alert()} />
</div>
<Tabs>
<TabList className="tabs__list--collection-edit-page">
<Tab>{__('General')}</Tab>

View file

@ -66,7 +66,7 @@ export default function CollectionsListMine(props: Props) {
navigate={`/$/${PAGES.LIST}/${list.id}`}
label={
<span className="claim-grid__title-span">
{list.name}
{__(`${list.name}`)}
<div className="claim-grid__title--empty">
<Icon className="icon--margin-right" icon={ICONS.STACK} />
{itemUrls.length}
@ -80,7 +80,7 @@ export default function CollectionsListMine(props: Props) {
)}
{!(itemUrls && itemUrls.length) && (
<h1 className="claim-grid__header claim-grid__title">
{__('%collection_name%', { collection_name: list.name })}{' '}
{__(`${list.name}`)}
<div className="claim-grid__title--empty">(Empty)</div>
</h1>
)}

View file

@ -80,7 +80,7 @@ function SelectAsset(props: Props) {
}
// Note for translators: e.g. "Thumbnail (1:1)"
const label = __('%image_type% %recommended_ratio%', { image_type: assetName, recommended_ratio: recommended });
const label = `${__(assetName)} ${__(recommended)}`;
const selectFileLabel = __('Select File');
const selectedLabel = pathSelected ? __('URL Selected') : __('File Selected');
@ -89,10 +89,7 @@ function SelectAsset(props: Props) {
fileSelectorLabel = __('Uploading...');
} else {
// Include the same label/recommendation for both 'URL' and 'UPLOAD'.
fileSelectorLabel = __('%label% • %status%', {
label: label,
status: fileSelected || pathSelected ? selectedLabel : selectFileLabel,
});
fileSelectorLabel = `${label} ${fileSelected || pathSelected ? __(selectedLabel) : __(selectFileLabel)}`;
}
const formBody = (
<>