فهرست منبع

accessibility improvements needs translations

Tobias Conradi 10 سال پیش
والد
کامیت
aa7675aea7

BIN
Resources/en.lproj/Localizable.strings


+ 4 - 1
VLC for iOS WatchKit App/Base.lproj/Interface.storyboard

@@ -80,6 +80,7 @@
                                 <group alignment="center" verticalAlignment="center" radius="20" id="bEJ-d5-UhP">
                                     <items>
                                         <button width="40" height="40" alignment="center" verticalAlignment="center" title="▶︎" enabled="NO" id="4LT-2D-Zeq">
+                                            <accessibilityTraits key="accessibilityTraits" none="YES" button="YES" playsSound="YES"/>
                                             <color key="titleColor" red="0.92549019610000005" green="0.43529411759999997" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                             <color key="backgroundColor" red="1" green="1" blue="1" alpha="0.40000000000000002" colorSpace="calibratedRGB"/>
                                             <connections>
@@ -157,7 +158,7 @@
                                 </slider>
                                 <group width="1" alignment="left" verticalAlignment="bottom" id="d9m-EJ-n3r">
                                     <items>
-                                        <label width="100" alignment="left" verticalAlignment="bottom" accessibilityLabel="title" text="title" id="H58-Y8-Tbc">
+                                        <label width="100" alignment="left" verticalAlignment="bottom" text="title" id="H58-Y8-Tbc">
                                             <fontDescription key="font" type="system" pointSize="14"/>
                                         </label>
                                         <label alignment="right" verticalAlignment="bottom" accessibilityLabel="playback duration" text="duration" id="D0h-cq-wsv">
@@ -179,6 +180,8 @@
                         <outlet property="playElementsGroup" destination="uwS-0S-Ag2" id="aJc-Db-Z3L"/>
                         <outlet property="playPauseButton" destination="BAZ-aC-ETt" id="X17-bz-cFy"/>
                         <outlet property="progressObject" destination="9DQ-Bn-k5Y" id="LK1-eS-RGv"/>
+                        <outlet property="skipBackwardButton" destination="uKa-8V-C8x" id="88k-O6-fq3"/>
+                        <outlet property="skipForwardButton" destination="w8s-Mc-7oV" id="E9p-we-dPi"/>
                         <outlet property="titleLabel" destination="H58-Y8-Tbc" id="xZs-ZW-Shj"/>
                         <outlet property="volumeSlider" destination="WNd-eJ-DzK" id="IyP-bA-Qmf"/>
                     </connections>

+ 6 - 10
VLC for iOS WatchKit Extension/VLCDetailInterfaceController.m

@@ -23,18 +23,12 @@
 
 @implementation VLCDetailInterfaceController
 
-- (instancetype)init
-{
-    self = [super init];
-    if (self) {
-        [self setTitle:NSLocalizedString(@"DETAIL", nil)];
-    }
-    return self;
-}
-
 - (void)awakeWithContext:(id)context {
     [super awakeWithContext:context];
-    [self setTitle:NSLocalizedString(@"DETAIL", nil)];
+    self.title = NSLocalizedString(@"DETAIL", nil);
+    self.playNowButton.accessibilityLabel = NSLocalizedString(@"PLAY_NOW", nil);
+    self.titleLabel.accessibilityLabel = NSLocalizedString(@"TITLE_LABEL", nil);
+    self.durationLabel.accessibilityLabel = NSLocalizedString(@"DURATION_LABEL", nil);
 
     [self addNowPlayingMenu];
     [self configureWithFile:context];
@@ -102,6 +96,7 @@
     if (![_mediaTitle isEqualToString:mediaTitle]) {
         _mediaTitle = [mediaTitle copy];
         self.titleLabel.text = mediaTitle;
+        self.titleLabel.accessibilityValue = mediaTitle;
         self.titleLabel.hidden = mediaTitle.length == 0;
     }
 }
@@ -111,6 +106,7 @@
         _mediaDuration = [mediaDuration copy];
         self.durationLabel.text = mediaDuration;
         self.durationLabel.hidden = mediaDuration.length == 0;
+        self.durationLabel.accessibilityValue = mediaDuration;
     }
 }
 

+ 2 - 0
VLC for iOS WatchKit Extension/VLCNowPlayingInterfaceController.h

@@ -17,7 +17,9 @@
 @property (weak, nonatomic) IBOutlet WKInterfaceGroup *playElementsGroup;
 @property (weak, nonatomic) IBOutlet WKInterfaceLabel *titleLabel;
 @property (weak, nonatomic) IBOutlet WKInterfaceLabel *durationLabel;
+@property (weak, nonatomic) IBOutlet WKInterfaceButton *skipBackwardButton;
 @property (weak, nonatomic) IBOutlet WKInterfaceButton *playPauseButton;
+@property (weak, nonatomic) IBOutlet WKInterfaceButton *skipForwardButton;
 @property (weak, nonatomic) IBOutlet WKInterfaceObject *progressObject;
 @property (weak, nonatomic) IBOutlet WKInterfaceSlider *volumeSlider;
 

+ 11 - 2
VLC for iOS WatchKit Extension/VLCNowPlayingInterfaceController.m

@@ -42,6 +42,11 @@
     _screenScale = currentDevice.screenScale;
 
     [self setTitle:NSLocalizedString(@"PLAYING", nil)];
