Browse Source

Localzation

David Walter 2 years ago
parent
commit
f1ba2a7015

+ 18
- 4
Authenticator.xcodeproj/project.pbxproj View File

@@ -44,7 +44,6 @@
44 44
 		63B119842024E3040059A369 /* Passcode.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B119822024E2F70059A369 /* Passcode.framework */; };
45 45
 		63B119852024E3040059A369 /* Passcode.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 63B119822024E2F70059A369 /* Passcode.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
46 46
 		63C74AF8202A2BCA00713DAA /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 63C74AF5202A2ACF00713DAA /* Localizable.strings */; };
47
-		63C74AFA202A2CCC00713DAA /* Localizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C74AF9202A2CCC00713DAA /* Localizable.swift */; };
48 47
 		63C896C81FFBCD0B00081DD3 /* TokenTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C896C71FFBCD0B00081DD3 /* TokenTableViewCell.swift */; };
49 48
 		63C9C69C2027883100012934 /* Themeable.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C9C69B2027883100012934 /* Themeable.framework */; };
50 49
 		63C9C69D2027883600012934 /* Themeable.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63C9C69B2027883100012934 /* Themeable.framework */; };
@@ -56,6 +55,8 @@
56 55
 		63C9C6AA2027895600012934 /* InlineColorPickerRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C9C6A42027895500012934 /* InlineColorPickerRow.swift */; };
57 56
 		63C9C6AB2027895600012934 /* ColorRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63C9C6A52027895500012934 /* ColorRow.swift */; };
58 57
 		63D0F0E02005371F001EC8EC /* OTPAuthParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63D0F0DF2005371F001EC8EC /* OTPAuthParser.swift */; };
58
+		63D6996C2031C36500FA1F7B /* Passcode.strings in Resources */ = {isa = PBXBuildFile; fileRef = 63D6996E2031C36500FA1F7B /* Passcode.strings */; };
59
+		63D699712031C3C100FA1F7B /* Localizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63D699702031C3C100FA1F7B /* Localizable.swift */; };
59 60
 		63EDBD2F201BDB0400FE52DB /* EmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63EDBD2D201BDB0400FE52DB /* EmptyView.swift */; };
60 61
 		63EDBD30201BDB0400FE52DB /* EmptyView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 63EDBD2E201BDB0400FE52DB /* EmptyView.xib */; };
61 62
 /* End PBXBuildFile section */
@@ -114,7 +115,6 @@
114 115
 		63B119822024E2F70059A369 /* Passcode.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Passcode.framework; path = Carthage/Build/iOS/Passcode.framework; sourceTree = "<group>"; };
115 116
 		63C74AF4202A2ACF00713DAA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
116 117
 		63C74AF6202A2AD900713DAA /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
117
-		63C74AF9202A2CCC00713DAA /* Localizable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Localizable.swift; path = Carthage/Checkouts/Passcode/Passcode/Localizable.swift; sourceTree = SOURCE_ROOT; };
118 118
 		63C896C71FFBCD0B00081DD3 /* TokenTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokenTableViewCell.swift; sourceTree = "<group>"; };
119 119
 		63C9C69B2027883100012934 /* Themeable.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Themeable.framework; path = Carthage/Build/iOS/Themeable.framework; sourceTree = "<group>"; };
120 120
 		63C9C6A02027895500012934 /* ColorSwatchView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorSwatchView.swift; sourceTree = "<group>"; };
@@ -125,6 +125,9 @@
125 125
 		63C9C6A52027895500012934 /* ColorRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorRow.swift; sourceTree = "<group>"; };
126 126
 		63D0F0DF2005371F001EC8EC /* OTPAuthParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OTPAuthParser.swift; sourceTree = "<group>"; };
127 127
 		63D0F0EB200559E7001EC8EC /* LTMorphingLabel.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LTMorphingLabel.framework; path = Carthage/Build/iOS/LTMorphingLabel.framework; sourceTree = "<group>"; };
128
+		63D6996D2031C36500FA1F7B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Passcode.strings; sourceTree = "<group>"; };
129
+		63D6996F2031C36800FA1F7B /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Passcode.strings; sourceTree = "<group>"; };
130
+		63D699702031C3C100FA1F7B /* Localizable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Localizable.swift; sourceTree = "<group>"; };
128 131
 		63EDBD2D201BDB0400FE52DB /* EmptyView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmptyView.swift; sourceTree = "<group>"; };
129 132
 		63EDBD2E201BDB0400FE52DB /* EmptyView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = EmptyView.xib; sourceTree = "<group>"; };
130 133
 /* End PBXFileReference section */
