 |
 |
|
 |
12-03-2008, 12:18 AM
|
#1 (permalink)
|
|
New Member
Join Date: Oct 2008
Location: Denver, CO
Posts: 2,121
|
Letter Index like in Contacts
Seeking i18n experts - and if you don't know what 'i18n' is then you aren't one
The Contacts app shows the letters A-Z on the list of contacts whether the contact list uses all of those letters or not. For fun I switched my iPhone's language to Russian and the letters on the contact list changed to an abbreviated list of the Cyrillic and Latin letters. It was abbreviated since the combined length of the two alphabets is too long to fit. Again it showed letters I didn't have corresponding contacts for.
OK, with that background, here's my question. For a given device's language setting / locale, how do I create the appropriate list of letters as shown in the Contacts app?
I've looked at all the NSString methods, NSCharacterSet, NSLocale and none seem to provide this list. There is a way to get something called an 'exemplar' character set from a locale but there is no way to extract the characters from a character set.
Any ideas?
So far I've taken the simple way out of just grabbing the first letter of all the entries in my table but that leaves out the letters that have no corresponding entry. And I don't want to hard code A-Z because then the app sucks for non-Latin alphabetic users.
P.S. Returning my phone back to English was a challenge since I had to pick the right Settings app menus with nothing but Cyrillic looking back at me
|
|
|
12-03-2008, 12:27 AM
|
#2 (permalink)
|
|
New Member
Join Date: Sep 2008
Posts: 1,431
|
I just use the unique first letters of the records in my data, which may include letters not in the range A-Z. I don't see the benefit of having letters in the index that don't represent any records.
Apparently the Contacts app has a special meaning for #, which goes at the end of the list. I understand that it indicates letters outside the range of A-Z, like Japanese or other alphabets.
|
|
|
12-03-2008, 02:10 AM
|
#3 (permalink)
|
|
iPhone App Developer
Join Date: Sep 2008
Location: Berlin, Germany
Posts: 228
|
You could have an entry in your strings file that contains all letters to display. In your program you simply split the string up, letterwise.
Example for english:
Code:
"index" = "abcdefghijklmnopqrstuvwxyz";
or for greek:
Code:
"index" = "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ";
__________________
Learn vocabularies on iPhone? iVocabulary!
|
|
|
12-03-2008, 09:06 AM
|
#4 (permalink)
|
|
New Member
Join Date: Nov 2008
Posts: 123
|
Quote:
Originally Posted by RickMaddy
Seeking i18n experts - and if you don't know what 'i18n' is then you aren't one
The Contacts app shows the letters A-Z on the list of contacts whether the contact list uses all of those letters or not. For fun I switched my iPhone's language to Russian and the letters on the contact list changed to an abbreviated list of the Cyrillic and Latin letters. It was abbreviated since the combined length of the two alphabets is too long to fit. Again it showed letters I didn't have corresponding contacts for.
OK, with that background, here's my question. For a given device's language setting / locale, how do I create the appropriate list of letters as shown in the Contacts app?
I've looked at all the NSString methods, NSCharacterSet, NSLocale and none seem to provide this list. There is a way to get something called an 'exemplar' character set from a locale but there is no way to extract the characters from a character set.
Any ideas?
So far I've taken the simple way out of just grabbing the first letter of all the entries in my table but that leaves out the letters that have no corresponding entry. And I don't want to hard code A-Z because then the app sucks for non-Latin alphabetic users.
P.S. Returning my phone back to English was a challenge since I had to pick the right Settings app menus with nothing but Cyrillic looking back at me 
|
I noticed the index scheme for contacts, and my first impression was "oh, that's nice" (meaning intuitive and convenient).
On closer examination it appears that the first index item is search; followed by all the (normal) letters of the alphabet; followed by a "#" placeholder for any oddballs (numbers, punctuation, special characters, etc.).
So, the index is an all-inclusive bookend of all possible characters + 2 (as it should be).
Then the highlighted sections are for those characters which have actual occurrences-- in my case: A,C,D,E,G,I,J,K,M,N,P,S,T,V,Z,# (or 16 of the possible 27 indexes).
This, again seems as it should be-- you can quickly scroll through actual data.
What I don't know is what happens when you have an overwhelming number of entries using most of the index letters-- the scroll list would get very long.
...I suppose the use of groups and search would help in this case.
I don't really have any suggestions, just observations that it seems natural and I like it!
HTH
Dick
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 644 |
| 53 members and 591 guests |
| 63wagon, Akshay Shah, albi, anandahdaa, beginer2007, boopyman, chaoz1337, crabFish, Craig2, dave1619, dre, dtm, fede, fredidf, Gravitation, Grinarn, harrytheshark, howcr, iVodka, jbro, JBTech, Jerm, jxdigital, Kashiv, Kroupy, margalit, MarkC, mgilani, moe, mrarick, MrMattMac, nestle001, odysseus31173, p machine, panzeriti, PhotoShootoutApp, plus size cargo pant, psilocybin, RCummi86, Robyn, ronm3xico, Rudy, scalar, shuz, smasher, Somerset, Straathond, tomoan74, umarmara, vikinara, Vonswanko |
| Most users ever online was 779, 05-11-2009 at 09:55 AM. |
» Stats |
Members: 23,873
Threads: 38,649
Posts: 169,646
Top Poster: smasher (2,547)
|
| Welcome to our newest member, JBTech |
|