+    self.skipBackwardButton.accessibilityLabel = NSLocalizedString(@"BWD_BUTTON", nil);
+    self.skipForwardButton.accessibilityLabel = NSLocalizedString(@"FWD_BUTTON", nil);
+    self.volumeSlider.accessibilityLabel = NSLocalizedString(@"VOLUME_SLIDER", nil);
+    self.durationLabel.accessibilityLabel = NSLocalizedString(@"DURATION_LABEL", nil);
+    self.titleLabel.accessibilityLabel = NSLocalizedString(@"TITLE_LABEL", nil);
 
     [self setPlaying:YES];
 
@@ -177,6 +182,7 @@
 - (void)setPlaying:(BOOL)playing {
     if (_playing != playing) {
         [self.playPauseButton setBackgroundImageNamed:playing? @"pause":@"play"];
+        self.playPauseButton.accessibilityLabel = playing ? NSLocalizedString(@"PAUSE_BUTTON", nil) : NSLocalizedString(@"PLAY_BUTTON", nil);
         _playing = playing;
     }
 }
@@ -184,14 +190,17 @@
 - (void)setTitleString:(NSString *)titleString {
     if (![_titleString isEqualToString:titleString]) {
         _titleString = [titleString copy];
-        [self.titleLabel setText:titleString];
+        self.titleLabel.text = titleString;
+        self.titleLabel.accessibilityValue = titleString;
     }
 }
 
 - (void)setPlayBackDurationNumber:(NSNumber *)playBackDurationNumber {
     if (![_playBackDurationNumber isEqualToNumber:playBackDurationNumber] || (_playBackDurationNumber==nil && playBackDurationNumber)) {
         _playBackDurationNumber = playBackDurationNumber;
-        [self.durationLabel setText:[VLCTime timeWithNumber:playBackDurationNumber].stringValue];
+        NSString *durationString = [VLCTime timeWithNumber:playBackDurationNumber].stringValue;
+        self.durationLabel.text = durationString;
+        self.durationLabel.accessibilityValue = durationString;
     }
 }
 

+ 13 - 1
VLC for iOS WatchKit Extension/VLCRowController.m

@@ -53,22 +53,34 @@
 {
     NSString *title = nil;
     float playbackProgress = 0.0;
+    NSString *objectType = nil;
     if ([storageObject isKindOfClass:[MLShow class]]) {
+        objectType = NSLocalizedString(@"OBJECT_TYPE_SHOW", nil);
         title = ((MLAlbum *)storageObject).name;
     } else if ([storageObject isKindOfClass:[MLShowEpisode class]]) {
+        objectType = NSLocalizedString(@"OBJECT_TYPE_SHOW_EPISODE", nil);
         title = ((MLShowEpisode *)storageObject).name;
     } else if ([storageObject isKindOfClass:[MLLabel class]]) {
+        objectType = NSLocalizedString(@"OBJECT_TYPE_LABEL", nil);
         title = ((MLLabel *)storageObject).name;
     } else if ([storageObject isKindOfClass:[MLAlbum class]]) {
+        objectType = NSLocalizedString(@"OBJECT_TYPE_ALBUM", nil);
         title = ((MLAlbum *)storageObject).name;
     } else if ([storageObject isKindOfClass:[MLAlbumTrack class]]) {
+        objectType = NSLocalizedString(@"OBJECT_TYPE_ALBUM_TRACK", nil);
         title = ((MLAlbumTrack *)storageObject).title;
     } else if ([storageObject isKindOfClass:[MLFile class]]){
         MLFile *file = (MLFile *)storageObject;
         title = [file title];
         playbackProgress = file.lastPosition.floatValue;
+        if (file.isSupportedAudioFile) {
+            objectType = NSLocalizedString(@"OBJECT_TYPE_FILE_AUDIO", nil);
+        } else {
+            objectType = NSLocalizedString(@"OBJECT_TYPE_FILE", nil);
+        }
     }
 
+    self.titleLabel.accessibilityValue = objectType;
     self.mediaTitle = title;
     self.playbackProgress = playbackProgress;
 
@@ -119,7 +131,7 @@
     if (![_mediaTitle isEqualToString:mediaTitle]) {
         _mediaTitle = [mediaTitle copy];
         self.titleLabel.text = mediaTitle;
-        self.accessibilityValue = mediaTitle;
+        self.accessibilityLabel = mediaTitle;
         self.titleLabel.hidden = mediaTitle.length == 0;
     }
 }

+ 18 - 0
VLC for iOS WatchKit Extension/en.lproj/Localizable.strings

@@ -7,3 +7,21 @@
 "LIBRARY_MUSIC"="Music Albums";
 "LIBRARY_SERIES"="TV Shows";
 "EMPTY_LIBRARY"="Empty Media Library";
+
+"BWD_BUTTON"="Jump Backwards";
+"FWD_BUTTON"="Jump Forwards";
+"PLAY_BUTTON"="Play";
+"PAUSE_BUTTON"="Pause";
+
+"VOLUME_SLIDER"="Volume";
+"DURATION_LABEL"="Duration";
+"TITLE_LABEL"="Title";
+
+// accessibility labels for the playlist
+"OBJECT_TYPE_SHOW"="Show";
+"OBJECT_TYPE_SHOW_EPISODE"="Show episode";
+"OBJECT_TYPE_LABEL"="Folder";
+"OBJECT_TYPE_ALBUM"="Album";
+"OBJECT_TYPE_ALBUM_TRACK"="Album track";
+"OBJECT_TYPE_FILE"="File";
+"OBJECT_TYPE_FILE_AUDIO"="Audio file";