Fix 'Favorites' string issue

Renamed variables for clarity while at it.

"Item added to %name%" is probably redundant due to toast passing through <i18nMessage>, causing a double translation.

Anyway, added all the resolved string for now to avoid them popping up in app-string during development.
This commit is contained in:
infinite-persistence 2021-08-10 00:35:36 +08:00
parent 9d663b3789
commit 19091f249a
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
3 changed files with 23 additions and 18 deletions

View file

@ -378,8 +378,6 @@
"Unfollow": "Unfollow", "Unfollow": "Unfollow",
"Follow @%channelName%": "Follow @%channelName%", "Follow @%channelName%": "Follow @%channelName%",
"Unfollow @%channelName%": "Unfollow @%channelName%", "Unfollow @%channelName%": "Unfollow @%channelName%",
"Item removed from %name%": "Item removed from %name%",
"Item added to %name%": "Item added to %name%",
"These LBRY Credits remain yours. It is a deposit to reserve the name and can be undone at any time.": "These LBRY Credits remain yours. It is a deposit to reserve the name and can be undone at any time.", "These LBRY Credits remain yours. It is a deposit to reserve the name and can be undone at any time.": "These LBRY Credits remain yours. It is a deposit to reserve the name and can be undone at any time.",
"Create channel": "Create channel", "Create channel": "Create channel",
"Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.": "Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.", "Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.": "Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.",
@ -2030,10 +2028,12 @@
"Remove from Watch Later": "Remove from Watch Later", "Remove from Watch Later": "Remove from Watch Later",
"Add to Watch Later": "Add to Watch Later", "Add to Watch Later": "Add to Watch Later",
"Added": "Added", "Added": "Added",
"Item removed from %name%": "Item removed from %name%",
"Item added to %name%": "Item added to %name%",
"Item added to Watch Later": "Item added to Watch Later", "Item added to Watch Later": "Item added to Watch Later",
"Item removed from Watch Later": "Item removed from Watch Later", "Item removed from Watch Later": "Item removed from Watch Later",
"Item added to %lastCollectionName%": "Item added to %lastCollectionName%", "Item added to Favorites": "Item added to Favorites",
"Item removed from %lastCollectionName%": "Item removed from %lastCollectionName%", "Item removed from Favorites": "Item removed from Favorites",
"Your publish is being confirmed and will be live soon": "Your publish is being confirmed and will be live soon", "Your publish is being confirmed and will be live soon": "Your publish is being confirmed and will be live soon",
"Clear Edits": "Clear Edits", "Clear Edits": "Clear Edits",
"Something not quite right..": "Something not quite right..", "Something not quite right..": "Something not quite right..",

View file

