Allow mute/unmute playback controls to be translated

This commit is contained in:
Matthias Meulien
2020-08-09 19:39:15 +02:00
parent fbba492ffa
commit 62f58018c7
2 changed files with 5 additions and 2 deletions

View File

@ -1,20 +1,21 @@
import React, { memo } from 'react';
import Icon from '../Icon';
import { I18n } from '../../locale';
export default memo((props) => {
if (props.mute) {
return (
<button className={`control mute-control ${props.noTooltip ? '' : 'tooltip '}${props.className ? props.className : ''}`} onClick={() => props.onMuteChange(false)}>
<Icon className="red-text" name="volume_off" />
{props.noTooltip ? null : <span className="tooltip__content">Unmute</span>}
{props.noTooltip ? null : <span className="tooltip__content"><I18n path="playback_controls.unmute"/></span>}
</button>
);
}
return (
<button className={`control mute-control ${props.noTooltip ? '' : 'tooltip '}${props.className ? props.className : ''}`} onClick={() => props.onMuteChange(true)}>
<Icon className="muted" name="volume_mute" />
{props.noTooltip ? null : <span className="tooltip__content">Mute</span>}
{props.noTooltip ? null : <span className="tooltip__content"><I18n path="playback_controls.mute"/></span>}
</button>
);
});

View File

@ -174,6 +174,8 @@ playback_controls:
shuffle: Shuffle
repeat: Repeat
no_outputs: No outputs
mute: Mute
unmute: Unmute
snapcast:
enabled: Enabled
show_disconnected_clients: Show disconnected clients