Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d0063130b5 | |||
| c384d0e94b | |||
| e267d30bfd | |||
| d32fc188ca | |||
| 2b2fb80556 | |||
| 60978895b2 | |||
| 6a97ae68e9 | |||
| 29d047c928 | |||
| 5a18ccc5e1 | |||
| e83732400b | |||
| 2730683848 | |||
| 471322a113 | |||
| 09b7364130 | |||
| 82a06382f0 | |||
| dd2507b7f9 | |||
| a0af086f16 | |||
| a73a254ce7 | |||
| ed694bc1a5 | |||
| ded95506c6 | |||
| b99a1a4dc4 | |||
| dd0a37c785 | |||
| a06ef8d27c |
@@ -1,3 +1,14 @@
|
||||
2.3.3 2016/1/9
|
||||
- Improved Japanese localization [oreshinya]
|
||||
- Improved Frech localization [magiclantern]
|
||||
- Fixed CocoaPods localization with use_frameworks! [nivanchikov]
|
||||
|
||||
2.3.2 2015/10/12
|
||||
- Fixed localization when building through CocoaPods [Allan Beaufour]
|
||||
|
||||
2.3.1 2015/9/10
|
||||
- Trying to work around a strange build error in CocoaPods.
|
||||
|
||||
2.3.0 2015/9/10
|
||||
- Basic localization support for Czech, German, Spanish,
|
||||
Italian, French, and Japanese. Native speaking testers welcome!
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
/* Feedback that’s displayed when user presses the sample shortcut. */
|
||||
"Shortcut pressed!" = "ショートカットが押されました!";
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.3.0</string>
|
||||
<string>2.3.3</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.3.0</string>
|
||||
<string>2.3.3</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2014–2015 Vadim Shpakovski. All rights reserved.</string>
|
||||
</dict>
|
||||
|
||||
@@ -1,7 +1,34 @@
|
||||
#import "MASLocalization.h"
|
||||
#import "MASShortcut.h"
|
||||
|
||||
static NSString *const MASLocalizationTableName = @"Localizable";
|
||||
static NSString *const MASPlaceholderLocalizationString = @"XXX";
|
||||
|
||||
// The CocoaPods trickery here is needed because when the code
|
||||
// is built as a part of CocoaPods, it won’t make a separate framework
|
||||
// and the Localized.strings file won’t be bundled correctly.
|
||||
// See https://github.com/shpakovski/MASShortcut/issues/74
|
||||
NSString *MASLocalizedString(NSString *key, NSString *comment) {
|
||||
NSBundle *frameworkBundle = [NSBundle bundleForClass:[MASShortcut class]];
|
||||
return [frameworkBundle localizedStringForKey:key value:@"XXX" table:@"Localizable"];
|
||||
static NSBundle *localizationBundle = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
NSBundle *frameworkBundle = [NSBundle bundleForClass:[MASShortcut class]];
|
||||
// first we'll check if resources bundle was copied to MASShortcut framework bundle when !use_frameworks option is active
|
||||
NSURL *cocoaPodsBundleURL = [frameworkBundle URLForResource:@"MASShortcut" withExtension:@"bundle"];
|
||||
if (cocoaPodsBundleURL) {
|
||||
localizationBundle = [NSBundle bundleWithURL: cocoaPodsBundleURL];
|
||||
} else {
|
||||
// trying to fetch cocoapods bundle from main bundle
|
||||
cocoaPodsBundleURL = [[NSBundle mainBundle] URLForResource: @"MASShortcut" withExtension:@"bundle"];
|
||||
if (cocoaPodsBundleURL) {
|
||||
localizationBundle = [NSBundle bundleWithURL: cocoaPodsBundleURL];
|
||||
} else {
|
||||
// fallback to framework bundle
|
||||
localizationBundle = frameworkBundle;
|
||||
}
|
||||
}
|
||||
});
|
||||
return [localizationBundle localizedStringForKey:key
|
||||
value:MASPlaceholderLocalizationString
|
||||
table:MASLocalizationTableName];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#import "MASShortcut.h"
|
||||
#import "MASLocalization.h"
|
||||
|
||||
static NSString *const MASShortcutKeyCode = @"KeyCode";
|
||||
static NSString *const MASShortcutModifierFlags = @"ModifierFlags";
|
||||
|
||||
@@ -1,9 +1,23 @@
|
||||
#import "MASShortcut.h"
|
||||
|
||||
/**
|
||||
This class is used by the recording control to tell which shortcuts are acceptable.
|
||||
|
||||
There are two kinds of shortcuts that are not considered acceptable: shortcuts that
|
||||
are too simple (like single letter keys) and shortcuts that are already used by the
|
||||
operating system.
|
||||
*/
|
||||
@interface MASShortcutValidator : NSObject
|
||||
|
||||
// The following API enable hotkeys with the Option key as the only modifier
|
||||
// For example, Option-G will not generate © and Option-R will not paste ®
|
||||
/**
|
||||
Set to `YES` if you want to accept Option-something shortcuts.
|
||||
|
||||
`NO` by default, since Option-something shortcuts are often used by system,
|
||||
for example Option-G will type the © sign. This also applies to Option-Shift
|
||||
shortcuts – in other words, shortcut recorder will not accept shortcuts like
|
||||
Option-Shift-K by default. (Again, since Option-Shift-K inserts the Apple
|
||||
logo sign by default.)
|
||||
*/
|
||||
@property(assign) BOOL allowAnyShortcutWithOptionModifier;
|
||||
|
||||
+ (instancetype) sharedValidator;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#import "MASShortcutValidator.h"
|
||||
#import "MASLocalization.h"
|
||||
|
||||
@implementation MASShortcutValidator
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#import "MASShortcutView.h"
|
||||
#import "MASShortcutValidator.h"
|
||||
#import "MASLocalization.h"
|
||||
|
||||
NSString *const MASShortcutBinding = @"shortcutValue";
|
||||
|
||||
@@ -137,6 +138,12 @@ static const CGFloat MASButtonFontSize = 11;
|
||||
[self setNeedsDisplay:YES];
|
||||
|
||||
// Give VoiceOver users feedback on the result. Requires at least 10.9 to run.
|
||||
// We’re silencing the “tautological compare” warning here so that if someone
|
||||
// takes the naked source files and compiles them with -Wall, the following
|
||||
// NSAccessibilityPriorityKey comparison doesn’t cause a warning. See:
|
||||
// https://github.com/shpakovski/MASShortcut/issues/76
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
if (_recording == NO && (&NSAccessibilityPriorityKey != NULL)) {
|
||||
NSString* msg = _shortcutValue ?
|
||||
MASLocalizedString(@"Shortcut set", @"VoiceOver: Shortcut set") :
|
||||
@@ -147,6 +154,7 @@ static const CGFloat MASButtonFontSize = 11;
|
||||
};
|
||||
NSAccessibilityPostNotificationWithUserInfo(self, NSAccessibilityAnnouncementRequestedNotification, announcementInfo);
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
- (void)setShortcutValue:(MASShortcut *)shortcutValue
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <Carbon/Carbon.h>
|
||||
#import "MASLocalization.h"
|
||||
#import <Carbon/Carbon.h>
|
||||
+4
-2
@@ -1,6 +1,7 @@
|
||||
# coding: utf-8
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'MASShortcut'
|
||||
s.version = '2.3.0'
|
||||
s.version = '2.3.3'
|
||||
s.summary = 'Modern framework for managing global keyboard shortcuts compatible with Mac App Store'
|
||||
s.homepage = 'https://github.com/shpakovski/MASShortcut'
|
||||
s.license = 'BSD 2-clause'
|
||||
@@ -9,9 +10,10 @@ Pod::Spec.new do |s|
|
||||
|
||||
s.platform = :osx
|
||||
s.osx.deployment_target = "10.6"
|
||||
s.source = { :git => 'https://github.com/shpakovski/MASShortcut.git', :tag => '2.3.0' }
|
||||
s.source = { :git => 'https://github.com/shpakovski/MASShortcut.git', :tag => '2.3.3' }
|
||||
s.source_files = 'Framework/*.{h,m}'
|
||||
s.exclude_files = 'Framework/*Tests.m'
|
||||
s.osx.frameworks = 'Carbon', 'AppKit'
|
||||
s.requires_arc = true
|
||||
s.osx.resource_bundles = { 'MASShortcut' => ['*.lproj'] }
|
||||
end
|
||||
|
||||
@@ -123,6 +123,7 @@
|
||||
0DC2F19619938EFA003A0131 /* MASShortcutView+Bindings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "MASShortcutView+Bindings.h"; path = "Framework/MASShortcutView+Bindings.h"; sourceTree = "<group>"; };
|
||||
0DC2F19719938EFA003A0131 /* MASShortcutView+Bindings.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "MASShortcutView+Bindings.m"; path = "Framework/MASShortcutView+Bindings.m"; sourceTree = "<group>"; };
|
||||
EAFFDC811AACFF3300F38834 /* MASShortcut.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; name = MASShortcut.modulemap; path = Framework/MASShortcut.modulemap; sourceTree = "<group>"; };
|
||||
ED8737791BCE459800BB1716 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -500,6 +501,7 @@
|
||||
children = (
|
||||
0D2CAB221B834464005431FC /* en */,
|
||||
0D2CAB241B834467005431FC /* cs */,
|
||||
ED8737791BCE459800BB1716 /* ja */,
|
||||
);
|
||||
name = Localizable.strings;
|
||||
sourceTree = "<group>";
|
||||
|
||||
@@ -19,11 +19,11 @@ Features:
|
||||
* Mac App Store friendly
|
||||
* Works on OS X 10.6 and up
|
||||
* Hacking-friendly codebase covered with tests
|
||||
* Basic accessibility support
|
||||
|
||||
Important features currently missing:
|
||||
Partially done:
|
||||
|
||||
* Localisation
|
||||
* Accessibility support. There’s some basic accessibility code, testers and feedback welcome.
|
||||
* Localisation. The English and Czech localization should be complete, there’s basic support for German, French, Spanish, Italian, and Japanese. If you’re a native speaker in one of the mentioned languages, please test the localization and report issues or add missing strings.
|
||||
|
||||
Pull requests welcome :)
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
"Cancel" = "Annuler";
|
||||
|
||||
/* Tooltip for non-empty shortcut button */
|
||||
"Click to record new shortcut" = "Click to record new shortcut";
|
||||
"Click to record new shortcut" = "Cliquez pour enregistrer le raccourci";
|
||||
|
||||
/* Tooltip for hint button near the non-empty shortcut */
|
||||
"Delete shortcut" = "Delete shortcut";
|
||||
"Delete shortcut" = "Supprimer le raccourci";
|
||||
|
||||
/* VoiceOver title */
|
||||
"keyboard shortcut" = "keyboard shortcut";
|
||||
"keyboard shortcut" = "raccourci clavier";
|
||||
|
||||
/* Alert button when shortcut is already used */
|
||||
"OK" = "OK";
|
||||
@@ -17,25 +17,25 @@
|
||||
"Record Shortcut" = "Enregistrer le raccourci";
|
||||
|
||||
/* VoiceOver: Shortcut cleared */
|
||||
"Shortcut cleared" = "Shortcut cleared";
|
||||
"Shortcut cleared" = "Raccourci supprimé";
|
||||
|
||||
/* VoiceOver: Shortcut set */
|
||||
"Shortcut set" = "Shortcut set";
|
||||
"Shortcut set" = "Raccourci configuré";
|
||||
|
||||
/* Shortcut glyph name for SPACE key */
|
||||
"Space" = "Espace";
|
||||
|
||||
/* Title for alert when shortcut is already used */
|
||||
"The key combination %@ cannot be used" = "The key combination %@ cannot be used";
|
||||
"The key combination %@ cannot be used" = "La combinaison %@ ne peut être utilisée";
|
||||
|
||||
/* Message for alert when shortcut is already used by the system */
|
||||
"This combination cannot be used because it is already used by a system-wide keyboard shortcut.\nIf you really want to use this key combination, most shortcuts can be changed in the Keyboard & Mouse panel in System Preferences." = "This combination cannot be used because it is already used by a system-wide keyboard shortcut.\nIf you really want to use this key combination, most shortcuts can be changed in the Keyboard & Mouse panel in System Preferences.";
|
||||
"This combination cannot be used because it is already used by a system-wide keyboard shortcut.\nIf you really want to use this key combination, most shortcuts can be changed in the Keyboard & Mouse panel in System Preferences." = "Cette combinaison de touches ne peut être utilisée parce qu’elle est réservée pour un raccourci du système.\nSi vous désirez l’utiliser, la plupart des raccourcis peuvent être modifiés dans l’onglet Clavier, dans Préférences Système.";
|
||||
|
||||
/* Message for alert when shortcut is already used */
|
||||
"This shortcut cannot be used because it is already used by the menu item ‘%@’." = "This shortcut cannot be used because it is already used by the menu item ‘%@’.";
|
||||
"This shortcut cannot be used because it is already used by the menu item ‘%@’." = "Ce raccourci ne peut être utilisé parce qu’il est déjà utilisé par le point de menu «%@».";
|
||||
|
||||
/* VoiceOver shortcut help */
|
||||
"To record a new shortcut, click this button, and then type the new shortcut, or press delete to clear an existing shortcut." = "To record a new shortcut, click this button, and then type the new shortcut, or press delete to clear an existing shortcut.";
|
||||
"To record a new shortcut, click this button, and then type the new shortcut, or press delete to clear an existing shortcut." = "Pour enregistrer un nouveau raccourci, cliquez sur ce bouton et tapez le nouveau raccourci, ou bien, tapez sur «Supprimer» pour supprimer le raccourci configuré.";
|
||||
|
||||
/* Non-empty shortcut button in recording state */
|
||||
"Type New Shortcut" = "Saisir un raccourci";
|
||||
@@ -44,4 +44,4 @@
|
||||
"Type Shortcut" = "Saisir un raccourci";
|
||||
|
||||
/* Cancel action button for non-empty shortcut in recording state */
|
||||
"Use Old Shortcut" = "Use Old Shortcut";
|
||||
"Use Old Shortcut" = "Revenir au raccourci précédent";
|
||||
|
||||
@@ -2,46 +2,46 @@
|
||||
"Cancel" = "キャンセルする";
|
||||
|
||||
/* Tooltip for non-empty shortcut button */
|
||||
"Click to record new shortcut" = "Click to record new shortcut";
|
||||
"Click to record new shortcut" = "クリックしてショートカットを入力";
|
||||
|
||||
/* Tooltip for hint button near the non-empty shortcut */
|
||||
"Delete shortcut" = "Delete shortcut";
|
||||
"Delete shortcut" = "ショートカットを削除";
|
||||
|
||||
/* VoiceOver title */
|
||||
"keyboard shortcut" = "keyboard shortcut";
|
||||
"keyboard shortcut" = "キーボードショートカット";
|
||||
|
||||
/* Alert button when shortcut is already used */
|
||||
"OK" = "OK";
|
||||
|
||||
/* Empty shortcut button in normal state */
|
||||
"Record Shortcut" = "記録のショートカット";
|
||||
"Record Shortcut" = "ショートカットを入力";
|
||||
|
||||
/* VoiceOver: Shortcut cleared */
|
||||
"Shortcut cleared" = "Shortcut cleared";
|
||||
"Shortcut cleared" = "ショートカットが削除されました";
|
||||
|
||||
/* VoiceOver: Shortcut set */
|
||||
"Shortcut set" = "Shortcut set";
|
||||
"Shortcut set" = "ショートカットが設定されました";
|
||||
|
||||
/* Shortcut glyph name for SPACE key */
|
||||
"Space" = "スペース";
|
||||
|
||||
/* Title for alert when shortcut is already used */
|
||||
"The key combination %@ cannot be used" = "The key combination %@ cannot be used";
|
||||
"The key combination %@ cannot be used" = "%@ はショートカットに設定できません";
|
||||
|
||||
/* Message for alert when shortcut is already used by the system */
|
||||
"This combination cannot be used because it is already used by a system-wide keyboard shortcut.\nIf you really want to use this key combination, most shortcuts can be changed in the Keyboard & Mouse panel in System Preferences." = "This combination cannot be used because it is already used by a system-wide keyboard shortcut.\nIf you really want to use this key combination, most shortcuts can be changed in the Keyboard & Mouse panel in System Preferences.";
|
||||
"This combination cannot be used because it is already used by a system-wide keyboard shortcut.\nIf you really want to use this key combination, most shortcuts can be changed in the Keyboard & Mouse panel in System Preferences." = "このショートカットは、システム全体で使用されているショートカットのため、設定することができません。\nもしこのショートカットを使用したい場合、「システム環境設定」の「キーボード」、「マウス」のパネルから既に設定されているショートカットを変更してください。";
|
||||
|
||||
/* Message for alert when shortcut is already used */
|
||||
"This shortcut cannot be used because it is already used by the menu item ‘%@’." = "This shortcut cannot be used because it is already used by the menu item ‘%@’.";
|
||||
"This shortcut cannot be used because it is already used by the menu item ‘%@’." = "このショートカットは、メニュー操作の「%@」で使われているため、設定できません。";
|
||||
|
||||
/* VoiceOver shortcut help */
|
||||
"To record a new shortcut, click this button, and then type the new shortcut, or press delete to clear an existing shortcut." = "To record a new shortcut, click this button, and then type the new shortcut, or press delete to clear an existing shortcut.";
|
||||
"To record a new shortcut, click this button, and then type the new shortcut, or press delete to clear an existing shortcut." = "このボタンをクリックし、ショートカットを入力すると、新しいショートカットが設定されます。また、削除ボタンをおすと、ショートカットが削除されます。";
|
||||
|
||||
/* Non-empty shortcut button in recording state */
|
||||
"Type New Shortcut" = "タイプのショートカット";
|
||||
"Type New Shortcut" = "ショートカットを入力";
|
||||
|
||||
/* Empty shortcut button in recording state */
|
||||
"Type Shortcut" = "タイプのショートカット";
|
||||
"Type Shortcut" = "ショートカットを入力";
|
||||
|
||||
/* Cancel action button for non-empty shortcut in recording state */
|
||||
"Use Old Shortcut" = "Use Old Shortcut";
|
||||
"Use Old Shortcut" = "古いショートカットを使用";
|
||||
|
||||
Reference in New Issue
Block a user