@ -46,8 +46,14 @@ const select = (state, props) => {
contentSigningChannel, contentSigningChannel,
contentChannelUri, contentChannelUri,
claimIsMine: makeSelectSigningIsMine(props.uri)(state), claimIsMine: makeSelectSigningIsMine(props.uri)(state),
hasClaimInWatchLater: makeSelectCollectionForIdHasClaimUrl(COLLECTIONS_CONSTS.WATCH_LATER_ID, contentPermanentUri)(state), hasClaimInWatchLater: makeSelectCollectionForIdHasClaimUrl(
hasClaimInCustom: makeSelectCollectionForIdHasClaimUrl(COLLECTIONS_CONSTS.FAVORITES_ID, contentPermanentUri)(state), COLLECTIONS_CONSTS.WATCH_LATER_ID,
contentPermanentUri
)(state),
hasClaimInFavorites: makeSelectCollectionForIdHasClaimUrl(
COLLECTIONS_CONSTS.FAVORITES_ID,
contentPermanentUri
)(state),
channelIsMuted: makeSelectChannelIsMuted(contentChannelUri)(state), channelIsMuted: makeSelectChannelIsMuted(contentChannelUri)(state),
channelIsBlocked: makeSelectChannelIsBlocked(contentChannelUri)(state), channelIsBlocked: makeSelectChannelIsBlocked(contentChannelUri)(state),
fileInfo: makeSelectFileInfoForUri(contentPermanentUri)(state), fileInfo: makeSelectFileInfoForUri(contentPermanentUri)(state),
@ -78,8 +84,7 @@ const perform = (dispatch) => ({
doChannelUnmute: (channelUri) => dispatch(doChannelUnmute(channelUri)), doChannelUnmute: (channelUri) => dispatch(doChannelUnmute(channelUri)),
doCommentModBlock: (channelUri) => dispatch(doCommentModBlock(channelUri)), doCommentModBlock: (channelUri) => dispatch(doCommentModBlock(channelUri)),
doCommentModUnBlock: (channelUri) => dispatch(doCommentModUnBlock(channelUri)), doCommentModUnBlock: (channelUri) => dispatch(doCommentModUnBlock(channelUri)),
doCommentModBlockAsAdmin: (commenterUri, blockerId) => doCommentModBlockAsAdmin: (commenterUri, blockerId) => dispatch(doCommentModBlockAsAdmin(commenterUri, blockerId)),
dispatch(doCommentModBlockAsAdmin(commenterUri, blockerId)),
doCommentModUnBlockAsAdmin: (commenterUri, blockerId) => doCommentModUnBlockAsAdmin: (commenterUri, blockerId) =>
dispatch(doCommentModUnBlockAsAdmin(commenterUri, blockerId)), dispatch(doCommentModUnBlockAsAdmin(commenterUri, blockerId)),
doChannelSubscribe: (subscription) => dispatch(doChannelSubscribe(subscription)), doChannelSubscribe: (subscription) => dispatch(doChannelSubscribe(subscription)),

View file

@ -12,7 +12,7 @@ import { useHistory } from 'react-router';
import { buildURI, parseURI, COLLECTIONS_CONSTS } from 'lbry-redux'; import { buildURI, parseURI, COLLECTIONS_CONSTS } from 'lbry-redux';
const SHARE_DOMAIN = SHARE_DOMAIN_URL || URL; const SHARE_DOMAIN = SHARE_DOMAIN_URL || URL;
const PAGE_VIEW_QUERY = `view`; const PAGE_VIEW_QUERY = 'view';
const EDIT_PAGE = 'edit'; const EDIT_PAGE = 'edit';
type SubscriptionArgs = { type SubscriptionArgs = {
@ -42,7 +42,7 @@ type Props = {
doCommentModUnBlockAsAdmin: (string, string) => void, doCommentModUnBlockAsAdmin: (string, string) => void,
doCollectionEdit: (string, any) => void, doCollectionEdit: (string, any) => void,
hasClaimInWatchLater: boolean, hasClaimInWatchLater: boolean,
hasClaimInCustom: boolean, hasClaimInFavorites: boolean,
claimInCollection: boolean, claimInCollection: boolean,
collectionId: string, collectionId: string,
isMyCollection: boolean, isMyCollection: boolean,
@ -80,7 +80,7 @@ function ClaimMenuList(props: Props) {
doCommentModUnBlockAsAdmin, doCommentModUnBlockAsAdmin,
doCollectionEdit, doCollectionEdit,
hasClaimInWatchLater, hasClaimInWatchLater,
hasClaimInCustom, hasClaimInFavorites,
collectionId, collectionId,
isMyCollection, isMyCollection,
doToast, doToast,
@ -105,8 +105,6 @@ function ClaimMenuList(props: Props) {
: isSubscribed : isSubscribed
? __('Unfollow') ? __('Unfollow')
: __('Follow'); : __('Follow');
const lastCollectionName = 'Favorites';
const lastCollectionId = COLLECTIONS_CONSTS.FAVORITES_ID;
const { push, replace } = useHistory(); const { push, replace } = useHistory();
if (!claim) { if (!claim) {
@ -282,21 +280,23 @@ function ClaimMenuList(props: Props) {
{/* WATCH LATER */} {/* WATCH LATER */}
<MenuItem <MenuItem
className="comment__menu-option" className="comment__menu-option"
onSelect={() => handleAdd(hasClaimInWatchLater, 'Watch Later', COLLECTIONS_CONSTS.WATCH_LATER_ID)} onSelect={() =>
handleAdd(hasClaimInWatchLater, __('Watch Later'), COLLECTIONS_CONSTS.WATCH_LATER_ID)
}
> >
<div className="menu__link"> <div className="menu__link">
<Icon aria-hidden icon={hasClaimInWatchLater ? ICONS.DELETE : ICONS.TIME} /> <Icon aria-hidden icon={hasClaimInWatchLater ? ICONS.DELETE : ICONS.TIME} />
{hasClaimInWatchLater ? __('In Watch Later') : __('Watch Later')} {hasClaimInWatchLater ? __('In Watch Later') : __('Watch Later')}
</div> </div>
</MenuItem> </MenuItem>
{/* CUSTOM LIST */} {/* FAVORITES LIST */}
<MenuItem <MenuItem
className="comment__menu-option" className="comment__menu-option"
onSelect={() => handleAdd(hasClaimInCustom, lastCollectionName, lastCollectionId)} onSelect={() => handleAdd(hasClaimInFavorites, __('Favorites'), COLLECTIONS_CONSTS.FAVORITES_ID)}
> >
<div className="menu__link"> <div className="menu__link">
<Icon aria-hidden icon={hasClaimInCustom ? ICONS.DELETE : ICONS.STAR} /> <Icon aria-hidden icon={hasClaimInFavorites ? ICONS.DELETE : ICONS.STAR} />
{hasClaimInCustom ? __(`In ${lastCollectionName}`) : __(`${lastCollectionName}`)} {hasClaimInFavorites ? __('In Favorites') : __('Favorites')}
</div> </div>
</MenuItem> </MenuItem>
{/* CURRENTLY ONLY SUPPORT PLAYLISTS FOR PLAYABLE; LATER DIFFERENT TYPES */} {/* CURRENTLY ONLY SUPPORT PLAYLISTS FOR PLAYABLE; LATER DIFFERENT TYPES */}