diff --git a/README.md b/README.md index eb0d8702..2b003512 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ choose **Open** then click **Open** in the prompt that appears. From macOS 10.12 to 10.15 +## Localization + +The app is currently available in: English, Français + +[Contribute your own language easily on POEditor](https://poeditor.com/join/project/8AOEZ0eAZE) + ## Usage * Press `⌥ option` + `⇥ tab` to shows the thumbnails. diff --git a/alt-tab-macos.xcodeproj/project.pbxproj b/alt-tab-macos.xcodeproj/project.pbxproj index 220f45fc..f1285d56 100644 --- a/alt-tab-macos.xcodeproj/project.pbxproj +++ b/alt-tab-macos.xcodeproj/project.pbxproj @@ -31,12 +31,14 @@ D04BA6B6B703DCEFE892D5A4 /* Spaces.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BA5EB5ED248C8C22CC672 /* Spaces.swift */; }; D04BA6D9DA2A8BCD93347F0E /* CollectionViewItemFontIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BAC0416F29ADE7BC5A544 /* CollectionViewItemFontIcon.swift */; }; D04BA70FF7262BF5F9E6E13B /* Preferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BADCB1C0F50340A6CAFC2 /* Preferences.swift */; }; + D04BA79B891E9C89C015D6DD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D04BAEE5AEEB8692856B45E4 /* InfoPlist.strings */; }; D04BA7F212CDB1B7E101D7A3 /* GridView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BAFE3AC6E14F394956586 /* GridView.swift */; }; D04BA8373D4DE452C0C081ED /* SF-Pro-Text-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = D04BABC654F40BE74DA25BC7 /* SF-Pro-Text-Regular.otf */; }; D04BA84074E5FD6221720BC7 /* CollectionViewFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BAACB6648E7C2A4E0339D /* CollectionViewFlowLayout.swift */; }; D04BA8EBC0365A019A27C7EA /* Screen.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BA3F15EAE8D8C39B6F2CF /* Screen.swift */; }; D04BA9CCE02D30C8164A552A /* SystemPermissions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BA2D2AD6B1CCA3F3A4DD7 /* SystemPermissions.swift */; }; D04BA9EE5D34A2789DCB0EE2 /* Sysctl.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BA896E37EFD27CAB61DF0 /* Sysctl.swift */; }; + D04BAA0F39E6160F5703FC33 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = D04BAC0D42D7FED725746DA5 /* Localizable.strings */; }; D04BAAD43731608067734ED3 /* DispatchQueues.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BA56E285C3FCDA52ED262 /* DispatchQueues.swift */; }; D04BAB5E802C938E78839011 /* TextArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BA8011143819B48F204C2 /* TextArea.swift */; }; D04BABF88726DA42B2CBA68B /* ThumbnailsPanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BAF40D5E54AD1044B3FF7 /* ThumbnailsPanel.swift */; }; @@ -44,15 +46,18 @@ D04BAC4F69FE9563BC1C5E9C /* DebugProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BA3915020FB9B34555D74 /* DebugProfile.swift */; }; D04BAC9C031D482119F6DEB8 /* FeedbackWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BAFA84FD0B02215718F94 /* FeedbackWindow.swift */; }; D04BACD398A35D82D514A9F7 /* TextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BABC180117F8785D250E1 /* TextField.swift */; }; + D04BAD1158CBCC76DE321555 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D04BA1ACE289DC4AD4826D1E /* InfoPlist.strings */; }; D04BAD5A6B2F9EEE6FD4185F /* CollectionViewItemTitle.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BA4BABBA0312E0EDBA647 /* CollectionViewItemTitle.swift */; }; D04BAD8346A6A32C9749E0B3 /* TabViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BA293C53EC5CE00D11E02 /* TabViewItem.swift */; }; D04BAE369A14C3126A1606FE /* HelperExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BA8F1AA48A323EE5638DC /* HelperExtensions.swift */; }; + D04BAEAB8AB048FF2B16B131 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = D04BAE5FA03065C5D23C0C2C /* Localizable.strings */; }; D04BAEF78503D7A2CEFB9E9E /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BAA44C837F3A67403B9DB /* main.swift */; }; D04BAF3B6F75E50E9AA3E1D2 /* LabelAndControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04BA3D65E7CA78D699EDAB0 /* LabelAndControl.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 4807A6C523A9CD190052A53E /* SkyLight.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SkyLight.framework; path = ../../../../System/Library/PrivateFrameworks/SkyLight.framework; sourceTree = ""; }; + D04BA05F3F36A6D71DCD8475 /* en */ = {isa = PBXFileReference; fileEncoding = 2483028224; lastKnownFileType = text.plist.strings; name = en; path = Localizable.strings; sourceTree = ""; }; D04BA0CE87BE264C52987ED1 /* 7 windows - 2 lines - wide window.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "7 windows - 2 lines - wide window.jpg"; sourceTree = ""; }; D04BA0E1C5DBC07108AC2F54 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; D04BA0F5EB832B8E142B654B /* 4 windows - 1 line.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "4 windows - 1 line.jpg"; sourceTree = ""; }; @@ -64,6 +69,7 @@ D04BA2C7B51F68651B3C60E2 /* 6 windows - 1 line.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "6 windows - 1 line.jpg"; sourceTree = ""; }; D04BA2D2AD6B1CCA3F3A4DD7 /* SystemPermissions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SystemPermissions.swift; sourceTree = ""; }; D04BA2D2BCBA4C47E25315AF /* HyperlinkLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HyperlinkLabel.swift; sourceTree = ""; }; + D04BA30247D04CEEC2DACEA8 /* fr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = fr; path = Localizable.strings; sourceTree = ""; }; D04BA32F25860B686DFE818A /* 3 windows - 1 line.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "3 windows - 1 line.jpg"; sourceTree = ""; }; D04BA35456DA0DDA74F9687E /* Keyboard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Keyboard.swift; sourceTree = ""; }; D04BA3915020FB9B34555D74 /* DebugProfile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DebugProfile.swift; sourceTree = ""; }; @@ -90,6 +96,7 @@ D04BA7B6AAB0812631BBC7A2 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.info; path = Info.plist; sourceTree = ""; }; D04BA7ECCE728582D9ECA613 /* determine_version.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = determine_version.sh; sourceTree = ""; }; D04BA8011143819B48F204C2 /* TextArea.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextArea.swift; sourceTree = ""; }; + D04BA81CA2D9818FCA9E5024 /* fr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = fr; path = InfoPlist.strings; sourceTree = ""; }; D04BA82F792DF53958D92572 /* alt-tab-macos.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "alt-tab-macos.app"; sourceTree = BUILT_PRODUCTS_DIR; }; D04BA896E37EFD27CAB61DF0 /* Sysctl.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Sysctl.swift; sourceTree = ""; }; D04BA89FAEC4A5734D892C4B /* build_release.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build_release.sh; sourceTree = ""; }; @@ -116,6 +123,7 @@ D04BAD7D8F3CC2C36C8769C6 /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = file.yml; path = .travis.yml; sourceTree = ""; }; D04BAD82F652C4ED5D8BF7AE /* 3 windows - 1 line - tall window.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "3 windows - 1 line - tall window.jpg"; sourceTree = ""; }; D04BADB20AB31BF83593E0BE /* greetings.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = greetings.yml; sourceTree = ""; }; + D04BADBCA16C1D448D34F473 /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = ""; }; D04BADCB1C0F50340A6CAFC2 /* Preferences.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Preferences.swift; sourceTree = ""; }; D04BAE1243C9B4BE3ED1B524 /* 7 windows - 2 lines - extra wide window.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "7 windows - 2 lines - extra wide window.jpg"; sourceTree = ""; }; D04BAE23C37E0F3B07EEE7B1 /* AboutTab.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AboutTab.swift; sourceTree = ""; }; @@ -241,6 +249,7 @@ children = ( D04BABC654F40BE74DA25BC7 /* SF-Pro-Text-Regular.otf */, D04BA7A48641612933710091 /* MainMenu.xib */, + D04BAA62C61D1A8906274221 /* l10n */, ); path = resources; sourceTree = ""; @@ -269,6 +278,15 @@ path = ci; sourceTree = ""; }; + D04BA77FA515B70E5E5F2677 /* en.lproj */ = { + isa = PBXGroup; + children = ( + D04BAEE5AEEB8692856B45E4 /* InfoPlist.strings */, + D04BAC0D42D7FED725746DA5 /* Localizable.strings */, + ); + path = en.lproj; + sourceTree = ""; + }; D04BA8965B713BE52849AFAF /* generic-components */ = { isa = PBXGroup; children = ( @@ -306,6 +324,15 @@ path = logic; sourceTree = ""; }; + D04BAA62C61D1A8906274221 /* l10n */ = { + isa = PBXGroup; + children = ( + D04BA77FA515B70E5E5F2677 /* en.lproj */, + D04BAF78C474CFE92FB844FA /* fr.lproj */, + ); + path = l10n; + sourceTree = ""; + }; D04BAAA28315301A906DD201 /* ui */ = { isa = PBXGroup; children = ( @@ -370,6 +397,15 @@ path = workflows; sourceTree = ""; }; + D04BAF78C474CFE92FB844FA /* fr.lproj */ = { + isa = PBXGroup; + children = ( + D04BA1ACE289DC4AD4826D1E /* InfoPlist.strings */, + D04BAE5FA03065C5D23C0C2C /* Localizable.strings */, + ); + path = fr.lproj; + sourceTree = ""; + }; D04BAF7BAEB13280202194EC /* main-window */ = { isa = PBXGroup; children = ( @@ -412,11 +448,11 @@ }; buildConfigurationList = D04BA83C9495F252D87CDF0F /* Build configuration list for PBXProject "alt-tab-macos" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, en, + fr, ); mainGroup = D04BA1463D2A17038222BB84; productRefGroup = D04BA1A461BBB5A9BE15E015 /* Products */; @@ -435,6 +471,10 @@ files = ( D04BA8373D4DE452C0C081ED /* SF-Pro-Text-Regular.otf in Resources */, D04BA30F92801F5960ACC844 /* MainMenu.xib in Resources */, + D04BA79B891E9C89C015D6DD /* InfoPlist.strings in Resources */, + D04BAA0F39E6160F5703FC33 /* Localizable.strings in Resources */, + D04BAD1158CBCC76DE321555 /* InfoPlist.strings in Resources */, + D04BAEAB8AB048FF2B16B131 /* Localizable.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -489,6 +529,41 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXVariantGroup section */ + D04BA1ACE289DC4AD4826D1E /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + D04BA81CA2D9818FCA9E5024 /* fr */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + D04BAC0D42D7FED725746DA5 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + D04BA05F3F36A6D71DCD8475 /* en */, + ); + name = Localizable.strings; + sourceTree = ""; + }; + D04BAE5FA03065C5D23C0C2C /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + D04BA30247D04CEEC2DACEA8 /* fr */, + ); + name = Localizable.strings; + sourceTree = ""; + }; + D04BAEE5AEEB8692856B45E4 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + D04BADBCA16C1D448D34F473 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ D04BA49BCED00029C5289244 /* Release */ = { isa = XCBuildConfiguration; @@ -496,12 +571,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "alt-tab-macos/alt_tab_macos.entitlements"; CODE_SIGN_IDENTITY = "Local Self-Signed"; - COMBINE_HIDPI_IMAGES = YES; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = /System/Library/PrivateFrameworks; INFOPLIST_FILE = "alt-tab-macos/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.12; PRODUCT_BUNDLE_IDENTIFIER = "com.lwouis.alt-tab-macos"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 4.2; @@ -514,12 +587,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "alt-tab-macos/alt_tab_macos.entitlements"; CODE_SIGN_IDENTITY = "Local Self-Signed"; - COMBINE_HIDPI_IMAGES = YES; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = /System/Library/PrivateFrameworks; INFOPLIST_FILE = "alt-tab-macos/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.12; PRODUCT_BUNDLE_IDENTIFIER = "com.lwouis.alt-tab-macos"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 4.2; @@ -576,7 +647,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.12; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -630,7 +701,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.12; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; diff --git a/alt-tab-macos/Info.plist b/alt-tab-macos/Info.plist index 8316a74c..de7595e8 100644 --- a/alt-tab-macos/Info.plist +++ b/alt-tab-macos/Info.plist @@ -3,7 +3,7 @@ CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) + en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIconFile diff --git a/alt-tab-macos/resources/l10n/en.lproj/InfoPlist.strings b/alt-tab-macos/resources/l10n/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..ee78920b --- /dev/null +++ b/alt-tab-macos/resources/l10n/en.lproj/InfoPlist.strings @@ -0,0 +1,5 @@ +/* Bundle name */ +"CFBundleName" = "alt-tab-macos"; + +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "GPL-3.0 license"; diff --git a/alt-tab-macos/resources/l10n/en.lproj/Localizable.strings b/alt-tab-macos/resources/l10n/en.lproj/Localizable.strings new file mode 100644 index 00000000..bb6c5dd7 Binary files /dev/null and b/alt-tab-macos/resources/l10n/en.lproj/Localizable.strings differ diff --git a/alt-tab-macos/resources/l10n/fr.lproj/InfoPlist.strings b/alt-tab-macos/resources/l10n/fr.lproj/InfoPlist.strings new file mode 100644 index 00000000..0b9cfbfa --- /dev/null +++ b/alt-tab-macos/resources/l10n/fr.lproj/InfoPlist.strings @@ -0,0 +1,6 @@ +/* Bundle name */ +"CFBundleName" = "alt-tab-macos"; + +/* Copyright (human-readable) */ +"NSHumanReadableCopyright" = "Licence GPL-3.0"; + diff --git a/alt-tab-macos/resources/l10n/fr.lproj/Localizable.strings b/alt-tab-macos/resources/l10n/fr.lproj/Localizable.strings new file mode 100644 index 00000000..586d9f13 --- /dev/null +++ b/alt-tab-macos/resources/l10n/fr.lproj/Localizable.strings @@ -0,0 +1,102 @@ +/* No comment provided by engineer. */ +"About" = "À propos"; + +/* No comment provided by engineer. */ +"Alt key" = "Touche Alt"; + +/* No comment provided by engineer. */ +"Apparition delay" = "Délai d'apparition"; + +/* No comment provided by engineer. */ +"Appearance" = "Apparence"; + +/* No comment provided by engineer. */ +"Cancel" = "Annuler"; + +/* No comment provided by engineer. */ +"Check again" = "Essayer encore"; + +/* No comment provided by engineer. */ +"Could not save Preference" = "La préférence n’a pas pu être sauvée"; + +/* No comment provided by engineer. */ +"Edit" = "Éditer"; + +/* No comment provided by engineer. */ +"Hide space number labels" = "Cacher les numéraux des Espaces"; + +/* No comment provided by engineer. */ +"I think the app could be improved with…" = "Je pense que l’app pourrait être améliorée avec…"; + +/* No comment provided by engineer. */ +"KeyCodes Reference" = "Référence des codes de touche"; + +/* No comment provided by engineer. */ +"Latest releases" = "Dernières versions"; + +/* No comment provided by engineer. */ +"Max size on screen" = "Taille max à l’écran"; + +/* No comment provided by engineer. */ +"Max windows per row" = "Max de fenêtres par ligne"; + +/* No comment provided by engineer. */ +"Min rows of windows" = "Min de lignes de fenêtres"; + +/* No comment provided by engineer. */ +"Min windows per row" = "Min de fenêtres par ligne"; + +/* No comment provided by engineer. */ +"Optional: email (if you want a reply)" = "Optionnel: email (si vous voulez une réponse)"; + +/* No comment provided by engineer. */ +"Preferences…" = "Préférences…"; + +/* No comment provided by engineer. */ +"Quit" = "Quitter"; + +/* No comment provided by engineer. */ +"Send" = "Envoyer"; + +/* No comment provided by engineer. */ +"Send debug profile (CPU, memory, etc)" = "Envoyer un profile technique (processeur, mémoire, etc)"; + +/* No comment provided by engineer. */ +"Send feedback" = "Partager un retour d’expérience"; + +/* No comment provided by engineer. */ +"Send feedback…" = "Partager un retour d’expérience…"; + +/* No comment provided by engineer. */ +"Share improvement ideas, or report bugs" = "Partagez des idées d’amélioration, ou signalez des bugs"; + +/* No comment provided by engineer. */ +"Shortcuts" = "Raccourcis"; + +/* No comment provided by engineer. */ +"Show" = "Afficher"; + +/* No comment provided by engineer. */ +"Show on" = "Afficher sur"; + +/* No comment provided by engineer. */ +"Source code repository" = "Repo du code source"; + +/* No comment provided by engineer. */ +"Tab key" = "Touche Tab"; + +/* No comment provided by engineer. */ +"Theme" = "Thème"; + +/* No comment provided by engineer. */ +"Version " = "Version "; + +/* No comment provided by engineer. */ +"View existing discussions" = "Voir les discussions existantes"; + +/* No comment provided by engineer. */ +"Window app icon size" = "Taille des icones des applications"; + +/* No comment provided by engineer. */ +"Window title font size" = "Taille du titres des fenêtres"; + diff --git a/alt-tab-macos/ui/FeedbackWindow.swift b/alt-tab-macos/ui/FeedbackWindow.swift index 96e9a2bd..894e8841 100644 --- a/alt-tab-macos/ui/FeedbackWindow.swift +++ b/alt-tab-macos/ui/FeedbackWindow.swift @@ -18,7 +18,7 @@ class FeedbackWindow: NSWindow { } private func setupWindow() { - title = "Send feedback" + title = NSLocalizedString("Send feedback", comment: "") hidesOnDeactivate = false isReleasedWhenClosed = false styleMask.insert([.miniaturizable, .closable]) @@ -28,27 +28,27 @@ class FeedbackWindow: NSWindow { let appIcon = NSImageView(image: App.shared.applicationIconImage) appIcon.fit(80, 80) let appText = NSStackView(views: [ - BoldLabel("Share improvement ideas, or report bugs"), - HyperlinkLabel("View existing discussions", App.repository + "/issues"), + BoldLabel(NSLocalizedString("Share improvement ideas, or report bugs", comment: "")), + HyperlinkLabel(NSLocalizedString("View existing discussions", comment: ""), App.repository + "/issues"), ]) appText.orientation = .vertical appText.alignment = .left appText.spacing = GridView.interPadding / 2 let header = NSStackView(views: [appIcon, appText]) header.spacing = GridView.interPadding - sendButton = NSButton(title: "Send", target: nil, action: #selector(sendCallback)) + sendButton = NSButton(title: NSLocalizedString("Send", comment: ""), target: nil, action: #selector(sendCallback)) sendButton.keyEquivalent = "\r" sendButton.isEnabled = false let buttons = NSStackView(views: [ - NSButton(title: "Cancel", target: nil, action: #selector(cancelCallback)), + NSButton(title: NSLocalizedString("Cancel", comment: ""), target: nil, action: #selector(cancelCallback)), sendButton, ]) buttons.spacing = GridView.interPadding - body = TextArea(80, 12, "I think the app could be improved with…", { + body = TextArea(80, 12, NSLocalizedString("I think the app could be improved with…", comment: ""), { self.sendButton.isEnabled = !self.body.stringValue.isEmpty }) - email = TextArea(80, 1, "Optional: email (if you want a reply)") - debugProfile = NSButton(checkboxWithTitle: "Send debug profile (CPU, memory, etc)", target: nil, action: nil) + email = TextArea(80, 1, NSLocalizedString("Optional: email (if you want a reply)", comment: "")) + debugProfile = NSButton(checkboxWithTitle: NSLocalizedString("Send debug profile (CPU, memory, etc)", comment: ""), target: nil, action: nil) debugProfile.state = .on let view = GridView.make([ [header], diff --git a/alt-tab-macos/ui/Menubar.swift b/alt-tab-macos/ui/Menubar.swift index 42e916c3..3aaf2590 100644 --- a/alt-tab-macos/ui/Menubar.swift +++ b/alt-tab-macos/ui/Menubar.swift @@ -6,21 +6,21 @@ class Menubar { item.button!.title = "AltTab" item.menu = NSMenu() item.menu!.addItem( - withTitle: "Show", + withTitle: NSLocalizedString("Show", comment: ""), action: #selector(app.showUi), keyEquivalent: "s" ) item.menu!.addItem( - withTitle: "Preferences…", + withTitle: NSLocalizedString("Preferences…", comment: ""), action: #selector(app.showPreferencesPanel), keyEquivalent: ",") item.menu!.addItem( - withTitle: "Send feedback…", + withTitle: NSLocalizedString("Send feedback…", comment: ""), action: #selector(app.showFeedbackPanel), keyEquivalent: ",") item.menu!.addItem(NSMenuItem.separator()) item.menu!.addItem( - withTitle: "Quit \(App.name)", + withTitle: NSLocalizedString("Quit", comment: "") + " " + App.name, action: #selector(NSApplication.terminate(_:)), keyEquivalent: "q") return item diff --git a/alt-tab-macos/ui/preferences-window/PreferencesWindow.swift b/alt-tab-macos/ui/preferences-window/PreferencesWindow.swift index e9a42862..626ee746 100644 --- a/alt-tab-macos/ui/preferences-window/PreferencesWindow.swift +++ b/alt-tab-macos/ui/preferences-window/PreferencesWindow.swift @@ -72,11 +72,11 @@ class PreferencesWindow: NSWindow { private func showSaveErrorSheetModal(_ nsError: NSError, _ control: NSControl, _ key: String, _ previousValue: String) { let alert = NSAlert() - alert.messageText = "Could not save Preference" + alert.messageText = NSLocalizedString("Could not save Preference", comment: "") alert.informativeText = nsError.localizedDescription + "\n" - alert.addButton(withTitle: "Edit") - alert.addButton(withTitle: "Cancel") - alert.addButton(withTitle: "Check again") + alert.addButton(withTitle: NSLocalizedString("Edit", comment: "")) + alert.addButton(withTitle: NSLocalizedString("Cancel", comment: "")) + alert.addButton(withTitle: NSLocalizedString("Check again", comment: "")) alert.beginSheetModal(for: self, completionHandler: { (modalResponse: NSApplication.ModalResponse) -> Void in if modalResponse == NSApplication.ModalResponse.alertFirstButtonReturn { diff --git a/alt-tab-macos/ui/preferences-window/tabs/AboutTab.swift b/alt-tab-macos/ui/preferences-window/tabs/AboutTab.swift index dfb5d8e0..1015c95e 100644 --- a/alt-tab-macos/ui/preferences-window/tabs/AboutTab.swift +++ b/alt-tab-macos/ui/preferences-window/tabs/AboutTab.swift @@ -2,7 +2,7 @@ import Cocoa class AboutTab: NSObject { static func make() -> NSTabViewItem { - return TabViewItem.make("About", NSImage.infoName, makeView()) + return TabViewItem.make(NSLocalizedString("About", comment: ""), NSImage.infoName, makeView()) } static func makeView() -> NSGridView { @@ -10,10 +10,10 @@ class AboutTab: NSObject { appIcon.fit(150, 150) let appText = NSStackView(views: [ BoldLabel(App.name), - NSTextField(wrappingLabelWithString: "Version " + App.version), + NSTextField(wrappingLabelWithString: NSLocalizedString("Version ", comment: "") + App.version), NSTextField(wrappingLabelWithString: App.licence), - HyperlinkLabel("Source code repository", App.repository), - HyperlinkLabel("Latest releases", App.repository + "/releases"), + HyperlinkLabel(NSLocalizedString("Source code repository", comment: ""), App.repository), + HyperlinkLabel(NSLocalizedString("Latest releases", comment: ""), App.repository + "/releases"), ]) appText.orientation = .vertical appText.alignment = .left @@ -24,7 +24,7 @@ class AboutTab: NSObject { appInfo.spacing = GridView.interPadding let view = GridView.make([ [appInfo], - [NSButton(title: "Send feedback", target: self, action: #selector(feedbackCallback))], + [NSButton(title: NSLocalizedString("Send feedback", comment: ""), target: self, action: #selector(feedbackCallback))], ]) view.row(at: 1).topPadding = GridView.interPadding * 2 view.cell(atColumnIndex: 0, rowIndex: 1).xPlacement = .center diff --git a/alt-tab-macos/ui/preferences-window/tabs/AppearanceTab.swift b/alt-tab-macos/ui/preferences-window/tabs/AppearanceTab.swift index 41ffaf64..132bbc28 100644 --- a/alt-tab-macos/ui/preferences-window/tabs/AppearanceTab.swift +++ b/alt-tab-macos/ui/preferences-window/tabs/AppearanceTab.swift @@ -4,21 +4,21 @@ class AppearanceTab { private static let rowHeight = CGFloat(20) static func make() -> NSTabViewItem { - return TabViewItem.make("Shortcuts", NSImage.colorPanelName, makeView()) + return TabViewItem.make(NSLocalizedString("Appearance", comment: ""), NSImage.colorPanelName, makeView()) } private static func makeView() -> NSGridView { let view = GridView.make([ - LabelAndControl.makeLabelWithDropdown("Theme", "theme", Preferences.themeMacro.labels), - LabelAndControl.makeLabelWithSlider("Max size on screen", "maxScreenUsage", 10, 100, 10, true, "%"), - LabelAndControl.makeLabelWithSlider("Min windows per row", "minCellsPerRow", 1, 20, 20, true), - LabelAndControl.makeLabelWithSlider("Max windows per row", "maxCellsPerRow", 1, 40, 20, true), - LabelAndControl.makeLabelWithSlider("Min rows of windows", "minRows", 1, 20, 20, true), - LabelAndControl.makeLabelWithSlider("Window app icon size", "iconSize", 0, 64, 11, false, "px"), - LabelAndControl.makeLabelWithSlider("Window title font size", "fontHeight", 0, 64, 11, false, "px"), - LabelAndControl.makeLabelWithDropdown("Show on", "showOnScreen", Preferences.showOnScreenMacro.labels), - LabelAndControl.makeLabelWithSlider("Apparition delay", "windowDisplayDelay", 0, 2000, 11, false, "ms"), - LabelAndControl.makeLabelWithCheckbox("Hide space number labels", "hideSpaceNumberLabels"), + LabelAndControl.makeLabelWithDropdown(NSLocalizedString("Theme", comment: ""), "theme", Preferences.themeMacro.labels), + LabelAndControl.makeLabelWithSlider(NSLocalizedString("Max size on screen", comment: ""), "maxScreenUsage", 10, 100, 10, true, "%"), + LabelAndControl.makeLabelWithSlider(NSLocalizedString("Min windows per row", comment: ""), "minCellsPerRow", 1, 20, 20, true), + LabelAndControl.makeLabelWithSlider(NSLocalizedString("Max windows per row", comment: ""), "maxCellsPerRow", 1, 40, 20, true), + LabelAndControl.makeLabelWithSlider(NSLocalizedString("Min rows of windows", comment: ""), "minRows", 1, 20, 20, true), + LabelAndControl.makeLabelWithSlider(NSLocalizedString("Window app icon size", comment: ""), "iconSize", 0, 64, 11, false, "px"), + LabelAndControl.makeLabelWithSlider(NSLocalizedString("Window title font size", comment: ""), "fontHeight", 0, 64, 11, false, "px"), + LabelAndControl.makeLabelWithDropdown(NSLocalizedString("Show on", comment: ""), "showOnScreen", Preferences.showOnScreenMacro.labels), + LabelAndControl.makeLabelWithSlider(NSLocalizedString("Apparition delay", comment: ""), "windowDisplayDelay", 0, 2000, 11, false, "ms"), + LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Hide space number labels", comment: ""), "hideSpaceNumberLabels"), ]) view.column(at: 0).xPlacement = .trailing view.rowAlignment = .lastBaseline diff --git a/alt-tab-macos/ui/preferences-window/tabs/ShortcutsTab.swift b/alt-tab-macos/ui/preferences-window/tabs/ShortcutsTab.swift index 13651d15..401956e6 100644 --- a/alt-tab-macos/ui/preferences-window/tabs/ShortcutsTab.swift +++ b/alt-tab-macos/ui/preferences-window/tabs/ShortcutsTab.swift @@ -4,7 +4,7 @@ class ShortcutsTab { private static let rowHeight = CGFloat(20) static func make() -> NSTabViewItem { - return TabViewItem.make("Appearance", NSImage.preferencesGeneralName, makeView()) + return TabViewItem.make(NSLocalizedString("Shortcuts", comment: ""), NSImage.preferencesGeneralName, makeView()) } private static func makeView() -> NSGridView { // TODO: make the validators be a part of each Preference @@ -22,8 +22,8 @@ class ShortcutsTab { } let view = GridView.make([ - LabelAndControl.makeLabelWithDropdown("Alt key", "metaKey", Preferences.metaKeyMacro.labels), - LabelAndControl.makeLabelWithInput("Tab key", "tabKeyCode", 33, "KeyCodes Reference", "https://eastmanreference.com/complete-list-of-applescript-key-codes", tabKeyCodeValidator), + LabelAndControl.makeLabelWithDropdown(NSLocalizedString("Alt key", comment: ""), "metaKey", Preferences.metaKeyMacro.labels), + LabelAndControl.makeLabelWithInput(NSLocalizedString("Tab key", comment: ""), "tabKeyCode", 33, NSLocalizedString("KeyCodes Reference", comment: ""), "https://eastmanreference.com/complete-list-of-applescript-key-codes", tabKeyCodeValidator), ]) view.column(at: 0).xPlacement = .trailing view.rowAlignment = .lastBaseline