From f652ecef991eb901636315f8b542160ccc1c4ed9 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Tue, 15 May 2018 17:33:38 -0400 Subject: [PATCH] localize _Main_ and other CN label types // FREEBIE --- .../src/Messages/Interactions/OWSContact.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/SignalServiceKit/src/Messages/Interactions/OWSContact.m b/SignalServiceKit/src/Messages/Interactions/OWSContact.m index 64df4513e..ac1b088e5 100644 --- a/SignalServiceKit/src/Messages/Interactions/OWSContact.m +++ b/SignalServiceKit/src/Messages/Interactions/OWSContact.m @@ -610,7 +610,9 @@ NSString *NSStringForContactAddressType(OWSContactAddressType value) phoneNumber.phoneType = OWSContactPhoneType_Mobile; } else { phoneNumber.phoneType = OWSContactPhoneType_Custom; - phoneNumber.label = phoneNumberField.label; + if (phoneNumberField.label) { + phoneNumber.label = [CNLabeledValue localizedStringForLabel:phoneNumberField.label]; + } } [phoneNumbers addObject:phoneNumber]; } @@ -626,7 +628,9 @@ NSString *NSStringForContactAddressType(OWSContactAddressType value) email.emailType = OWSContactEmailType_Work; } else { email.emailType = OWSContactEmailType_Custom; - email.label = emailField.label; + if (emailField.label) { + email.label = [CNLabeledValue localizedStringForLabel:emailField.label]; + } } [emails addObject:email]; } @@ -652,7 +656,9 @@ NSString *NSStringForContactAddressType(OWSContactAddressType value) address.addressType = OWSContactAddressType_Work; } else { address.addressType = OWSContactAddressType_Custom; - address.label = addressField.label; + if (addressField.label) { + address.label = [CNLabeledValue localizedStringForLabel:addressField.label]; + } } [addresses addObject:address]; }