Skip to content

Commit 7a95f49

Browse files
author
Yannick Weiss
committed
Added translation
1 parent 418a984 commit 7a95f49

File tree

12 files changed

+101
-26
lines changed

12 files changed

+101
-26
lines changed

Diff for: Alamofire-4.8.2/Alamofire.xcodeproj/project.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248
hasScannedForEncodings = 0;
249249
knownRegions = (
250250
en,
251+
Base,
251252
);
252253
mainGroup = F8111E2919A95C8B0040E7D1;
253254
productRefGroup = F8111E3419A95C8B0040E7D1 /* Products */;

Diff for: MigrosUsage.xcodeproj/project.pbxproj

+45-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
AC99A474235359B20006DFD2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AC99A476235359B20006DFD2 /* InfoPlist.strings */; };
11+
AC9A8625234F7D8100E04F6F /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = AC9A8627234F7D8100E04F6F /* Localizable.strings */; };
12+
AC9A862F234F80D500E04F6F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AC9A8631234F80D500E04F6F /* InfoPlist.strings */; };
1013
AC9EB8A822EF587A0010AD0F /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ACA93E7122EF3156001DC560 /* Alamofire.framework */; };
1114
AC9EB8C622EF58F00010AD0F /* KeychainSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC9EB8B622EF58C90010AD0F /* KeychainSwift.framework */; };
1215
AC9EB8D822EF66320010AD0F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AC9EB8D722EF66320010AD0F /* Images.xcassets */; };
@@ -90,12 +93,17 @@
9093
/* End PBXCopyFilesBuildPhase section */
9194

9295
/* Begin PBXFileReference section */
96+
AC99A475235359B20006DFD2 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/InfoPlist.strings; sourceTree = "<group>"; };
97+
AC9A8622234F7B1A00E04F6F /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Main.strings; sourceTree = "<group>"; };
98+
AC9A8626234F7D8100E04F6F /* en */ = {isa = PBXFileReference; explicitFileType = text.plist.strings; fileEncoding = 4; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
99+
AC9A8628234F7D8700E04F6F /* de */ = {isa = PBXFileReference; explicitFileType = text.plist.strings; fileEncoding = 4; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
100+
AC9A8632234F80D800E04F6F /* de */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/InfoPlist.strings; sourceTree = "<group>"; };
101+
AC9A8633234F818500E04F6F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
93102
AC9EB8A922EF58C90010AD0F /* KeychainSwift.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = KeychainSwift.xcodeproj; path = "keychain-swift-master/KeychainSwift.xcodeproj"; sourceTree = "<group>"; };
94103
AC9EB8D722EF66320010AD0F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
95104
ACA93E1B22EF2092001DC560 /* UsageWidget.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = UsageWidget.appex; sourceTree = BUILT_PRODUCTS_DIR; };
96105
ACA93E1E22EF2092001DC560 /* TodayViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayViewController.swift; sourceTree = "<group>"; };
97106
ACA93E2122EF2092001DC560 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = "<group>"; };
98-
ACA93E2322EF2092001DC560 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
99107
ACA93E2A22EF2218001DC560 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
100108
ACA93E2D22EF2E59001DC560 /* UsageWidget.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = UsageWidget.entitlements; sourceTree = "<group>"; };
101109
ACA93E2E22EF2E67001DC560 /* MigrosUsage.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MigrosUsage.entitlements; sourceTree = "<group>"; };
@@ -144,10 +152,12 @@
144152
ACA93E1D22EF2092001DC560 /* UsageWidget */ = {
145153
isa = PBXGroup;
146154
children = (
155+
AC9A8633234F818500E04F6F /* Info.plist */,
147156
ACA93E2D22EF2E59001DC560 /* UsageWidget.entitlements */,
148157
ACA93E1E22EF2092001DC560 /* TodayViewController.swift */,
149158
ACA93E2022EF2092001DC560 /* MainInterface.storyboard */,
150-
ACA93E2322EF2092001DC560 /* Info.plist */,
159+
AC9A8627234F7D8100E04F6F /* Localizable.strings */,
160+
AC9A8631234F80D500E04F6F /* InfoPlist.strings */,
151161
);
152162
path = UsageWidget;
153163
sourceTree = "<group>";
@@ -193,6 +203,7 @@
193203
ACF18EF022ECC14300B2A751 /* Main.storyboard */,
194204
ACF18EF522ECC14600B2A751 /* LaunchScreen.storyboard */,
195205
ACF18EF822ECC14600B2A751 /* Info.plist */,
206+
AC99A476235359B20006DFD2 /* InfoPlist.strings */,
196207
AC9EB8D722EF66320010AD0F /* Images.xcassets */,
197208
);
198209
path = MigrosUsage;
@@ -283,6 +294,7 @@
283294
knownRegions = (
284295
en,
285296
Base,
297+
de,
286298
);
287299
mainGroup = ACF18EE022ECC14300B2A751;
288300
productRefGroup = ACF18EEA22ECC14300B2A751 /* Products */;
@@ -328,6 +340,8 @@
328340
buildActionMask = 2147483647;
329341
files = (
330342
ACA93E2222EF2092001DC560 /* MainInterface.storyboard in Resources */,
343+
AC9A862F234F80D500E04F6F /* InfoPlist.strings in Resources */,
344+
AC9A8625234F7D8100E04F6F /* Localizable.strings in Resources */,
331345
);
332346
runOnlyForDeploymentPostprocessing = 0;
333347
};
@@ -339,6 +353,7 @@
339353
AC9EB8D822EF66320010AD0F /* Images.xcassets in Resources */,
340354
ACF18EF722ECC14600B2A751 /* LaunchScreen.storyboard in Resources */,
341355
ACF18EF222ECC14300B2A751 /* Main.storyboard in Resources */,
356+
AC99A474235359B20006DFD2 /* InfoPlist.strings in Resources */,
342357
);
343358
runOnlyForDeploymentPostprocessing = 0;
344359
};
@@ -384,6 +399,31 @@
384399
/* End PBXTargetDependency section */
385400

