about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/ui/components
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-11-21 11:39:07 +0100
committerThibaut Girka <thib@sitedethib.com>2019-11-23 19:07:23 +0100
commit962f4854230b0f5d6abfdcc4f644b0bfef7ff29d (patch)
tree2f07f45bf887d14f4f8a7c3ca2bbb4e9a13a1b65 /app/javascript/flavours/glitch/features/ui/components
parentc0f7e21685bbb6b40fdb6f042b8a7ec1054178f2 (diff)
[Glitch] Change media description label to be context-sensitive
Port e86234b1e90975de6e507a86549f0eb4600c723b to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui/components')
-rw-r--r--app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js
index 70e86905f..2846d53d7 100644
--- a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js
+++ b/app/javascript/flavours/glitch/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