Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hard to maintain consistent code with localized labels #76

Closed
pihyohan opened this issue Feb 7, 2020 · 5 comments
Closed

Hard to maintain consistent code with localized labels #76

pihyohan opened this issue Feb 7, 2020 · 5 comments

Comments

@pihyohan
Copy link

pihyohan commented Feb 7, 2020

Hi,

I'm developing an app for internationalisation and just found out that when getting returned values from phone labels in iOS, the labels have been translated to the appropriate locale values set by the device.

This made it difficult to maintain a consistent code base to find out if the phone number was 'mobile' or not as I have to account for all the languages that I'm going to support.

By looking at the source for iOS at ios/Classes/SwiftContactsServicePlugin.swift at lines 331, 344, 356, I found that the labels are returning localized values.

Could this be resolved?

Many Thanks

@pihyohan pihyohan changed the title Hard to maintain consistent code with localized labels Hard to maintain consistent code with localized labels label:iOS Feb 7, 2020
@pihyohan pihyohan changed the title Hard to maintain consistent code with localized labels label:iOS Hard to maintain consistent code with localized labels Feb 7, 2020
@sperochon sperochon mentioned this issue Feb 11, 2020
@sperochon
Copy link
Contributor

It is the same for emails label.

So, I've developed a fix available in this PR #78

@pihyohan
Copy link
Author

@sperochon Many thx!

@sperochon
Copy link
Contributor

@pihyohan You have to use the new iOSLocalizedLabels parameter and set it to false in the calls of getContacts and getContactsForPhone like this :
ContactsService.getContacts(withThumbnails: false, iOSLocalizedLabels: false);

@pihyohan
Copy link
Author

@sperochon Thank you for the quick feedback on the issue. Saved me a lot of hassle!

lukasgit added a commit that referenced this issue Apr 21, 2020
@sperochon

This PR corrects the following issues: #76, #77, #79

Android: retrieve correct custom phone labels
iOS: add localizedLabels parameter to avoid labels translations
Android: retrieve correct custom phone labels (refactor)

Fix issue: birthday not imported (Android only)
Fix issue: birthday not imported (iOS only) and export the same data as Android '--MM-dd' for birthday without year

iOS: recognize emails predefined labels (work,home,other) when adding a contact to device contacts
@lukasgit
Copy link
Owner

Thanks @sperochon your fix was merged and added to version 0.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants