I am working on an app using iOS 10 and using camera for taking pictures. When camera view opens, instead of cancel button there is a title \"API_CANCEL_TITLE\". And when I capt
On this Extension of Bundle You need to check for the CameraUI in tableName. Use that change the value for the key of "Api_Cancel_title" to "Cancel" Using your own Localized value where you used to declare a your own value
for example
English "API_CANCEL_TITLE" = "Cancel";
Hindi "API_CANCEL_TITLE" = "रद्द करना";
French "API_CANCEL_TITLE" = "Annuler";
// MARK: - Bundle Extension
extension Bundle {
@objc func specialLocalizedStringForKey(_ key: String, value: String?, table tableName: String?) -> String {
let currentLanguage = CSLanguage.currentAppleLanguage()
var bundle = Bundle.main
if let path = Bundle.main.path(forResource: currentLanguage, ofType: "lproj") {
bundle = Bundle.init(path: path)!
} else {
let basePath = Bundle.main.path(forResource: "Base", ofType: "lproj")
bundle = Bundle.init(path: basePath!)!
}
if let name = tableName, name == "CameraUI"{
let values = NSLocalizedString(key, comment: name)
return values
}
if let name = tableName, name == "PhotoLibrary"{
let values = NSLocalizedString(key, comment: name)
return values
}
if let name = tableName, name == "PhotoLibraryServices"{
let values = NSLocalizedString(key, comment: name)
return values
}
if let name = tableName, name == "PhotosUI"
{
let values = NSLocalizedString(key, comment: name)
return values
}
return bundle.specialLocalizedStringForKey(key, value: value, table: tableName)
}
}