소스 검색

Change media description label to be context-sensitive (#12270)

“Describe for the visually impaired” makes no sense when the uploaded media
is an audio file.
master^2
ThibG 4 년 전
committed by Eugen Rochko
부모
커밋
e86234b1e9
1개의 변경된 파일13개의 추가작업 그리고 1개의 파일을 삭제
  1. +13
    -1
      app/javascript/mastodon/features/ui/components/focal_point_modal.js

+ 13
- 1
app/javascript/mastodon/features/ui/components/focal_point_modal.js 파일 보기

@@ -244,6 +244,16 @@ class FocalPointModal extends ImmutablePureComponent {
const previewWidth = 200;
const previewHeight = previewWidth / previewRatio;

let descriptionLabel = null;

if (media.get('type') === 'audio') {
descriptionLabel = <FormattedMessage id='upload_form.audio_description' defaultMessage='Describe for people with hearing loss' />;
} else if (media.get('type') === 'video') {
descriptionLabel = <FormattedMessage id='upload_form.video_description' defaultMessage='Describe for people with hearing loss or visual impairment' />;
} else {
descriptionLabel = <FormattedMessage id='upload_form.description' defaultMessage='Describe for the visually impaired' />;
}

return (
<div className='modal-root__modal report-modal' style={{ maxWidth: 960 }}>
<div className='report-modal__target'>
@@ -255,7 +265,9 @@ class FocalPointModal extends ImmutablePureComponent {
<div className='report-modal__comment'>
{focals && <p><FormattedMessage id='upload_modal.hint' defaultMessage='Click or drag the circle on the preview to choose the focal point which will always be in view on all thumbnails.' /></p>}

<label className='setting-text-label' htmlFor='upload-modal__description'><FormattedMessage id='upload_form.description' defaultMessage='Describe for the visually impaired' /></label>
<label className='setting-text-label' htmlFor='upload-modal__description'>
{descriptionLabel}
</label>

<div className='setting-text__wrapper'>
<Textarea


불러오는 중...
취소
저장