Swiftgram/TelegramUI/ContactInfoStrings.swift
Ilya Laktyushin 4ec048feac no message
2018-09-02 11:55:04 +03:00

43 lines
1.1 KiB
Swift

import Foundation
import Contacts
import AddressBook
func localizedPhoneNumberLabel(label: String, strings: PresentationStrings) -> String {
if #available(iOSApplicationExtension 9.0, *) {
if label.isEmpty {
return strings.ContactInfo_PhoneLabelMain
} else if label == "X-iPhone" {
return "iPhone"
} else {
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, *) {
if label.isEmpty {
return strings.ContactInfo_PhoneLabelMain
}
return CNLabeledValue<NSString>.localizedString(forLabel: label)
} else {
}
if label == "_$!<Mobile>!$_" {
return "mobile"
} else if label == "_$!<Home>!$_" {
return "home"
} else {
return label
}
}