Skip to content

Commit

Permalink
fix: localization + dynamic replacement options not saving
Browse files Browse the repository at this point in the history
  • Loading branch information
khcrysalis committed Jan 30, 2025
1 parent 4c8faf9 commit 6ca9832
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Shared/Localizations/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_PRO_MOTION_DESCRIPTION" = "Enables ProMotion capabilities within the app, however on lower versions of 15.x this may not be enough.";

"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE" = "Force Game Mode";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_PRO_MOTION_DESCRIPTION" = "Enables Game Mode within the app, minimizing background activity and prioritized performance for the app.";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE_DESCRIPTION" = "Enables Game Mode within the app, minimizing background activity and prioritized performance for the app.";

"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_FULLSCREEN" = "Force Fullscreen";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_FULLSCREEN_DESCRIPTION" = "Forces only fullscreen capabilities within iPad apps, disallowing sharing the screen with other apps. On an external screen, the window for an app with this setting maintains its canvas size.";
Expand Down
2 changes: 1 addition & 1 deletion Shared/Localizations/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_PRO_MOTION_DESCRIPTION" = "Enables ProMotion capabilities within the app, however on lower versions of 15.x this may not be enough.";

"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE" = "Force Game Mode";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_PRO_MOTION_DESCRIPTION" = "Enables Game Mode within the app, minimizing background activity and prioritized performance for the app.";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE_DESCRIPTION" = "Enables Game Mode within the app, minimizing background activity and prioritized performance for the app.";

"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_FULLSCREEN" = "Force Fullscreen";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_FULLSCREEN_DESCRIPTION" = "Forces only fullscreen capabilities within iPad apps, disallowing sharing the screen with other apps. On an external screen, the window for an app with this setting maintains its canvas size.";
Expand Down
2 changes: 1 addition & 1 deletion Shared/Localizations/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_PRO_MOTION_DESCRIPTION" = "Enables ProMotion capabilities within the app, however on lower versions of 15.x this may not be enough.";

"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE" = "Force Game Mode";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_PRO_MOTION_DESCRIPTION" = "Enables Game Mode within the app, minimizing background activity and prioritized performance for the app.";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE_DESCRIPTION" = "Enables Game Mode within the app, minimizing background activity and prioritized performance for the app.";

"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_FULLSCREEN" = "Force Fullscreen";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_FULLSCREEN_DESCRIPTION" = "Forces only fullscreen capabilities within iPad apps, disallowing sharing the screen with other apps. On an external screen, the window for an app with this setting maintains its canvas size.";
Expand Down
2 changes: 1 addition & 1 deletion Shared/Localizations/fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_PRO_MOTION_DESCRIPTION" = "Enables ProMotion capabilities within the app, however on lower versions of 15.x this may not be enough.";

"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE" = "Force Game Mode";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_PRO_MOTION_DESCRIPTION" = "Enables Game Mode within the app, minimizing background activity and prioritized performance for the app.";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE_DESCRIPTION" = "Enables Game Mode within the app, minimizing background activity and prioritized performance for the app.";

"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_FULLSCREEN" = "Force Fullscreen";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_FULLSCREEN_DESCRIPTION" = "Forces only fullscreen capabilities within iPad apps, disallowing sharing the screen with other apps. On an external screen, the window for an app with this setting maintains its canvas size.";
Expand Down
2 changes: 1 addition & 1 deletion Shared/Localizations/ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_PRO_MOTION_DESCRIPTION" = "Включает возможности ProMotion в приложении, однако на более низких версиях 15.x этого может быть недостаточно.";

"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE" = "Force Game Mode";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_PRO_MOTION_DESCRIPTION" = "Enables Game Mode within the app, minimizing background activity and prioritized performance for the app.";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE_DESCRIPTION" = "Enables Game Mode within the app, minimizing background activity and prioritized performance for the app.";

"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_FULLSCREEN" = "Принудить полноэкранный режим";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_FULLSCREEN_DESCRIPTION" = "Принудительно включает только полноэкранные возможности в приложениях для iPad, запрещая совместное использование экрана с другими приложениями. На внешнем экране окно приложения с этой настройкой сохраняет свой размер холста.";
Expand Down
2 changes: 1 addition & 1 deletion Shared/Localizations/zh.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_PRO_MOTION_DESCRIPTION" = "在应用程序中启用 ProMotion 功能,但在 15.x 的较低版本上可能还不够。";

"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE" = "Force Game Mode";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_PRO_MOTION_DESCRIPTION" = "Enables Game Mode within the app, minimizing background activity and prioritized performance for the app.";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE_DESCRIPTION" = "Enables Game Mode within the app, minimizing background activity and prioritized performance for the app.";

"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_FULLSCREEN" = "强制全屏";
"APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_FULLSCREEN_DESCRIPTION" = "仅在 iPad 应用程序中启用全屏功能,不允许与其他应用程序共享屏幕。在外部屏幕上,启用此设置的应用程序窗口将保持画布大小。";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class IdentifiersViewController: UITableViewController {
let key = signingDataWrapper.signingOptions.displayNameConfig.keys.sorted()[index]
signingDataWrapper.signingOptions.displayNameConfig.removeValue(forKey: key)
}
NotificationCenter.default.post(name: Notification.Name("saveOptions"), object: nil)
tableView.reloadData()
}

Expand All @@ -113,6 +114,7 @@ class IdentifiersViewController: UITableViewController {
case .none:
break
}
NotificationCenter.default.post(name: Notification.Name("saveOptions"), object: nil)
self?.tableView.reloadData()
}
navigationController?.pushViewController(addVC, animated: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func toggleOptions(signingDataWrapper: SigningDataWrapper) -> [TogglesOption] {
),
TogglesOption(
title: String.localized("APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE"),
footer: String.localized("APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_PRO_MOTION_DESCRIPTION"),
footer: String.localized("APP_SIGNING_INPUT_VIEW_CONTROLLER_REMOVE_FORCE_GAME_MODE_DESCRIPTION"),
binding: signingDataWrapper.signingOptions.forceGameMode
),
TogglesOption(
Expand Down Expand Up @@ -88,6 +88,20 @@ class SigningsOptionViewController: UITableViewController {
self.appsViewController = appsViewController
self.toggleOptions = feather.toggleOptions(signingDataWrapper: signingDataWrapper)
super.init(style: .insetGrouped)

NotificationCenter.default.addObserver(self, selector: #selector(save), name: Notification.Name("saveOptions"), object: nil)
}

deinit {
NotificationCenter.default.removeObserver(self, name: Notification.Name("saveOptions"), object: nil)
}

@objc func save() {
self.saveOptions()
}

func saveOptions() {
UserDefaults.standard.signingOptions = signingDataWrapper.signingOptions
}

required init?(coder: NSCoder) {
Expand Down Expand Up @@ -175,7 +189,7 @@ class SigningsOptionViewController: UITableViewController {
break
}

UserDefaults.standard.signingOptions = signingDataWrapper.signingOptions
saveOptions()
}
}

Expand Down

0 comments on commit 6ca9832

Please sign in to comment.