@@ -212,8 +215,9 @@
212 215
 				634F54A0201D56FF00B85422 /* Themes */,
213 216
 				634795D62013503C001D334F /* Settings.bundle */,
214 217
 				63AA62E61FF8221F00A76E77 /* Info.plist */,
215
-				63C74AF9202A2CCC00713DAA /* Localizable.swift */,
218
+				63D699702031C3C100FA1F7B /* Localizable.swift */,
216 219
 				63C74AF5202A2ACF00713DAA /* Localizable.strings */,
220
+				63D6996E2031C36500FA1F7B /* Passcode.strings */,
217 221
 			);
218 222
 			path = Authenticator;
219 223
 			sourceTree = "<group>";
@@ -340,6 +344,7 @@
340 344
 				634F54A3201D572600B85422 /* dark.json in Resources */,
341 345
 				634F54A4201D572600B85422 /* light.json in Resources */,
342 346
 				63AA62E51FF8221F00A76E77 /* LaunchScreen.storyboard in Resources */,
347
+				63D6996C2031C36500FA1F7B /* Passcode.strings in Resources */,
343 348
 				63AA62E21FF8221F00A76E77 /* Assets.xcassets in Resources */,
344 349
 				63C74AF8202A2BCA00713DAA /* Localizable.strings in Resources */,
345 350
 				63AA62E01FF8221F00A76E77 /* Main.storyboard in Resources */,
@@ -384,7 +389,7 @@
384 389
 				63C9C6AA2027895600012934 /* InlineColorPickerRow.swift in Sources */,
385 390
 				63C9C6A82027895600012934 /* ColorPalettes.swift in Sources */,
386 391
 				63C9C6A62027895600012934 /* ColorSwatchView.swift in Sources */,
387
-				63C74AFA202A2CCC00713DAA /* Localizable.swift in Sources */,
392
+				63D699712031C3C100FA1F7B /* Localizable.swift in Sources */,
388 393
 				6367EA961FF91C4200753CDC /* TokenViewController.swift in Sources */,
389 394
 				6354F7F31FF910D600FFCE99 /* ScannerViewController.swift in Sources */,
390 395
 				63AA62DB1FF8221F00A76E77 /* AppDelegate.swift in Sources */,
@@ -421,6 +426,15 @@
421 426
 			name = Localizable.strings;
422 427
 			sourceTree = "<group>";
423 428
 		};
429
+		63D6996E2031C36500FA1F7B /* Passcode.strings */ = {
430
+			isa = PBXVariantGroup;
431
+			children = (
432
+				63D6996D2031C36500FA1F7B /* en */,
433
+				63D6996F2031C36800FA1F7B /* de */,
434
+			);
435
+			name = Passcode.strings;
436
+			sourceTree = "<group>";
437
+		};
424 438
 /* End PBXVariantGroup section */
425 439
 
426 440
 /* Begin XCBuildConfiguration section */

+ 43
- 0
Authenticator/Localizable.swift View File

