Created
May 23, 2020 14:32
-
-
Save palaniraja/a46ffb123eae79e19d99840e8006abce to your computer and use it in GitHub Desktop.
Overriding NSLocalizedString function to print the keys used for debugging purpse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* prints the localization key and string requested in log for debugging purpose | |
*/ | |
#if DEBUG | |
public func NSLocalizedString(_ key: String, tableName: String? = nil, bundle: Bundle = Bundle.main, value: String = "", comment: String) -> String | |
{ | |
let str = bundle.localizedString(forKey: key, value: value, table: tableName) | |
debugPrint("DEBUG: \(key) -> \(str)") | |
return str | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment