Skip to content

Commit

Permalink
feat: updated german and hungarian localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Jul 20, 2020
1 parent 11fb95d commit 7a23046
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 42 deletions.
2 changes: 1 addition & 1 deletion resources/l10n/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"Allowed" = "Erlaubt";

/*No comment provided by engineer.*/
"AltTab needs some permissions" = "AltTab braucht einige Erlaubnisse";
"AltTab needs some permissions" = "AltTab braucht einige Berechtigungen";

/*No comment provided by engineer.*/
"Apparition delay:" = "Verzögertes Einblenden:";
Expand Down
52 changes: 26 additions & 26 deletions resources/l10n/hu.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"About" = "Az App-ról";

/*No comment provided by engineer.*/
"Accessibility" = "Accessibility";
"Accessibility" = "Kisegítő lehetőségek";

/*No comment provided by engineer.*/
"Acknowledgments" = "Köszönetnyílvánítás";
Expand All @@ -24,7 +24,7 @@
"All apps" = "Minden alkalmazás";

/*No comment provided by engineer.*/
"All data from this form will be made public, as a ticket on github.com" = "All data from this form will be made public, as a ticket on github.com";
"All data from this form will be made public, as a ticket on github.com" = "Minden adat amit ezen az űrlapon megadott publikus lesz egy Github jegy formájában";

/*No comment provided by engineer.*/
"All screens" = "Minden képernyő";
Expand All @@ -33,10 +33,10 @@
"All spaces" = "Minden terület";

/*No comment provided by engineer.*/
"Allowed" = "Allowed";
"Allowed" = "Engedélyezve";

/*No comment provided by engineer.*/
"AltTab needs some permissions" = "AltTab needs some permissions";
"AltTab needs some permissions" = "Az AltTab-nak néhány jogosultságra van szüksége";

/*No comment provided by engineer.*/
"Apparition delay:" = "Megjelenítés késleltetése:";
Expand All @@ -45,7 +45,7 @@
"Appearance" = "Megjelenés";

/*No comment provided by engineer.*/
"Are you sure you don’t want a response?" = "Are you sure you don’t want a response?";
"Are you sure you don’t want a response?" = "Biztos benne, hogy letiltja az értesítéseket?";

/*No comment provided by engineer.*/
"Arrow keys" = "Nyíl billentyűk";
Expand All @@ -54,7 +54,7 @@
"Auto-install updates periodically" = "Frissítések automatikus telepítése";

/*No comment provided by engineer.*/
"Blacklists" = "Blacklists";
"Blacklists" = "Tiltó lista";

/*Cancel button*/
"Cancel" = "Mégsem";
Expand All @@ -81,16 +81,16 @@
"Don’t check for updates periodically" = "Ne keressen frissítéseket automatikusan";

/*No comment provided by engineer.*/
"Don’t show windows from these apps" = "Don’t show windows from these apps";
"Don’t show windows from these apps" = "Ablakok elrejtése ezekből az alkalmazásokból";

/*No comment provided by engineer.*/
"End" = "End";
"End" = "Befejezés";

/*No comment provided by engineer.*/
"Fade out animation:" = "Fade out animation:";
"Fade out animation:" = "Áttűnési animáció:";

/*No comment provided by engineer.*/
"Fullscreen" = "Fullscreen";
"Fullscreen" = "Teljes képernyő";

/*No comment provided by engineer.*/
"General" = "Általános";
Expand All @@ -99,7 +99,7 @@
"Hidden" = "Rejtett";

/*No comment provided by engineer.*/
"Hide menubar icon:" = "Hide menubar icon:";
"Hide menubar icon:" = "Menü elrejtése:";

/*No comment provided by engineer.*/
"Hide space number labels:" = "Számok elrejtése a terület cimkékben:";
Expand All @@ -114,7 +114,7 @@
"I think the app could be improved with…" = "Azt gondolom hasznos lenne az app bővítése ezzel…";

/*No comment provided by engineer.*/
"Ignore shortcuts while a window from these apps is active" = "Ignore shortcuts while a window from these apps is active";
"Ignore shortcuts while a window from these apps is active" = "Parancsikonok kihagyása amikor van aktív ablak ezekből az alkalmazásokból";

/*No comment provided by engineer.*/
"Latest releases" = "Legutóbbi kiadások";
Expand All @@ -129,7 +129,7 @@
"Max windows per row:" = "Legtöbb ablak soronként:";

/*No comment provided by engineer.*/
"Middle" = "Middle";
"Middle" = "Középre";

/*No comment provided by engineer.*/
"Min windows per row:" = "Legkevesebb ablak soronként:";
Expand All @@ -144,19 +144,19 @@
"Mouse hover" = "Egér főlé vitele";

/*No comment provided by engineer.*/
"Not allowed" = "Not allowed";
"Not allowed" = "Nincs engedélyezve";

/*Copyright (human-readable)*/
"NSHumanReadableCopyright" = "GPL-3.0 license";

