Skip to content

Commit

Permalink
feat: make more strings localisable (#102)
Browse files Browse the repository at this point in the history
and update he localization
  • Loading branch information
ShlomoCode authored Jul 9, 2024
1 parent d50b3c2 commit 9f80621
Show file tree
Hide file tree
Showing 4 changed files with 202 additions and 19 deletions.
4 changes: 2 additions & 2 deletions DockDoor/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
button.target = self

// Create Menu Items
let openSettingsMenuItem = NSMenuItem(title: "Open Settings", action: #selector(openSettingsWindow(_:)), keyEquivalent: "")
let openSettingsMenuItem = NSMenuItem(title: String(localized: "Open Settings"), action: #selector(openSettingsWindow(_:)), keyEquivalent: "")
openSettingsMenuItem.target = self
let quitMenuItem = NSMenuItem(title: "Quit DockDoor", action: #selector(quitAppWrapper), keyEquivalent: "q")
let quitMenuItem = NSMenuItem(title: String(localized: "Quit DockDoor"), action: #selector(quitAppWrapper), keyEquivalent: "q")
quitMenuItem.target = self

// Create the Menu
Expand Down
189 changes: 186 additions & 3 deletions DockDoor/Localization/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@
}
}
},
"Can you even see this?" : {
"comment" : "Window Size Option",
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "אתה בכלל יכול לראות את זה?"
}
}
}
},
"Check for Updates" : {
"localizations" : {
"he" : {
Expand Down Expand Up @@ -131,6 +142,17 @@
}
}
},
"Default (Medium Large)" : {
"comment" : "Window Size Option",
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "ברירת מחדל (בינוני גדול)"
}
}
}
},
"Enable Hover Window Sliding Animation" : {
"localizations" : {
"he" : {
Expand Down Expand Up @@ -161,6 +183,39 @@
}
}
},
"Extra Extra Small" : {
"comment" : "Window Size Option",
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "קטן מאוד מאוד"
}
}
}
},
"Extra Small" : {
"comment" : "Window Size Option",
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "קטן במיוחד"
}
}
}
},
"General" : {
"comment" : "Settings Tab",
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "ראשי"
}
}
}
},
"Get Started" : {
"localizations" : {
"he" : {
Expand All @@ -171,12 +226,12 @@
}
}
},
"Hover Window Open Delay: %.2f seconds" : {
"Hover Window Open Delay: %.1f seconds" : {
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "השהיית ריחוף לפני פתיחת תצוגה מקדימה: %.2f שניות"
"value" : "השהיית ריחוף לפני פתיחת תצוגה מקדימה: %.1f שניות"
}
}
}
Expand All @@ -191,6 +246,17 @@
}
}
},
"Large" : {
"comment" : "Window Size Option",
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "אתה בכלל יכול לראות את זה?"
}
}
}
},
"Last checked: %@" : {
"localizations" : {
"he" : {
Expand All @@ -201,6 +267,27 @@
}
}
},
"Launch DockDoor at login" : {
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "הפעל את DockDoor בכניסה"
}
}
}
},
"Medium" : {
"comment" : "Window Size Option",
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "בינוני"
}
}
}
},
"Open Accessibility Settings" : {
"localizations" : {
"he" : {
Expand All @@ -221,6 +308,16 @@
}
}
},
"Open Settings" : {
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "פתח את ההגדרות"
}
}
}
},
"Option (⌥)" : {
"localizations" : {
"he" : {
Expand All @@ -231,6 +328,17 @@
}
}
},
"Permissions" : {
"comment" : "Settings Tab",
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "הרשאות"
}
}
}
},
"Please Quit the App to Apply Changes! :)" : {
"localizations" : {
"he" : {
Expand Down Expand Up @@ -271,6 +379,16 @@
}
}
},
"Quit DockDoor" : {
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "צא מ-DockDoor"
}
}
}
},
"Screen Capturing:" : {
"localizations" : {
"he" : {
Expand Down Expand Up @@ -311,6 +429,17 @@
}
}
},
"Small" : {
"comment" : "Window Size Option",
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "קטן"
}
}
}
},
"Start Recording Keybind" : {
"localizations" : {
"he" : {
Expand All @@ -321,6 +450,17 @@
}
}
},
"Subatomic" : {
"comment" : "Window Size Option",
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "תת-אטומי"
}
}
}
},
"Up to date" : {
"localizations" : {
"he" : {
Expand All @@ -336,7 +476,18 @@
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "זמין עדכון"
"value" : "עדכון זמין"
}
}
}
},
"Updates" : {
"comment" : "Settings Tab",
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "עדכונים"
}
}
}
Expand All @@ -351,6 +502,16 @@
}
}
},
"Use Uniform Image Preview Radius" : {
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "כפה עיגול פינות אחיד לתצוגה המקדימה"
}
}
}
},
"Version %@" : {
"localizations" : {
"he" : {
Expand Down Expand Up @@ -381,6 +542,17 @@
}
}
},
"What is this? A window for ANTS?" : {
"comment" : "Window Size Option",
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "מה זה? חלון לנמלים?"
}
}
}
},
"Why we need permissions" : {
"localizations" : {
"he" : {
Expand Down Expand Up @@ -420,6 +592,17 @@
}
}
}
},
"Window Switcher" : {
"comment" : "Settings Tab",
"localizations" : {
"he" : {
"stringUnit" : {
"state" : "translated",
"value" : "מחליף חלונות"
}
}
}
}
},
"version" : "1.0"
Expand Down
20 changes: 10 additions & 10 deletions DockDoor/Views/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct SettingsView: View {

Divider()

LaunchAtLogin.Toggle("Launch DockDoor at login")
LaunchAtLogin.Toggle(String(localized: "Launch DockDoor at login"))
Toggle(isOn: $showAnimations, label: {
Text("Enable Hover Window Sliding Animation")
})
Expand Down Expand Up @@ -103,23 +103,23 @@ struct SizePickerView: View {
private func getLabel(for size: CGFloat) -> String {
switch size {
case 2:
return "Large"
return String(localized: "Large", comment: "Window Size Option")
case 3:
return "Default (Medium Large)"
return String(localized: "Default (Medium Large)", comment: "Window Size Option")
case 4:
return "Medium"
return String(localized:"Medium", comment: "Window Size Option")
case 5:
return "Small"
return String(localized:"Small", comment: "Window Size Option")
case 6:
return "Extra Small"
return String(localized:"Extra Small", comment: "Window Size Option")
case 7:
return "Extra Extra Small"
return String(localized:"Extra Extra Small", comment: "Window Size Option")
case 8:
return "What is this? A window for ANTS?"
return String(localized:"What is this? A window for ANTS?", comment: "Window Size Option")
case 9:
return "Subatomic"
return String(localized:"Subatomic", comment: "Window Size Option")
case 10:
return "Can you even see this?"
return String(localized:"Can you even see this?", comment: "Window Size Option")
default:
return "Unknown Size"
}
Expand Down
8 changes: 4 additions & 4 deletions DockDoor/Views/Settings/settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extension Settings.PaneIdentifier {
let GeneralSettingsViewController: () -> SettingsPane = {
let paneView = Settings.Pane(
identifier: .general,
title: "General",
title: String(localized:"General", comment: "Settings Tab"),
toolbarIcon: NSImage(systemSymbolName: "gearshape.fill", accessibilityDescription: "General settings")!
) {
SettingsView()
Expand All @@ -31,7 +31,7 @@ let GeneralSettingsViewController: () -> SettingsPane = {
let WindowSwitcherSettingsViewController: () -> SettingsPane = {
let paneView = Settings.Pane(
identifier: .alttab,
title: "Window Switcher",
title: String(localized: "Window Switcher", comment: "Settings Tab"),
toolbarIcon: NSImage(systemSymbolName: "text.and.command.macwindow", accessibilityDescription: "Windows switching settings")!
) {
WindowSwitcherSettingsView()
Expand All @@ -43,7 +43,7 @@ let WindowSwitcherSettingsViewController: () -> SettingsPane = {
let PermissionsSettingsViewController: () -> SettingsPane = {
let paneView = Settings.Pane(
identifier: .permissions,
title: "Permissions",
title: String(localized:"Permissions", comment: "Settings Tab"),
toolbarIcon: NSImage(systemSymbolName: "lock.shield", accessibilityDescription: "Permissions settings")!
) {
PermView()
Expand All @@ -55,7 +55,7 @@ let PermissionsSettingsViewController: () -> SettingsPane = {
func UpdatesSettingsViewController(updater: SPUUpdater) -> SettingsPane {
let paneView = Settings.Pane(
identifier: .updates,
title: "Updates",
title: String(localized:"Updates", comment: "Settings Tab"),
toolbarIcon: NSImage(systemSymbolName: "arrow.triangle.2.circlepath", accessibilityDescription: "Update settings")!
) {
UpdateView(updater: updater)
Expand Down

0 comments on commit 9f80621

Please sign in to comment.