[vlc-commits] macosx: More translations improvements for VLCStatusBarIcon

Marvin Scholz git at videolan.org
Mon Apr 18 16:31:29 CEST 2016


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Tue Apr 12 15:59:08 2016 +0200| [ac39a25606b4f6afc0d4e8e4733c7ab8c6f07035] | committer: Marvin Scholz

macosx: More translations improvements for VLCStatusBarIcon

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ac39a25606b4f6afc0d4e8e4733c7ab8c6f07035
---

 .../English.lproj/VLCStatusBarIconMainMenu.xib     |   13 ++++++--
 modules/gui/macosx/VLCStatusBarIcon.m              |   32 +++++++++++++++-----
 2 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/extras/package/macosx/Resources/English.lproj/VLCStatusBarIconMainMenu.xib b/extras/package/macosx/Resources/English.lproj/VLCStatusBarIconMainMenu.xib
index 4959843..e146530 100755
--- a/extras/package/macosx/Resources/English.lproj/VLCStatusBarIconMainMenu.xib
+++ b/extras/package/macosx/Resources/English.lproj/VLCStatusBarIconMainMenu.xib
@@ -1,13 +1,20 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10102" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9532" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
     <dependencies>
         <deployment identifier="macosx"/>
         <development version="7000" identifier="xcode"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10102"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9532"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="VLCStatusBarIcon">
             <connections>
+                <outlet property="nextItem" destination="GhQ-VQ-jtu" id="45X-b4-mHv"/>
+                <outlet property="playPauseItem" destination="9kC-yJ-Gy5" id="laU-MV-Il1"/>
+                <outlet property="prevItem" destination="iHu-rd-8KL" id="IzO-1Q-rtv"/>
+                <outlet property="quitItem" destination="539" id="xuy-Vl-Ami"/>
+                <outlet property="randItem" destination="lPi-EL-hoN" id="dOE-ib-n98"/>
+                <outlet property="showMainWindowItem" destination="08C-TA-yqu" id="qQR-Ah-T0b"/>
+                <outlet property="stopItem" destination="4Sh-MJ-bSf" id="qBc-qg-d9R"/>
                 <outlet property="vlcStatusBarIconMenu" destination="534" id="O0F-8Q-FgA"/>
             </connections>
         </customObject>
@@ -16,7 +23,7 @@
         <customObject id="420" customClass="NSFontManager"/>
         <menu id="534" userLabel="vlcStatusBarIconMenu">
             <items>
-                <menuItem title="Show Main WIndow" toolTip="Restore main window" id="08C-TA-yqu">
+                <menuItem title="Show Main Window" toolTip="Restore main window" id="08C-TA-yqu">
                     <modifierMask key="keyEquivalentModifierMask"/>
                     <connections>
                         <action selector="restoreMainWindow:" target="-2" id="2Uq-Pa-toi"/>
diff --git a/modules/gui/macosx/VLCStatusBarIcon.m b/modules/gui/macosx/VLCStatusBarIcon.m
index 18de086..ee8f47d 100644
--- a/modules/gui/macosx/VLCStatusBarIcon.m
+++ b/modules/gui/macosx/VLCStatusBarIcon.m
@@ -46,6 +46,14 @@
 {
     NSMenuItem *_vlcStatusBarMenuItem;
 
+    IBOutlet NSMenuItem *showMainWindowItem;
+    IBOutlet NSMenuItem *playPauseItem;
+    IBOutlet NSMenuItem *stopItem;
+    IBOutlet NSMenuItem *nextItem;
+    IBOutlet NSMenuItem *prevItem;
+    IBOutlet NSMenuItem *randItem;
+    IBOutlet NSMenuItem *quitItem;
+
     NSString *_nameToDisplay;
     NSString *_timeToDisplay;
     NSString *_durationToDisplay;
@@ -77,6 +85,15 @@
 
     [self enableMenuIcon];
 
+    // Populate menu items with localized strings
+    [showMainWindowItem setTitle:_NS("Show Main Window")];
+    [playPauseItem setTitle:_NS("Play")];
+    [stopItem setTitle:_NS("Stop")];
+    [nextItem setTitle:_NS("Next")];
+    [prevItem setTitle:_NS("Previous")];
+    [randItem setTitle:_NS("Random")];
+    [quitItem setTitle:_NS("Quit")];
+
     // add the top menu item for dynamic data
     _vlcStatusBarMenuItem = [[NSMenuItem alloc] initWithTitle:_NS("URL/Path Options") action:@selector(updateMenuItemContent:) keyEquivalent:@""];
 
@@ -179,6 +196,7 @@
     // Make sure the b/w statusItem icon is inverted on dark/light mode
     menuIcon.template = YES;
     [_statusItem setImage:menuIcon];
+    [_statusItem setLength:24];
 
     // Attach pull-down menu
     [_statusItem setMenu:_vlcStatusBarIconMenu];
@@ -262,10 +280,10 @@
     } else {
         if ([_urlToDisplay hasPrefix:@"file://"]) {
             // offer to show 'file://' in finder
-            menuString = [NSString stringWithString:_NS("Select File In Finder")];
+            menuString = _NS("Select File In Finder");
         } else {
             // offer to copy URL to clipboard
-            menuString = [NSString stringWithString:_NS("Copy URL to clipboard")];
+            menuString = _NS("Copy URL to clipboard");
         }
     }
 
@@ -311,14 +329,12 @@
 //
 - (void)updateMenuItemPlayPause
 {
-    NSMenuItem* menuItemToChange = [_vlcStatusBarIconMenu itemWithTag:playPauseMenuItemTag];
-
     if ([self vlcPlayingStatus] == PLAYLIST_RUNNING) {
-        [menuItemToChange setTitle:_NS("Pause")];
-        [menuItemToChange setImage:_menuImagePause];
+        [playPauseItem setTitle:_NS("Pause")];
+        [playPauseItem setImage:_menuImagePause];
     } else {
-        [menuItemToChange setTitle:_NS("Play")];
-        [menuItemToChange setImage:_menuImagePlay];
+        [playPauseItem setTitle:_NS("Play")];
+        [playPauseItem setImage:_menuImagePlay];
     }
 }
 



More information about the vlc-commits mailing list