386401
/* Begin PBXVariantGroup section */
402+
AC99A476235359B20006DFD2 /* InfoPlist.strings */ = {
403+
isa = PBXVariantGroup;
404+
children = (
405+
AC99A475235359B20006DFD2 /* de */,
406+
);
407+
name = InfoPlist.strings;
408+
sourceTree = "<group>";
409+
};
410+
AC9A8627234F7D8100E04F6F /* Localizable.strings */ = {
411+
isa = PBXVariantGroup;
412+
children = (
413+
AC9A8626234F7D8100E04F6F /* en */,
414+
AC9A8628234F7D8700E04F6F /* de */,
415+
);
416+
name = Localizable.strings;
417+
sourceTree = "<group>";
418+
};
419+
AC9A8631234F80D500E04F6F /* InfoPlist.strings */ = {
420+
isa = PBXVariantGroup;
421+
children = (
422+
AC9A8632234F80D800E04F6F /* de */,
423+
);
424+
name = InfoPlist.strings;
425+
sourceTree = "<group>";
426+
};
387427
ACA93E2022EF2092001DC560 /* MainInterface.storyboard */ = {
388428
isa = PBXVariantGroup;
389429
children = (
@@ -396,6 +436,7 @@
396436
isa = PBXVariantGroup;
397437
children = (
398438
ACF18EF122ECC14300B2A751 /* Base */,
439+
AC9A8622234F7B1A00E04F6F /* de */,
399440
);
400441
name = Main.storyboard;
401442
sourceTree = "<group>";
@@ -457,6 +498,7 @@
457498
isa = XCBuildConfiguration;
458499
buildSettings = {
459500
ALWAYS_SEARCH_USER_PATHS = NO;
501+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
460502
CLANG_ANALYZER_NONNULL = YES;
461503
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
462504
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -518,6 +560,7 @@
518560
isa = XCBuildConfiguration;
519561
buildSettings = {
520562
ALWAYS_SEARCH_USER_PATHS = NO;
563+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
521564
CLANG_ANALYZER_NONNULL = YES;
522565
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
523566
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";

Diff for: MigrosUsage.xcodeproj/xcshareddata/xcschemes/UsageWidget.xcscheme

+4-15
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4343
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
4444
shouldUseLaunchSchemeArgsEnv = "YES">
45-
<Testables>
46-
</Testables>
4745
<MacroExpansion>
4846
<BuildableReference
4947
BuildableIdentifier = "primary"
@@ -53,14 +51,16 @@
5351
ReferencedContainer = "container:MigrosUsage.xcodeproj">
5452
</BuildableReference>
5553
</MacroExpansion>
56-
<AdditionalOptions>
57-
</AdditionalOptions>
54+
<Testables>
55+
</Testables>
5856
</TestAction>
5957
<LaunchAction
6058
buildConfiguration = "Debug"
6159
selectedDebuggerIdentifier = ""
6260
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
61+
language = "de"
6362
launchStyle = "0"
63+
askForAppToLaunch = "Yes"
6464
useCustomWorkingDirectory = "NO"
6565
ignoresPersistentStateOnLaunch = "NO"
6666
debugDocumentVersioning = "YES"
@@ -78,17 +78,6 @@
7878
ReferencedContainer = "container:MigrosUsage.xcodeproj">
7979
</BuildableReference>
8080
</RemoteRunnable>
81-
<MacroExpansion>
82-
<BuildableReference
83-
BuildableIdentifier = "primary"
84-
BlueprintIdentifier = "ACA93E1A22EF2092001DC560"
85-
BuildableName = "UsageWidget.appex"
86-
BlueprintName = "UsageWidget"
87-
ReferencedContainer = "container:MigrosUsage.xcodeproj">
88-
</BuildableReference>
89-
</MacroExpansion>
90-
<AdditionalOptions>
91-
</AdditionalOptions>
9281
</LaunchAction>
9382
<ProfileAction
9483
buildConfiguration = "Release"

Diff for: MigrosUsage/ViewController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ViewController: UIViewController {
1414
override func viewDidAppear(_ animated: Bool) {
1515
let keychain = KeychainSwift()
1616
if let _ = keychain.get("username") {
17-
print("found username")
17+
print("found username in Keychain")
1818
return
1919
}
2020
print("username does not exist in keychain")

Diff for: MigrosUsage/de.lproj/InfoPlist.strings

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// InfoPlist.strings
2+
3+
"CFBundleDisplayName" = "Migros Daten";

Diff for: MigrosUsage/de.lproj/Main.strings

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
/* Class = "UILabel"; text = "Password"; ObjectID = "Egb-4q-qgc"; */
3+
"Egb-4q-qgc.text" = "Passwort";
4+
5+
/* Class = "UIButton"; normalTitle = "Remove Credentials"; ObjectID = "FAM-8G-OgS"; */
6+
"FAM-8G-OgS.normalTitle" = "Konto enfternen";
7+
8+
/* Class = "UIButton"; normalTitle = "Login"; ObjectID = "TiD-EJ-M6A"; */
9+
"TiD-EJ-M6A.normalTitle" = "Anmelden";
10+
11+
/* Class = "UILabel"; text = "Username"; ObjectID = "iRu-Ci-mnz"; */
12+
"iRu-Ci-mnz.text" = "Benutzername";
13+
14+
/* Class = "UILabel"; text = "You can add the Today Widget\n on the Spotlight screen."; ObjectID = "mxA-0w-nEz"; */
15+
"mxA-0w-nEz.text" = "Sie können das Today Widget hinzufügen.";

Diff for: README.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ I needed a way to check how much data left on my data plan.
44

55
![screenshot](screenshot.png)
66

7+
## TODO
8+
- [ ] Fix Widet on different font sizes (accessibility)
9+
- [ ] Fix incorrect error messages
10+
- [ ] Translate widget
11+
- [ ] Add instructions how to add widget https://support.apple.com/de-de/HT207122
712

813
## Notes on Today Widgets
914
* Today Widget uses the Notifications icon

Diff for: UsageWidget/TodayViewController.swift

+10-8
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ class TodayViewController: UIViewController, NCWidgetProviding {
2121
}
2222

2323
func widgetPerformUpdate(completionHandler: (@escaping (NCUpdateResult) -> Void)) {
24+
self.label.text = ""
2425
spinner.startAnimating()
25-
26+
2627
let keychain = KeychainSwift()
2728
keychain.accessGroup = "NDJHDNKXD6.dev.yannick.MigrosUsage"
2829

2930
guard let username = keychain.get("username"), let password = keychain.get("password") else {
30-
self.label.text = "Please provide credentials."
31+
self.label.text = NSLocalizedString("Please provide credentials.", comment: "")
3132
completionHandler(.failed)
3233
return
3334
}
@@ -74,11 +75,15 @@ class TodayViewController: UIViewController, NCWidgetProviding {
7475
let interval = Calendar.current.dateInterval(of: .month, for: Date())!
7576
let remainingDays = Calendar.current.dateComponents([.day], from: Date(), to: interval.end).day!
7677

77-
var l = "Used \(usedMB) of \(totalMB).\n"
78+
let percentage = Int(round((usedFloat / totalFloat) * 100))
79+
print(percentage)
80+
//let l = String(format: "%d Notifications", percentage)
81+
82+
var l = "\(percentage)% " // "Used \(usedMB) of \(totalMB).\n"
7883
if remainingDays == 0 {
79-
l = l + "\(remainingMB) remaining for today."
84+
l = l + String(format: NSLocalizedString("usage-today", comment: ""), usedMB, totalMB, remainingMB)
8085
} else {
81-
l = l + "\(remainingMB) remaining for the next \(remainingDays) Days."
86+
l = l + String(format: NSLocalizedString("usage-other", comment: ""), usedMB, totalMB, remainingMB, remainingDays)
8287
}
8388

8489
DispatchQueue.main.async {
@@ -94,8 +99,6 @@ class TodayViewController: UIViewController, NCWidgetProviding {
9499
}
95100
}
96101
}
97-
98-
print("widgetPerformUpdate")
99102
}
100103

101104
func extract(from: String, between: String, and: String) -> String {
@@ -108,5 +111,4 @@ class TodayViewController: UIViewController, NCWidgetProviding {
108111
}
109112
return ""
110113
}
111-
112114
}

Diff for: UsageWidget/de.lproj/InfoPlist.strings

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// InfoPlist.strings
2+
3+
"CFBundleDisplayName" = "Migros Daten";

Diff for: UsageWidget/de.lproj/Localizable.strings

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Localizable.strings
2+
3+
"Getting used data..." = "Hole infos...";
4+
"Please provide credentials." = "Bitte in der App anmelden.";
5+
"usage-today" = "gebraucht, %@ von %@. %@ übrig.";
6+
"usage-other" = "gebraucht, %@ von %@. %@ übrig für die nächsten %d Tage.";

Diff for: UsageWidget/en.lproj/InfoPlist.strings

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// InfoPlist.strings
2+

Diff for: UsageWidget/en.lproj/Localizable.strings

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Localizable.strings
2+
3+
"Getting used data..." = "Getting used data...";
4+
"Please provide credentials." = "Please log-in in the app.";
5+
"usage-today" = "used %@ of %@. %@ remaining for today.";
6+
"usage-other" = "used %@ of %@. %@ remaining for the next %d Days.";

0 commit comments

Comments
 (0)