Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit 0886d25

Browse files
committed
add localization support
1 parent 75b4938 commit 0886d25

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

MainApplication.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ - (void)setUsesLargeFont:(BOOL)usesLargeFont
318318
- (void)reloadMainButtonState
319319
{
320320
[UIView transitionWithView:self.view duration:0.25 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
321-
[_mainButton setTitle:(IsHUDEnabled() ? @"Exit HUD" : @"Open HUD") forState:UIControlStateNormal];
322-
[_authorLabel setText:(IsHUDEnabled() ? @"You can quit this app now.\nThe HUD will persist on your screen." : @"Made with ♥ by @i_82 and @jmpews")];
321+
[_mainButton setTitle:(IsHUDEnabled() ? NSLocalizedString(@"Exit HUD", nil) : NSLocalizedString(@"Open HUD", nil)) forState:UIControlStateNormal];
322+
[_authorLabel setText:(IsHUDEnabled() ? NSLocalizedString(@"You can quit this app now.\nThe HUD will persist on your screen.", nil) : NSLocalizedString(@"Made with ♥ by @i_82 and @jmpews", nil))];
323323
} completion:nil];
324324
}
325325

SPLarkSettingsController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ open class SPLarkSettingsController: UIViewController {
6161
override open func viewDidLoad() {
6262
super.viewDidLoad()
6363

64-
self.titleLabel.text = "Settings"
64+
self.titleLabel.text = NSLocalizedString("Settings", comment: "")
6565
self.titleLabel.font = UIFont.systemFont(ofSize: 23, weight: .bold)
6666
self.titleLabel.textAlignment = .left
6767
self.titleLabel.textColor = UIColor.white

TSSettingsController.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,55 +17,55 @@ import UIKit
1717

1818
open override func settingTitle(index: Int, highlighted: Bool) -> String {
1919
if index == 0 {
20-
return "Pass-through"
20+
return NSLocalizedString("Pass-through", comment: "")
2121
} else if index == 1 {
22-
return "Incoming Only"
22+
return NSLocalizedString("Incoming Only", comment: "")
2323
} else if index == 2 {
24-
return "Unit"
24+
return NSLocalizedString("Unit", comment: "")
2525
} else if index == 3 {
26-
return "Prefixes"
26+
return NSLocalizedString("Prefixes", comment: "")
2727
} else {
28-
return "Size"
28+
return NSLocalizedString("Size", comment: "")
2929
}
3030
}
3131

3232
open override func settingSubtitle(index: Int, highlighted: Bool) -> String? {
3333
if index == 0 {
3434
if restartRequired {
35-
return "Re-open to apply"
35+
return NSLocalizedString("Re-open to apply", comment: "")
3636
} else {
3737
if alreadyLaunched {
3838
restartRequired = true
3939
}
4040
if (highlighted) {
41-
return "ON";
41+
return NSLocalizedString("ON", comment: "")
4242
} else {
43-
return "OFF";
43+
return NSLocalizedString("OFF", comment: "")
4444
}
4545
}
4646
} else if index == 1 {
4747
if (highlighted) {
48-
return "ON";
48+
return NSLocalizedString("ON", comment: "")
4949
} else {
50-
return "OFF";
50+
return NSLocalizedString("OFF", comment: "")
5151
}
5252
} else if index == 2 {
5353
if (highlighted) {
54-
return "b/s";
54+
return NSLocalizedString("b/s", comment: "")
5555
} else {
56-
return "B/s";
56+
return NSLocalizedString("B/s", comment: "")
5757
}
5858
} else if index == 3 {
5959
if (highlighted) {
60-
return "↑↓";
60+
return NSLocalizedString("↑↓", comment: "")
6161
} else {
62-
return "▲▼";
62+
return NSLocalizedString("▲▼", comment: "")
6363
}
6464
} else {
6565
if (highlighted) {
66-
return "Large";
66+
return NSLocalizedString("Large", comment: "")
6767
} else {
68-
return "Standard";
68+
return NSLocalizedString("Standard", comment: "")
6969
}
7070
}
7171
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)