/*No comment provided by engineer.*/
"Only if the window is fullscreen" = "Only if the window is fullscreen";
"Only if the window is fullscreen" = "Csak ha az ablak teljesképernyős ";

/*No comment provided by engineer.*/
"Open Accessibility Preferences…" = "Open Accessibility Preferences…";
"Open Accessibility Preferences…" = "Kisegítő lehetőségek megnyitása…";

/*No comment provided by engineer.*/
"Open Screen Recording Preferences…" = "Open Screen Recording Preferences…";
"Open Screen Recording Preferences…" = "Képernyőfelvételi beállítások megnyitása…";

/*No comment provided by engineer.*/
"Optional: email (if you want a reply)" = "Opcionális: email (ha választ szeretnél kapni)";
Expand All @@ -165,7 +165,7 @@
"Preferences…" = "Beállítások…";

/*No comment provided by engineer.*/
"Quit" = "Quit";
"Quit" = "Kilépés";

/*No comment provided by engineer.*/
"Quit %@" = "Kilépés %@";
Expand All @@ -183,7 +183,7 @@
"Screen including mouse" = "A képernyő ahol az egér van";

/*No comment provided by engineer.*/
"Screen Recording" = "Screen Recording";
"Screen Recording" = "Képernyő felvétel";

/*No comment provided by engineer.*/
"Screen showing AltTab" = "Az AltTab képernyője";
Expand All @@ -201,7 +201,7 @@
"Send" = "Küldés";

/*No comment provided by engineer.*/
"Send anyway" = "Send anyway";
"Send anyway" = "Küldés mindenképp";

/*No comment provided by engineer.*/
"Send debug profile (CPU, memory, etc)" = "Hibakeresési profil (CPU, memória, stb.) küldése";
Expand All @@ -222,7 +222,7 @@
"Show on:" = "Megjelenítés:";

/*No comment provided by engineer.*/
"Show standard tabs as windows:" = "Show standard tabs as windows:";
"Show standard tabs as windows:" = "Szabványos lapok megjelenítése ablakokként:";

/*No comment provided by engineer.*/
"Show the following windows:" = "Megjelenítendő ablakok kiválasztása:";
Expand All @@ -231,7 +231,7 @@
"Source code repository" = "Forrás kód tárhely";

/*No comment provided by engineer.*/
"Start" = "Start";
"Start" = "Indítás";

/*No comment provided by engineer.*/
"Start at login:" = "Betöltés bejelentkezéskor:";
Expand All @@ -243,10 +243,10 @@
"then press:" = "majd nyomjon:";

/*No comment provided by engineer.*/
"This permission is needed to focus windows after you release the shortcut" = "This permission is needed to focus windows after you release the shortcut";
"This permission is needed to focus windows after you release the shortcut" = "Ez a jogosultság ahhoz szükséges hogy az ablak fókuszba kerüljön miután a parancsikont elengedte";

/*No comment provided by engineer.*/
"This permission is needed to show screenshots and titles of open windows" = "This permission is needed to show screenshots and titles of open windows";
"This permission is needed to show screenshots and titles of open windows" = "Ez a jogosultság ahhoz szükséges hogy megjeleníthessük a képernyőképeket és csempéket a nyitott ablakokhoz";

/*No comment provided by engineer.*/
"Updates" = "Frissítések";
Expand All @@ -267,7 +267,7 @@
"Window title font size:" = "Ablak címsor font méret:";

/*No comment provided by engineer.*/
"Window title truncation:" = "Window title truncation:";
"Window title truncation:" = "Ablak címsor rövidítése:";

/*No comment provided by engineer.*/
"You didn’t write your email, thus can’t receive any response." = "You didn’t write your email, thus can’t receive any response.";
"You didn’t write your email, thus can’t receive any response." = "Ha nem ad meg e-mail címet, nem tudunk választ küldeni";
12 changes: 6 additions & 6 deletions src/logic/Application.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Application: NSObject {
}

deinit {
debugPrint("Deinit app", runningApplication.bundleIdentifier ?? "nil")
debugPrint("Deinit app", runningApplication.bundleIdentifier ?? runningApplication.bundleURL ?? "nil")
}

func addAndObserveWindows() {
Expand All @@ -48,9 +48,9 @@ class Application: NSObject {
}
}

