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

Commit 69cbbeb

Browse files
committed
Merge branch 'localization'
2 parents 0e42af6 + 1ab6412 commit 69cbbeb

16 files changed

+682
-66
lines changed

Maria Widget/TodayViewController.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,18 @@ class TodayViewController: NSViewController, NCWidgetProviding {
105105

106106
switch self.aria2.status {
107107
case .connecting:
108-
self.alertLabel.stringValue = "Connecting to aria2..."
108+
self.alertLabel.stringValue = NSLocalizedString("aria2.status.connecting", comment: "")
109109
self.taskListScrollViewHeightConstraint.constant = 0
110110
self.noTaskAlertLabel.isHidden = true
111111
case .connected:
112112
self.noTaskAlertLabel.isHidden = !(self.taskData.count == 0)
113113
case .unauthorized:
114114
self.noTaskAlertLabel.isHidden = true
115-
self.alertLabel.stringValue = "Connection unauthorized."
115+
self.alertLabel.stringValue = NSLocalizedString("aria2.status.unauthorized", comment: "")
116116
self.taskListScrollViewHeightConstraint.constant = 0
117117
case .disconnected:
118118
self.noTaskAlertLabel.isHidden = true
119-
self.alertLabel.stringValue = "Disconnected to aria2."
119+
self.alertLabel.stringValue = NSLocalizedString("aria2.status.disconnected", comment: "")
120120
self.taskListScrollViewHeightConstraint.constant = 0
121121
}
122122
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* Display name and description for this extension. */
2+
"CFBundleDisplayName" = "Maria";
3+
"com.apple.notificationcenter.widget.description" = "Maria App Widget";
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
/* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "440-w1-n0T"; */
3+
"440-w1-n0T.title" = "Text Cell";
4+
5+
/* Class = "NSTextFieldCell"; title = "⬆︎"; ObjectID = "C40-VL-2Xt"; */
6+
"C40-VL-2Xt.title" = "⬆︎";
7+
8+
/* Class = "NSTextFieldCell"; title = "0.0 KB/s"; ObjectID = "Nty-Oc-Ypt"; */
9+
"Nty-Oc-Ypt.title" = "0.0 KB/s";
10+
11+
/* Class = "NSTextFieldCell"; title = "Please run aria2 first"; ObjectID = "Twu-sf-eXL"; */
12+
"Twu-sf-eXL.title" = "请先运行 aria2";
13+
14+
/* Class = "NSTextFieldCell"; title = "No Task"; ObjectID = "cCf-Fr-bo7"; */
15+
"cCf-Fr-bo7.title" = "无任务";
16+
17+
/* Class = "NSBox"; title = "Title"; ObjectID = "dO8-Ah-DWC"; */
18+
"dO8-Ah-DWC.title" = "标题";
19+
20+
/* Class = "NSTextFieldCell"; title = "⬇︎"; ObjectID = "f8U-HA-6vk"; */
21+
"f8U-HA-6vk.title" = "⬇︎";
22+
23+
/* Class = "NSTextFieldCell"; title = "0.0 KB/s"; ObjectID = "rA6-B4-IzS"; */
24+
"rA6-B4-IzS.title" = "0.0 KB/s";

Maria.xcodeproj/project.pbxproj

+32-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
88298D051D41E56600BBAFE8 /* Maria Widget.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 88298CF51D41E56500BBAFE8 /* Maria Widget.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
1919
88298D0D1D41E63E00BBAFE8 /* TodayTaskCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88298D0C1D41E63E00BBAFE8 /* TodayTaskCellView.xib */; };
2020
88298D0F1D41E64A00BBAFE8 /* TodayTaskCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88298D0E1D41E64A00BBAFE8 /* TodayTaskCellView.swift */; };
21+
882EE79A1D8D321200CD4BA9 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8842882C1D8D220E002014E2 /* Localizable.strings */; };
2122
883327A31CC751630002B561 /* NewTaskViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 883327A21CC751630002B561 /* NewTaskViewController.swift */; };
2223
883EA5281CE1D4EF00B10A25 /* TaskCellView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 883EA5271CE1D4EF00B10A25 /* TaskCellView.xib */; };
2324
883EA52B1CE1D52300B10A25 /* TaskCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 883EA52A1CE1D52300B10A25 /* TaskCellView.swift */; };
2425
883EA52D1CE1DEBF00B10A25 /* TaskListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 883EA52C1CE1DEBF00B10A25 /* TaskListViewController.swift */; };
26+
8842882A1D8D220E002014E2 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 8842882C1D8D220E002014E2 /* Localizable.strings */; };
2527
885B9ED21CBF7806001BA477 /* SettingsBandwidthViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 885B9ED11CBF7806001BA477 /* SettingsBandwidthViewController.swift */; };
2628
885B9ED51CBF8169001BA477 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 885B9ED31CBF8169001BA477 /* AboutViewController.swift */; };
2729
886AB8621D8672E50053472C /* AriaConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 886AB8611D8672E50053472C /* AriaConfig.swift */; };
@@ -87,23 +89,30 @@
8789
0F70C9DF82097AC4946AB784 /* Pods-Maria Widget.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Maria Widget.release.xcconfig"; path = "Pods/Target Support Files/Pods-Maria Widget/Pods-Maria Widget.release.xcconfig"; sourceTree = "<group>"; };
8890
88163C971CBE581600A00976 /* Pods.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Pods.framework; path = Pods/../build/Debug/Pods.framework; sourceTree = "<group>"; };
8991
8816876F1D8A9C1B00E36678 /* aria2.default.conf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = aria2.default.conf; sourceTree = "<group>"; };
92+
881A84601D8CFD6500647DE4 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
93+
881A84621D8CFD6500647DE4 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/TodayViewController.strings"; sourceTree = "<group>"; };
94+
881A84631D8D00C300647DE4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/InfoPlist.strings; sourceTree = "<group>"; };
95+
881A84641D8D00C800647DE4 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
9096
8827EDEF1CCB47DD00DDB09D /* runAria2c.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = runAria2c.sh; sourceTree = "<group>"; };
9197
8827EDF01CCB4C0300DDB09D /* shutdownAria2c.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = shutdownAria2c.sh; sourceTree = "<group>"; };
9298
8827EDF41CCB50A700DDB09D /* SettingsAria2ConfigViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsAria2ConfigViewController.swift; sourceTree = "<group>"; };
9399
88298CF51D41E56500BBAFE8 /* Maria Widget.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Maria Widget.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
94100
88298CFA1D41E56500BBAFE8 /* TodayViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayViewController.swift; sourceTree = "<group>"; };
95101
88298CFD1D41E56500BBAFE8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/TodayViewController.xib; sourceTree = "<group>"; };
96102
88298CFF1D41E56600BBAFE8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
97-
88298D011D41E56600BBAFE8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
98103
88298D0B1D41E5F700BBAFE8 /* Maria Widget.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = "Maria Widget.entitlements"; sourceTree = "<group>"; };
99104
88298D0C1D41E63E00BBAFE8 /* TodayTaskCellView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TodayTaskCellView.xib; sourceTree = "<group>"; };
100105
88298D0E1D41E64A00BBAFE8 /* TodayTaskCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TodayTaskCellView.swift; sourceTree = "<group>"; };
101106
883327A21CC751630002B561 /* NewTaskViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NewTaskViewController.swift; sourceTree = "<group>"; };
102107
883EA5271CE1D4EF00B10A25 /* TaskCellView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TaskCellView.xib; sourceTree = "<group>"; };
103108
883EA52A1CE1D52300B10A25 /* TaskCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TaskCellView.swift; sourceTree = "<group>"; };
104109
883EA52C1CE1DEBF00B10A25 /* TaskListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TaskListViewController.swift; sourceTree = "<group>"; };
110+
884288261D8D20A7002014E2 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
111+
8842882B1D8D220E002014E2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = "<group>"; };
112+
8842882E1D8D293E002014E2 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
105113
885B9ED11CBF7806001BA477 /* SettingsBandwidthViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsBandwidthViewController.swift; sourceTree = "<group>"; };
106114
885B9ED31CBF8169001BA477 /* AboutViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = "<group>"; };
115+
8866AD8C1D8D0B65006FF797 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Settings.strings"; sourceTree = "<group>"; };
107116
886AB8611D8672E50053472C /* AriaConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AriaConfig.swift; sourceTree = "<group>"; };
108117
887049EC1D7FD3E40014BBEE /* Pods_Maria.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Pods_Maria.framework; path = Pods/../build/Debug/Pods_Maria.framework; sourceTree = "<group>"; };
109118
8870EA251CD4F13E00278B2C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Settings.storyboard; sourceTree = "<group>"; };
@@ -159,6 +168,7 @@
159168
28088A4E27634CD587DFE218 /* Frameworks */ = {
160169
isa = PBXGroup;
161170
children = (
171+
884288261D8D20A7002014E2 /* QuartzCore.framework */,
162172
8882C07D1D7FDA8600511C60 /* Aria2.framework */,
163173
887049EC1D7FD3E40014BBEE /* Pods_Maria.framework */,
164174
88163C971CBE581600A00976 /* Pods.framework */,
@@ -192,7 +202,6 @@
192202
88298CFC1D41E56500BBAFE8 /* TodayViewController.xib */,
193203
88298D0C1D41E63E00BBAFE8 /* TodayTaskCellView.xib */,
194204
88298CFF1D41E56600BBAFE8 /* Info.plist */,
195-
88298D001D41E56600BBAFE8 /* InfoPlist.strings */,
196205
88298CF81D41E56500BBAFE8 /* Supporting Files */,
197206
);
198207
path = "Maria Widget";
@@ -201,6 +210,7 @@
201210
88298CF81D41E56500BBAFE8 /* Supporting Files */ = {
202211
isa = PBXGroup;
203212
children = (
213+
88298D001D41E56600BBAFE8 /* InfoPlist.strings */,
204214
88298D0B1D41E5F700BBAFE8 /* Maria Widget.entitlements */,
205215
);
206216
name = "Supporting Files";
@@ -277,6 +287,7 @@
277287
88F76A111D87D045002876CD /* Supporting Files */ = {
278288
isa = PBXGroup;
279289
children = (
290+
8842882C1D8D220E002014E2 /* Localizable.strings */,
280291
889485A71CBE4FAF000839CD /* Maria.entitlements */,
281292
8816876F1D8A9C1B00E36678 /* aria2.default.conf */,
282293
8827EDEF1CCB47DD00DDB09D /* runAria2c.sh */,
@@ -390,6 +401,7 @@
390401
knownRegions = (
391402
en,
392403
Base,
404+
"zh-Hans",
393405
);
394406
mainGroup = 889485661CBE4D4A000839CD;
395407
productRefGroup = 889485701CBE4D4A000839CD /* Products */;
@@ -407,6 +419,7 @@
407419
isa = PBXResourcesBuildPhase;
408420
buildActionMask = 2147483647;
409421
files = (
422+
882EE79A1D8D321200CD4BA9 /* Localizable.strings in Resources */,
410423
88298CFE1D41E56600BBAFE8 /* TodayViewController.xib in Resources */,
411424
88298D021D41E56600BBAFE8 /* InfoPlist.strings in Resources */,
412425
888176371D4234F50040D767 /* Assets.xcassets in Resources */,
@@ -422,6 +435,7 @@
422435
8827EDF71CCB59D100DDB09D /* shutdownAria2c.sh in Resources */,
423436
8894857A1CBE4D4A000839CD /* Main.storyboard in Resources */,
424437
8827EDF61CCB59CF00DDB09D /* runAria2c.sh in Resources */,
438+
8842882A1D8D220E002014E2 /* Localizable.strings in Resources */,
425439
883EA5281CE1D4EF00B10A25 /* TaskCellView.xib in Resources */,
426440
88C4780C1CEF5F1900F8026A /* Assets.xcassets in Resources */,
427441
88F76A131D87D081002876CD /* DefaultConfig.plist in Resources */,
@@ -557,22 +571,34 @@
557571
isa = PBXVariantGroup;
558572
children = (
559573
88298CFD1D41E56500BBAFE8 /* Base */,
574+
881A84621D8CFD6500647DE4 /* zh-Hans */,
560575
);
561576
name = TodayViewController.xib;
562577
sourceTree = "<group>";
563578
};
564579
88298D001D41E56600BBAFE8 /* InfoPlist.strings */ = {
565580
isa = PBXVariantGroup;
566581
children = (
567-
88298D011D41E56600BBAFE8 /* en */,
582+
881A84631D8D00C300647DE4 /* Base */,
583+
881A84641D8D00C800647DE4 /* zh-Hans */,
568584
);
569585
name = InfoPlist.strings;
570586
sourceTree = "<group>";
571587
};
588+
8842882C1D8D220E002014E2 /* Localizable.strings */ = {
589+
isa = PBXVariantGroup;
590+
children = (
591+
8842882B1D8D220E002014E2 /* Base */,
592+
8842882E1D8D293E002014E2 /* zh-Hans */,
593+
);
594+
name = Localizable.strings;
595+
sourceTree = "<group>";
596+
};
572597
8870EA241CD4F13E00278B2C /* Settings.storyboard */ = {
573598
isa = PBXVariantGroup;
574599
children = (
575600
8870EA251CD4F13E00278B2C /* Base */,
601+
8866AD8C1D8D0B65006FF797 /* zh-Hans */,
576602
);
577603
name = Settings.storyboard;
578604
sourceTree = "<group>";
@@ -581,6 +607,7 @@
581607
isa = PBXVariantGroup;
582608
children = (
583609
889485791CBE4D4A000839CD /* Base */,
610+
881A84601D8CFD6500647DE4 /* zh-Hans */,
584611
);
585612
name = Main.storyboard;
586613
sourceTree = "<group>";
@@ -638,6 +665,7 @@
638665
isa = XCBuildConfiguration;
639666
buildSettings = {
640667
ALWAYS_SEARCH_USER_PATHS = NO;
668+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
641669
CLANG_ANALYZER_NONNULL = YES;
642670
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
643671
CLANG_CXX_LIBRARY = "libc++";
@@ -685,6 +713,7 @@
685713
isa = XCBuildConfiguration;
686714
buildSettings = {
687715
ALWAYS_SEARCH_USER_PATHS = NO;
716+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
688717
CLANG_ANALYZER_NONNULL = YES;
689718
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
690719
CLANG_CXX_LIBRARY = "libc++";

Maria/Base.lproj/Localizable.strings

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
Localizable.strings
3+
Maria
4+
5+
Created by ShinCurry on 2016/9/17.
6+
Copyright © 2016年 ShinCurry. All rights reserved.
7+
*/
8+
9+
// MARK: Button
10+
"button.cancel" = "Cancel";
11+
"button.ok" = "OK";
12+
"button.sure" = "Sure";
13+
"button.remove" = "Remove";
14+
"button.clean" = "Clean";
15+
16+
// MARK: NewTaskViewController
17+
"openBtFile.title" = "Choose a .torrent file";
18+
19+
// MARK: MainWindowController
20+
"removeTasks.alert.messageText" = "Remove Task";
21+
"removeTasks.alert.messageText(s)" = "Remove Tasks";
22+
"removeTasks.alert.informativeText" = "Are you sure to remove %s from the download list?";
23+
"removeTasks.alert.informativeText(s)" = "Are you sure to remove %s tasks from the download list?";
24+
"clearTasks.alert.messageText(s)" = "Clear Tasks";
25+
"clearTasks.alert.informativeText(s)" = "Are you sure to clear those completed/error/removed task(s) from the download list?";
26+
27+
"aria2.status.connecting" = "Connecting to aria2...";
28+
"aria2.status.unauthorized" = "Connection unauthorized.";
29+
"aria2.status.disconnected" = "Disconnected to aria2.";
30+
31+
// MARK: SettingsRPCServerViewController
32+
"restartApp.alert.messageText" = "Restart Maria";
33+
"restartApp.alert.informativeText" = "Are you sure to restart Maria?";
34+
35+
// MARK: SettingsGeneralViewController
36+
"selectWebUIPath.openPanel.title" = "Choose the webui index.html file.";
37+
38+
// MARK: SettingsAria2ConfigViewController
39+
"selectConfPath.title" = "Choose the aria2.conf file";
40+
41+
"resetConfig.alert.messageText" = "Reset Configuration";
42+
"resetConfig.alert.informativeText" = "Are you sure to reset aria2 configuration to default?";
43+
44+
"restartAria2.alert.messageText" = "Restart Aria2";
45+
"restartAria2.alert.informativeText" = "Are you sure to restart aria2? This operation may cause that current download tasks lost.";

0 commit comments

Comments
 (0)