Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 94 additions & 5 deletions Delta.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Delta/Database/Repair/RepairDatabaseViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private extension RepairDatabaseViewController
{
case .failure(let error):
DispatchQueue.main.async {
let alertController = UIAlertController(title: "Unable to Repair Games", error: error)
let alertController = UIAlertController(title: NSLocalizedString("Unable to Repair Games", comment: ""), error: error)
self.present(alertController, animated: true)
}

Expand All @@ -87,7 +87,7 @@ private extension RepairDatabaseViewController
switch result
{
case .failure(let error):
let alertController = UIAlertController(title: "Unable to Repair Save Files", error: error)
let alertController = UIAlertController(title: NSLocalizedString("Unable to Repair Save Files", comment: ""), error: error)
self.present(alertController, animated: true)

case .success:
Expand Down
3 changes: 2 additions & 1 deletion Delta/Emulation/GameViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2593,7 +2593,8 @@ private extension GameViewController
toastView.show(in: self.view, duration: 4.0)
} else {
let title = String(format: NSLocalizedString("✅ Achievement Unlocked", comment: ""))
let message = String(AttributedString(localized: "\(achievement.title) (^[\(achievement.points) \("point")](inflect: true))").characters)
let point = String(localized: "point")
let message = String(AttributedString(localized: "\(achievement.title) (^[\(achievement.points) \(point)](inflect: true))").characters)

let toastView = RSTToastView(text: title, detailText: message)
toastView.detailTextLabel.textAlignment = .center
Expand Down
127 changes: 64 additions & 63 deletions Delta/Extensions/PauseViewController+Lu.swift

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Delta/Launch/WhatsNewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ extension WhatsNewCollectionViewCell
{
func configure(with feature: WhatsNewViewController.NewFeature)
{
self.nameLabel.text = feature.name
self.captionLabel.text = feature.caption
self.nameLabel.text = feature.localizedName
self.captionLabel.text = feature.localizedCaption
self.imageView.image = feature.image

if feature.isPatronExclusive
Expand Down
10 changes: 10 additions & 0 deletions Delta/Launch/WhatsNewViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ extension WhatsNewViewController
var fallbackIcon: String?

var isPatronExclusive: Bool

var localizedName: String
{
Bundle.main.localizedString(forKey: self.name, value: self.name, table: nil)
}

var localizedCaption: String
{
Bundle.main.localizedString(forKey: self.caption, value: self.caption, table: nil)
}

var image: UIImage? {
if let image = UIImage(systemName: self.icon)
Expand Down
7 changes: 6 additions & 1 deletion Delta/RetroAchievements/AchievementGameBanner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import SwiftUI
struct AchievementGameBanner: View
{
let game: AchievementsManager.Game

private var pointUnit: String
{
game.currentPoints == 1 ? String(localized: "pt") : String(localized: "pts")
}

private var bannerContent: some View
{
Expand All @@ -36,7 +41,7 @@ struct AchievementGameBanner: View
}
}

Text("\(game.currentPoints.formatted()) \(game.currentPoints == 1 ? "pt" : "pts")")
Text("\(game.currentPoints.formatted()) \(pointUnit)")
.padding(.vertical, 2)
.padding(.horizontal, 6)
.background(Color(uiColor: .deltaLightPurple).opacity(0.3), in: .capsule)
Expand Down
7 changes: 6 additions & 1 deletion Delta/RetroAchievements/AchievementNotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ struct AchievementNotification: View
@Environment(AchievementToastView.self)
private var hostingView

private var pointUnit: String
{
achievement.points == 1 ? String(localized: "pt") : String(localized: "pts")
}

var body: some View {
AchievementToast(glassShape: .rect(cornerRadius: 26)) {
Button {
Expand All @@ -44,7 +49,7 @@ struct AchievementNotification: View

if isExpanded {
Spacer()
Text("\(achievement.points) \(achievement.points == 1 ? "pt" : "pts")")
Text("\(achievement.points) \(pointUnit)")
.font(.caption)
.padding(.vertical, 2)
.padding(.horizontal, 5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ControllersSettingsViewController: UITableViewController
{
var playerIndex: Int! {
didSet {
self.title = NSLocalizedString("Player \(self.playerIndex + 1)", comment: "")
self.title = String(format: NSLocalizedString("Player %d", comment: ""), self.playerIndex + 1)
}
}

Expand Down
14 changes: 11 additions & 3 deletions Delta/Settings/Controllers/ControlsEditorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private struct InputMappingRow: View
} label: {
Label(controllerInput.localizedDisplayName, systemImage: controllerInput.sfSymbolName)
} currentValueLabel: {
Text(mappedInput.wrappedValue?.localizedDisplayName ?? String(localized: defaultInput == nil ? "Remove" : "Default"))
Text(mappedInput.wrappedValue?.localizedDisplayName ?? (defaultInput == nil ? String(localized: "Remove") : String(localized: "Default")))
}
}
else
Expand All @@ -302,8 +302,16 @@ private struct InputMappingRow: View

@ViewBuilder
var pickerOptions: some View {
Text(defaultInput == nil ? "Remove" : "Default")
.tag(AnyInput?.none)
if defaultInput == nil
{
Text("Remove")
.tag(AnyInput?.none)
}
else
{
Text("Default")
.tag(AnyInput?.none)
}

Section {
ForEach(mappableInputs, id: \.self) { input in
Expand Down
36 changes: 28 additions & 8 deletions Delta/Settings/Patreon/PatreonViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ private extension PatreonViewController
Riley & Shane
""", comment: "")

let isPatronText = NSLocalizedString("""
Hey ,
let isPatronTextFormat = NSLocalizedString("""
Hey %@,

You’re the best. Your account was linked successfully, so you now have access to Patreon-exclusive app icons and Experimental Features. You can find them all in Settings.

Expand All @@ -164,14 +164,34 @@ private extension PatreonViewController
{
headerView.supportButton.setTitle(isPatronSupportButtonTitle, for: .normal)

let patronName = account.firstName ?? account.name
let patronNameSentinel = "\u{E000}DeltaPatreonNamePlaceholder\u{E001}"
let isPatronText = NSMutableString(string: String(format: isPatronTextFormat, patronNameSentinel))
let sentinelRange = isPatronText.range(of: patronNameSentinel)

let nameRange: NSRange?
if sentinelRange.location != NSNotFound
{
isPatronText.replaceCharacters(in: sentinelRange, with: patronName)
nameRange = NSRange(location: sentinelRange.location, length: (patronName as NSString).length)
}
else
{
isPatronText.setString(String(format: isPatronTextFormat, patronName))
nameRange = nil
}

let font = UIFont.systemFont(ofSize: 16)
let attributedText = NSMutableAttributedString(string: isPatronText, attributes: [.font: font,
.foregroundColor: UIColor.label])
let attributedText = NSMutableAttributedString(string: isPatronText as String,
attributes: [.font: font,
.foregroundColor: UIColor.label])

let boldedName = NSAttributedString(string: account.firstName ?? account.name,
attributes: [.font: UIFont.boldSystemFont(ofSize: font.pointSize),
.foregroundColor: UIColor.label])
attributedText.insert(boldedName, at: 4)
if let nameRange
{
attributedText.addAttributes([.font: UIFont.boldSystemFont(ofSize: font.pointSize),
.foregroundColor: UIColor.label],
range: nameRange)
}

headerView.textView.attributedText = attributedText
}
Expand Down
2 changes: 1 addition & 1 deletion Delta/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Harmony

private struct SettingsBadge: View
{
let text: String
let text: LocalizedStringKey
var color: Color = .accentColor

var body: some View {
Expand Down
6 changes: 3 additions & 3 deletions Delta/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ class SettingsViewController: UITableViewController

if let version = Bundle.main.object(forInfoDictionaryKey: "DLTAVersion") as? String
{
self.versionLabel.text = NSLocalizedString(String(format: "Delta %@", version), comment: "Delta Version")
self.versionLabel.text = String(format: NSLocalizedString("Delta %@", comment: "Delta Version"), version)
}
else if let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
{
#if LITE
self.versionLabel.text = NSLocalizedString(String(format: "Delta Lite %@", version), comment: "Delta Version")
self.versionLabel.text = String(format: NSLocalizedString("Delta Lite %@", comment: "Delta Version"), version)
#else
self.versionLabel.text = NSLocalizedString(String(format: "Delta %@", version), comment: "Delta Version")
self.versionLabel.text = String(format: NSLocalizedString("Delta %@", comment: "Delta Version"), version)
#endif
}
else
Expand Down
14 changes: 14 additions & 0 deletions Delta/ko.lproj/AboutPatreonHeaderView.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* ObjectID = "zeg-bc-rzK"; property = "text"; */
"zeg-bc-rzK.text" = "개발자";

/* ObjectID = "ihU-uM-YGb"; property = "text"; */
"ihU-uM-YGb.text" = "운영";

/* ObjectID = "yEi-L6-kQ8"; property = "normalTitle"; */
"yEi-L6-kQ8.normalTitle" = "월 $3에 가입하기";

/* ObjectID = "ymY-qC-4y4"; property = "normalTitle"; */
"ymY-qC-4y4.normalTitle" = "Patreon 계정 연결";

/* ObjectID = "FeG-e5-LJl"; property = "text"; */
"FeG-e5-LJl.text" = "직접 후원해 주시는 모든 Friend Zone Patreon 후원자 여러분께 감사드립니다. 여러분 없이는 해낼 수 없었을 거예요 💜\n\n지금 Friend Zone 후원자가 되어 이 페이지에 이름을 올리고 새로운 기능을 미리 이용해 보세요.";
11 changes: 11 additions & 0 deletions Delta/ko.lproj/FollowUsFooterView.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* ObjectID = "l14-Bv-0T9"; property = "text"; */
"l14-Bv-0T9.text" = "업데이트 소식 받기";

/* ObjectID = "UhB-rU-QWe"; property = "text"; */
"UhB-rU-QWe.text" = "개발자";

/* ObjectID = "w1b-Io-oJk"; property = "text"; */
"w1b-Io-oJk.text" = "운영";

/* ObjectID = "WvH-lk-VLq"; property = "text"; */
"WvH-lk-VLq.text" = "디자이너";
2 changes: 2 additions & 0 deletions Delta/ko.lproj/GamesDatabase.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* ObjectID = "rwF-kd-avR"; property = "title"; */
"rwF-kd-avR.title" = "게임 데이터베이스";
4 changes: 4 additions & 0 deletions Delta/ko.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"NSLocalNetworkUsageDescription" = "Delta는 AltServer와 통신하고 JIT를 활성화하며 Epilogue Operator 기기에 연결하기 위해 로컬 네트워크를 사용합니다.";
"NSMicrophoneUsageDescription" = "Delta는 Nintendo DS의 마이크 기능을 에뮬레이션하기 위해 사용자의 마이크를 사용합니다.";
"NSPhotoLibraryAddUsageDescription" = "Delta가 스크린샷을 사진 보관함에 저장할 수 있도록 허용해 주세요.";
"NSPhotoLibraryUsageDescription" = "“확인”을 눌러 Delta가 사진 보관함의 이미지를 게임 아트워크로 사용할 수 있도록 허용해 주세요.";
Loading