@@ -0,0 +1,43 @@
1
+//
2
+//  Localizable.swift
3
+//  Localizable
4
+//
5
+//  Created by David Walter on 02.02.18.
6
+//  Copyright © 2018 David Walter. All rights reserved.
7
+//
8
+
9
+import UIKit
10
+
11
+extension String {
12
+    var localized: String {
13
+        return NSLocalizedString(self, comment: "")
14
+    }
15
+}
16
+
17
+func localized(_ key: String, comment: String = "") -> String {
18
+    return NSLocalizedString(key, tableName: "Localizable", bundle: Bundle.main, comment: comment)
19
+}
20
+
21
+extension UILabel {
22
+    @IBInspectable
23
+    public var localizedText: String {
24
+        get { return "" }
25
+        set { self.text = localized(newValue) }
26
+    }
27
+}
28
+
29
+extension UIButton {
30
+    @IBInspectable
31
+    public var localizedTitle: String {
32
+        get { return "" }
33
+        set { self.setTitle(localized(newValue), for: .normal) }
34
+    }
35
+}
36
+
37
+extension UINavigationItem {
38
+    @IBInspectable
39
+    public var localizedTitle: String {
40
+        get { return "" }
41
+        set { self.title = localized(newValue) }
42
+    }
43
+}

+ 3
- 3
Authenticator/Views/Base.lproj/Main.storyboard View File

@@ -35,7 +35,7 @@
35 35
                             </connections>
36 36
                         </barButtonItem>
37 37
                         <userDefinedRuntimeAttributes>
38
-                            <userDefinedRuntimeAttribute type="string" keyPath="LocalizedTitle" value="Settings"/>
38
+                            <userDefinedRuntimeAttribute type="string" keyPath="localizedTitle" value="Settings"/>
39 39
                         </userDefinedRuntimeAttributes>
40 40
                     </navigationItem>
41 41
                     <connections>
@@ -213,7 +213,7 @@
213 213
                             </connections>
214 214
                         </barButtonItem>
215 215
                         <userDefinedRuntimeAttributes>
216
-                            <userDefinedRuntimeAttribute type="string" keyPath="LocalizedTitle" value="Add Token"/>
216
+                            <userDefinedRuntimeAttribute type="string" keyPath="localizedTitle" value="Add Token"/>
217 217
                         </userDefinedRuntimeAttributes>
218 218
                     </navigationItem>
219 219
                 </viewController>
@@ -248,7 +248,7 @@
248 248
                     </view>
249 249
                     <navigationItem key="navigationItem" title="Scan QR code" id="Yan-a7-CHo">
250 250
                         <userDefinedRuntimeAttributes>
251
-                            <userDefinedRuntimeAttribute type="string" keyPath="LocalizedTitle" value="Scan QR code"/>
251
+                            <userDefinedRuntimeAttribute type="string" keyPath="localizedTitle" value="Scan QR code"/>
252 252
                         </userDefinedRuntimeAttributes>
253 253
                     </navigationItem>
254 254
                     <connections>

+ 1
- 12
Authenticator/de.lproj/Localizable.strings View File

@@ -35,7 +35,7 @@
35 35
 "Edit Token" = "Token bearbeiten";
36 36
 
37 37
 "Display Info" = "Anzeige Informationen";
38
-"Issuer" = "Issuer";
38
+"Issuer" = "Aussteller";
39 39
 "Account name" = "Account Name";
40 40
 "Accent color" = "Akzent Farbe";
41 41
 
@@ -57,14 +57,3 @@
57 57
 "reset" = "Zurücksetzen";
58 58
 "reset_all_data" = "Alle Daten zurücksetzen";
59 59
 "reset_all_data_message" = "All Account data on this device will be permanently deleted, and all settings will be reset to default, you won't be able to undo this action.";
60
-
61
-// Passcode
62
-
63
-"biometricsReasonTouchID" = "Benutze einen Finger um dich zu authentifizieren";
64
-"biometricsReasonFaceID" = "Benutze dein Gesicht um dich zu authentifizieren";
65
-"biometricsFallback" = "Passcode eingeben";
66
-
67
-"passcodeText" = "Passcode eingeben";
68
-"passcodeNew" = "Neuen Passcode eingeben";
69
-"passcodeReenter" = "Passcode erneut eingeben";
70
-