func observeNewWindows() {
func observeNewWindows(_ group: DispatchGroup? = nil) {
if runningApplication.isFinishedLaunching && runningApplication.activationPolicy != .prohibited {
retryAxCallUntilTimeout({ [weak self] in
retryAxCallUntilTimeout(group) { [weak self] in
guard let self = self else { return }
if let windows_ = try self.axUiElement!.windows(), windows_.count > 0 {
// bug in macOS: sometimes the OS returns multiple duplicate windows (e.g. Mail.app starting at login)
Expand All @@ -71,7 +71,7 @@ class Application: NSObject {
self.addWindows(windows)
}
}
})
}
}
}

Expand All @@ -92,7 +92,7 @@ class Application: NSObject {
private func observeEvents() {
guard let axObserver = axObserver else { return }
for notification in Application.notifications(runningApplication) {
retryAxCallUntilTimeout({ [weak self] in
retryAxCallUntilTimeout { [weak self] in
guard let self = self else { return }
try self.axUiElement!.subscribeToNotification(axObserver, notification, {
DispatchQueue.main.async { [weak self] in
Expand All @@ -105,7 +105,7 @@ class Application: NSObject {
}
}
}, self.runningApplication)
})
}
}
CFRunLoopAddSource(BackgroundWork.accessibilityEventsThread.runLoop, AXObserverGetRunLoopSource(axObserver), .defaultMode)
}
Expand Down
11 changes: 10 additions & 1 deletion src/logic/Applications.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ class Applications {
}
}

static func observeNewWindowsBlocking() {
let group = DispatchGroup()
for app in list {
guard app.runningApplication.isFinishedLaunching else { continue }
app.observeNewWindows(group)
}
group.wait(wallTimeout: .now() + .seconds(1))
}

static func initialDiscovery() {
addInitialRunningApplications()
addInitialRunningApplicationsWindows()
Expand All @@ -32,7 +41,7 @@ class Applications {
if windowsOnlyOnOtherSpaces.count > 0 {
// on initial launch, we use private APIs to bring windows from other spaces into the current space, observe them, then remove them from the current space
CGSAddWindowsToSpaces(cgsMainConnectionId, windowsOnlyOnOtherSpaces as NSArray, [Spaces.currentSpaceId])
Applications.observeNewWindows()
Applications.observeNewWindowsBlocking()
CGSRemoveWindowsFromSpaces(cgsMainConnectionId, windowsOnlyOnOtherSpaces as NSArray, [Spaces.currentSpaceId])
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/logic/Window.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ class Window {
AXObserverCreate(application.runningApplication.processIdentifier, axObserverCallback, &axObserver)
guard let axObserver = axObserver else { return }
for notification in Window.notifications {
retryAxCallUntilTimeout({ [weak self] in
retryAxCallUntilTimeout { [weak self] in
guard let self = self else { return }
try self.axUiElement.subscribeToNotification(axObserver, notification, nil, nil, self.cgWindowId)
})
}
}
CFRunLoopAddSource(BackgroundWork.accessibilityEventsThread.runLoop, AXObserverGetRunLoopSource(axObserver), .defaultMode)
}
Expand Down Expand Up @@ -99,7 +99,7 @@ class Window {
if self.isFullscreen {
self.axUiElement.setAttribute(kAXFullscreenAttribute, false)
// minimizing is ignored if sent immediatly; we wait for the de-fullscreen animation to be over
BackgroundWork.accessibilityCommandsQueue.asyncWithCap(.now() + .milliseconds(1000)) { [weak self] in
BackgroundWork.accessibilityCommandsQueue.asyncWithCap(.now() + .seconds(1)) { [weak self] in
guard let self = self else { return }
self.axUiElement.setAttribute(kAXMinimizedAttribute, true)
}
Expand Down
12 changes: 7 additions & 5 deletions src/logic/events/AccessibilityEvents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@ import Cocoa

func axObserverCallback(observer: AXObserver, element: AXUIElement, notificationName: CFString, _: UnsafeMutableRawPointer?) -> Void {
let type = notificationName as String
retryAxCallUntilTimeout({ try handleEvent(type, element) })
retryAxCallUntilTimeout { try handleEvent(type, element) }
}

// if the window server is busy, it may not reply to AX calls. We retry right before the call times-out and returns a bogus value
func retryAxCallUntilTimeout(_ fn: @escaping () throws -> Void, _ startTime: DispatchTime = DispatchTime.now()) {
func retryAxCallUntilTimeout(_ group: DispatchGroup? = nil, _ fn: @escaping () throws -> Void, _ startTime: DispatchTime = DispatchTime.now()) {
group?.enter()
BackgroundWork.axCallsQueue.async {
retryAxCallUntilTimeout_(fn, startTime)
retryAxCallUntilTimeout_(group, fn, startTime)
}
}

func retryAxCallUntilTimeout_(_ fn: @escaping () throws -> Void, _ startTime: DispatchTime = DispatchTime.now()) {
func retryAxCallUntilTimeout_(_ group: DispatchGroup?, _ fn: @escaping () throws -> Void, _ startTime: DispatchTime = DispatchTime.now()) {
do {
try fn()
group?.leave()
} catch {
let timePassedInSeconds = Double(DispatchTime.now().uptimeNanoseconds - startTime.uptimeNanoseconds) / 1_000_000_000
if timePassedInSeconds < Double(AXUIElement.globalTimeoutInSeconds) {
BackgroundWork.axCallsQueue.asyncAfter(deadline: .now() + .milliseconds(10)) {
retryAxCallUntilTimeout_(fn, startTime)
retryAxCallUntilTimeout_(group, fn, startTime)
}
}
}
Expand Down

0 comments on commit 7a23046

Please sign in to comment.