Skip to content

Commit

Permalink
Merge pull request #23 from michalsrutek/master
Browse files Browse the repository at this point in the history
Add redundancy and missing translation checks
  • Loading branch information
s4cha authored Apr 6, 2020
2 parents dcbfaaa + 79c8b50 commit 7eac7e5
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
994630681FAC68410004A9A2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
9946306A1FAC68410004A9A2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
99EB54961FAC6D3300AD728C /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
99EB54971FAC6D3300AD728C /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
99EB54981FAC6D3300AD728C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
99EB549B1FAC6D3300AD728C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
99EB549C1FAC6D3300AD728C /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -76,7 +75,6 @@
isa = PBXGroup;
children = (
99EB54961FAC6D3300AD728C /* LaunchScreen.storyboard */,
99EB54971FAC6D3300AD728C /* Main.storyboard */,
);
path = Storyboards;
sourceTree = "<group>";
Expand Down Expand Up @@ -122,6 +120,7 @@
TargetAttributes = {
994630641FAC68410004A9A2 = {
CreatedOnToolsVersion = 9.0;
LastSwiftMigration = 1140;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -169,7 +168,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "${SRCROOT}/../../Localize.swift";
shellScript = "${SRCROOT}/../../Localize.swift\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -318,7 +317,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.freshos.LocalizeExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -333,7 +332,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.freshos.LocalizeExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
2 changes: 0 additions & 2 deletions Example/LocalizeExample/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"IgnoredUntranslatedKey" = "OK";
"MissingKey" = "Hey I'm not present in Spanish!";
"NeverUsedKey" = "Hey I'm never used so you can just get rid of me!";
"UntranslatedKey" = "Hey I'm always in english so you need to translate me!";
"UntranslatedKey" = "Hey I'm always in english so you need to translate me!";
"DuplicatedKey" = "Hey, I'm here more than once!";
"DuplicatedKey" = "Hey, I'm here more than once!";
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"IgnoredUntranslatedKey" = "OK"; //ignore-same-translation-warning
"NeverUsedKey" = "Hello I'm never used so you can just get rid of me!";
"UntranslatedKey" = "Hey I'm always in english so you need to translate me!";
"DuplicatedKey" = "Hey, I'm more than once in the master translations!";
"RedundantKey" = "Hi, I'm a redundant key only appearing in Spanish";
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"IgnoredUntranslatedKey" = "OK"; //ignore-same-translation-warning
"MissingKey" = "Hey! je n'existe pas en espagnol !";
"MissingKey" = "Hey! je n'existe pas en espagnol!";
"NeverUsedKey" = "Bonjour I'm never used so you can just get rid of me!";
"UntranslatedKey" = "Hey I'm always in english so you need to translate me!";
"DuplicatedKey" = "Hey, I'm more than once in the master translations!";
"UntranslatedKey" = "Hey I'm always in english so you need to translate me!";
24 changes: 0 additions & 24 deletions Example/LocalizeExample/Resources/Storyboards/Main.storyboard

This file was deleted.

3 changes: 1 addition & 2 deletions Example/LocalizeExample/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}
}

14 changes: 7 additions & 7 deletions Example/LocalizeExample/Sources/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

import UIKit

class ViewController: UIViewController {

final class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()

// Here simulates their usage in code
let _ = NSLocalizedString("UntranslatedKey", comment: "")
let _ = NSLocalizedString("IgnoredUntranslatedKey", comment: "")
let _ = NSLocalizedString("MissingKey", comment: "")
_ = NSLocalizedString("UntranslatedKey", comment: "")
_ = NSLocalizedString("IgnoredUntranslatedKey", comment: "")
_ = NSLocalizedString("MissingKey", comment: "")
_ = NSLocalizedString("DuplicatedKey", comment: "")
_ = NSLocalizedString("MissingKeyFromMain", comment: "This key is not present in master translation file")
}
}

Loading

0 comments on commit 7eac7e5

Please sign in to comment.