Swiftgram/TelegramUI/ContactInfoStrings.swift
2018-08-03 23:23:02 +03:00

34 lines
876 B
Swift

import Foundation
import Contacts
import AddressBook
func localizedPhoneNumberLabel(label: String, strings: PresentationStrings) -> String {
if #available(iOSApplicationExtension 9.0, *) {
return CNLabeledValue<CNPhoneNumber>.localizedString(forLabel: label)
} else {
}
if label == "_$!<Mobile>!$_" {
return "mobile"
} else if label == "_$!<Home>!$_" {
return "home"
} else {
return label
}
}
func localizedGenericContactFieldLabel(label: String, strings: PresentationStrings) -> String {
if #available(iOSApplicationExtension 9.0, *) {
return CNLabeledValue<NSString>.localizedString(forLabel: label)
} else {
}
if label == "_$!<Mobile>!$_" {
return "mobile"
} else if label == "_$!<Home>!$_" {
return "home"
} else {
return label
}
}