+ 15
- 0
Authenticator/de.lproj/Passcode.strings View File

@@ -0,0 +1,15 @@
1
+/* 
2
+  Passcode.strings
3
+  Authenticator
4
+
5
+  Created by David Walter on 12.02.18.
6
+  Copyright © 2018 David Walter. All rights reserved.
7
+*/
8
+
9
+"biometricsReasonTouchID" = "Benutze einen Finger um dich zu authentifizieren";
10
+"biometricsReasonFaceID" = "Benutze dein Gesicht um dich zu authentifizieren";
11
+"biometricsFallback" = "Passcode eingeben";
12
+
13
+"passcodeText" = "Passcode eingeben";
14
+"passcodeNew" = "Neuen Passcode eingeben";
15
+"passcodeReenter" = "Passcode erneut eingeben";

+ 0
- 10
Authenticator/en.lproj/Localizable.strings View File

@@ -59,13 +59,3 @@
59 59
 "reset_all_data" = "Reset all Data";
60 60
 "reset_all_data_message" = "All Account data on this device will be permanently deleted, and all settings will be reset to default, you won't be able to undo this action.";
61 61
 
62
-// Passcode
63
-
64
-"biometricsReasonTouchID" = "Place your finger to authenticate";
65
-"biometricsReasonFaceID" = "Use your face to authenticate";
66
-"biometricsFallback" = "Enter Passcode";
67
-
68
-"passcodeText" = "Enter Passcode";
69
-"passcodeNew" = "Enter New Passcode";
70
-"passcodeReenter" = "Re-enter your new passcode";
71
-

+ 15
- 0
Authenticator/en.lproj/Passcode.strings View File

@@ -0,0 +1,15 @@
1
+/* 
2
+  Passcode.strings
3
+  Authenticator
4
+
5
+  Created by David Walter on 12.02.18.
6
+  Copyright © 2018 David Walter. All rights reserved.
7
+*/
8
+
9
+"biometricsReasonTouchID" = "Place your finger to authenticate";
10
+"biometricsReasonFaceID" = "Use your face to authenticate";
11
+"biometricsFallback" = "Enter Passcode";
12
+
13
+"passcodeText" = "Enter Passcode";
14
+"passcodeNew" = "Enter New Passcode";
15
+"passcodeReenter" = "Re-enter your new passcode";

+ 2
- 2
Cartfile View File

@@ -1,6 +1,6 @@
1
-github "divadretlaw/UserDefaults" ~> 1.2
1
+github "divadretlaw/UserDefaults"
2 2
 github "divadretlaw/ios-otp-generators" "master"
3
-github "divadretlaw/Passcode" "master"
3
+github "divadretlaw/Passcode"
4 4
 github "divadretlaw/Themeable" "master"
5 5
 github "realm/realm-cocoa"
6 6
 github "xmartlabs/Eureka"

+ 2
- 2
Cartfile.resolved View File

@@ -1,7 +1,7 @@
1
-github "divadretlaw/Passcode" "a33956f6fec8e2fef4a664c35d6db0056ab562be"
1
+github "divadretlaw/Passcode" "1.0"
2 2
 github "divadretlaw/Themeable" "dec7ba3d946fb2b37a668901bd94a16ab776a37d"
3 3
 github "divadretlaw/UserDefaults" "1.2"
4
-github "divadretlaw/ios-otp-generators" "123d8cf821f792fd731d24672342af0fee0ab5a6"
4
+github "divadretlaw/ios-otp-generators" "f7374c6a533da7a120868e4a04478809188d7d1c"
5 5
 github "evgenyneu/keychain-swift" "10.0.0"
6 6
 github "hyperoslo/Hue" "3.0.1"
7 7
 github "lexrus/LTMorphingLabel" "0.5.6"