Skip to content

Commit

Permalink
Updated screenShotAltText to reside in UpdateElement. Updated Example…
Browse files Browse the repository at this point in the history
… Assets with screenShotAltText alterations.
  • Loading branch information
samuelzamvil authored and erikng committed Nov 14, 2023
1 parent 800f6e4 commit 74e5a30
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
13 changes: 8 additions & 5 deletions Example Assets/com.github.macadmins.Nudge.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"iconLightPath": "/somewhere/logoLight.png",
"screenShotDarkPath": "/somewhere/screenShotDark.png",
"screenShotLightPath": "/somewhere/screenShotLight.png",
"screenShotAltText": "Click to zoom into screenshot",
"showDeferralCount": true,
"simpleMode": false,
"singleQuitButton": false,
Expand All @@ -93,7 +92,8 @@
"oneHourDeferralButtonText": "One Hour",
"primaryQuitButtonText": "Later",
"secondaryQuitButtonText": "I understand",
"subHeader": "A friendly reminder from your local IT team"
"subHeader": "A friendly reminder from your local IT team",
"screenShotAltText": "Click to zoom into screenshot"
},
{
"_language": "es",
Expand All @@ -106,7 +106,8 @@
"mainHeader": "Tu dispositivo requiere una actualización de seguridad",
"primaryQuitButtonText": "Más tarde",
"secondaryQuitButtonText": "Entiendo",
"subHeader": "Un recordatorio amistoso de su equipo de IT local"
"subHeader": "Un recordatorio amistoso de su equipo de IT local",
"screenShotAltText": "Haga clic para ampliar la captura de pantalla"
},
{
"_language": "fr",
Expand All @@ -119,7 +120,8 @@
"mainHeader": "Votre appareil nécessite une mise à jour de sécurité.",
"primaryQuitButtonText": "Plus tard",
"secondaryQuitButtonText": "Je comprends",
"subHeader": "Un rappel amical de votre équipe informatique locale"
"subHeader": "Un rappel amical de votre équipe informatique locale",
"screenShotAltText": "Cliquez pour agrandir la capture d'écran"
},
{
"_language": "de",
Expand All @@ -132,7 +134,8 @@
"mainHeader": "Ihr Gerät benötigt ein Sicherheitsupdate",
"primaryQuitButtonText": "Später",
"secondaryQuitButtonText": "Ich verstehe",
"subHeader": "Eine freundliche Erinnerung von Ihrem IT-Team"
"subHeader": "Eine freundliche Erinnerung von Ihrem IT-Team",
"screenShotAltText": "Hier klicken, um den Screenshot zu vergrößern"
}
]
}
Expand Down
10 changes: 8 additions & 2 deletions Example Assets/com.github.macadmins.Nudge.mobileconfig
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@
<string>/somewhere/screenShotDark.png</string>
<key>screenShotLightPath</key>
<string>/somewhere/screenShotLight.png</string>
<key>screenShotAltText</key>
<string>Click to zoom into screenshot</string>
<key>showDeferralCount</key>
<true/>
<key>simpleMode</key>
Expand Down Expand Up @@ -200,6 +198,8 @@
<string>I understand</string>
<key>subHeader</key>
<string>A friendly reminder from your local IT team</string>
<key>screenShotAltText</key>
<string>Click to zoom into screenshot</string>
</dict>
<dict>
<key>_language</key>
Expand Down Expand Up @@ -228,6 +228,8 @@
<string>Entiendo</string>
<key>subHeader</key>
<string>Un recordatorio amistoso de su equipo de IT local</string>
<key>screenShotAltText</key>
<string>Haga clic para ampliar la captura de pantalla</string>
</dict>
<dict>
<key>_language</key>
Expand Down Expand Up @@ -256,6 +258,8 @@
<string>Je comprends</string>
<key>subHeader</key>
<string>Un rappel amical de votre équipe informatique locale</string>
<key>screenShotAltText</key>
<string>Cliquez pour agrandir la capture d'écran</string>
</dict>
<dict>
<key>_language</key>
Expand Down Expand Up @@ -283,6 +287,8 @@
<string>Ich verstehe</string>
<key>subHeader</key>
<string>Eine freundliche Erinnerung von Ihrem IT-Team</string>
<key>screenShotAltText</key>
<string>Hier klicken, um den Screenshot zu vergrößern</string>
</dict>
</array>
</dict>
Expand Down
3 changes: 2 additions & 1 deletion Example Assets/com.github.macadmins.Nudge.tester.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
"oneHourDeferralButtonText": "oneHourDeferralButtonText",
"primaryQuitButtonText": "primaryQuitButtonText",
"secondaryQuitButtonText": "secondaryQuitButtonText",
"subHeader": "subHeader"
"subHeader": "subHeader",
"screenShotAltText": "Click to zoom into screenshot"
}
]
}
Expand Down
10 changes: 5 additions & 5 deletions Nudge/Preferences/PreferencesStructure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ extension UserExperience {
struct UserInterface: Codable {
var actionButtonPath, fallbackLanguage: String?
var forceFallbackLanguage, forceScreenShotIcon: Bool?
var iconDarkPath, iconLightPath, screenShotDarkPath, screenShotLightPath, screenShotAltText: String?
var iconDarkPath, iconLightPath, screenShotDarkPath, screenShotLightPath: String?
var showDeferralCount, simpleMode, singleQuitButton: Bool?
var updateElements: [UpdateElement]?
}
Expand Down Expand Up @@ -387,7 +387,6 @@ extension UserInterface {
iconLightPath: String?? = nil,
screenShotDarkPath: String?? = nil,
screenShotLightPath: String?? = nil,
screenShotAltText: String?? = nil,
showDeferralCount: Bool?? = nil,
simpleMode: Bool?? = nil,
singleQuitButton: Bool?? = nil,
Expand All @@ -402,7 +401,6 @@ extension UserInterface {
iconLightPath: iconLightPath ?? self.iconLightPath,
screenShotDarkPath: screenShotDarkPath ?? self.screenShotDarkPath,
screenShotLightPath: screenShotLightPath ?? self.screenShotLightPath,
screenShotAltText: screenShotAltText ?? self.screenShotAltText,
showDeferralCount: showDeferralCount ?? self.showDeferralCount,
simpleMode: simpleMode ?? self.simpleMode,
singleQuitButton: singleQuitButton ?? self.simpleMode,
Expand Down Expand Up @@ -463,7 +461,8 @@ extension UpdateElement {
oneHourDeferralButtonText: String?? = nil,
primaryQuitButtonText: String?? = nil,
secondaryQuitButtonText: String?? = nil,
subHeader: String?? = nil
subHeader: String?? = nil,
screenShotAltText: String?? = nil
) -> UpdateElement {
return UpdateElement(
language: language ?? self.language,
Expand All @@ -480,7 +479,8 @@ extension UpdateElement {
oneHourDeferralButtonText: oneHourDeferralButtonText ?? self.oneHourDeferralButtonText,
primaryQuitButtonText: primaryQuitButtonText ?? self.primaryQuitButtonText,
secondaryQuitButtonText: secondaryQuitButtonText ?? self.secondaryQuitButtonText,
subHeader: subHeader ?? self.subHeader
subHeader: subHeader ?? self.subHeader,
screenShotAltText: screenShotAltText ?? self.screenShotAltText
)
}

Expand Down
2 changes: 1 addition & 1 deletion Nudge/UI/StandardMode/RightSide.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ struct StandardModeRightSide: View {
.frame(maxHeight: screenshotMaxHeight)
}
.buttonStyle(.plain)
.help("Click to zoom into screenshot".localized(desiredLanguage: getDesiredLanguage(locale: appState.locale)))
.help(screenShotAltText.localized(desiredLanguage: getDesiredLanguage(locale: appState.locale)))
.sheet(isPresented: $appState.screenShotZoomViewIsPresented) {
ScreenShotZoom()
}
Expand Down

0 comments on commit 74e5a30

Please sign in to comment.