Developer Area

Show
Ignore:
Timestamp:
07/28/09 12:13:39 (5 years ago)
Author:
henri
Message:

Allow for choosing relative positions of LIH and ServiceType? in localization

Location:
apps/iphone/superbook/trunk/DotTel_SDK
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • apps/iphone/superbook/trunk/DotTel_SDK/Classes/RecordNaptr.m

    r382 r483  
    3232- (void)parseServices:(NSString *)services; 
    3333- (BOOL)tokenIsLih:(NSString *)token; 
     34- (void)appendLIHToDescription:(NSMutableString *)theDesc; 
     35- (void)appendServiceToDescription:(NSMutableString *)theDesc; 
    3436- (NSString *)generateServiceDescription; 
    3537- (NSString *)generateLabelDescription; 
     
    194196} 
    195197 
    196 - (NSString *)generateServiceDescription { 
    197         // Create the service description string, concatenating all service types and LIH 
    198         NSMutableString *theDesc = [[[NSMutableString alloc] initWithCapacity:30] autorelease]; 
    199         NSMutableString *servicePart = [NSMutableString stringWithString:@""]; 
    200  
    201         if (! isTerminal) { 
    202                 [theDesc appendFormat:@"%@:", LocTelStr(@"ntn")]; 
    203                 return theDesc; 
    204         } 
    205          
     198- (void)appendLIHToDescription:(NSMutableString *)theDesc { 
    206199        NSString *aPart; 
    207         NSInteger i = 0, j = 0; // i is # of LIH, j is # of service types 
    208         // Start with LIH 
     200        NSInteger i = 0; 
    209201        for (aPart in lihArray) { 
    210202                if (i == 0) { 
    211                         [theDesc setString:LocTelStr(aPart)]; 
     203                        [theDesc appendString:LocTelStr(aPart)]; 
    212204                } else { 
    213                         [theDesc appendFormat:@" and %@", LocTelStr(aPart)]; 
     205                        [theDesc appendFormat:@" & %@", LocTelStr(aPart)]; 
    214206                } 
    215207                i++; 
    216         } 
    217         // Add a separator between LIH and service if there are LIH 
    218         if (i > 0) { 
    219                 [theDesc appendString:@" "]; 
    220         } 
    221  
    222         i = 0; 
     208        }        
     209} 
     210 
     211- (void)appendServiceToDescription:(NSMutableString *)theDesc { 
     212        NSString *aPart; 
     213        NSMutableString *servicePart = [NSMutableString stringWithString:@""]; 
     214        NSInteger i = 0; 
     215        NSInteger j = 0; 
    223216        for (aPart in serviceTypeArray) { 
    224217                NSMutableString *strVal = [NSMutableString stringWithString:LocTelStr(aPart)]; 
     
    248241        } 
    249242        [theDesc appendString:servicePart]; 
     243} 
     244 
     245- (NSString *)generateServiceDescription { 
     246        // Create the service description string, concatenating all service types and LIH 
     247        NSMutableString *theDesc = [[[NSMutableString alloc] initWithCapacity:30] autorelease]; 
     248 
     249        if (! isTerminal) { 
     250                [theDesc appendFormat:@"%@:", LocTelStr(@"ntn")]; 
     251                return theDesc; 
     252        } 
     253         
     254        BOOL startWithLIH = [LocTelStr(@"LIH Position") isEqualToString:@"1"]; 
     255        if (startWithLIH) { 
     256                [self appendLIHToDescription:theDesc]; 
     257                // Add a separator between LIH and service if there are LIH 
     258                if ([theDesc length] > 0) { 
     259                        [theDesc appendString:@" "]; 
     260                } 
     261                [self appendServiceToDescription:theDesc]; 
     262        } else { 
     263                [self appendServiceToDescription:theDesc]; 
     264                [theDesc appendString:@" "]; 
     265                NSInteger dl = [theDesc length]; 
     266                [self appendLIHToDescription:theDesc]; 
     267                if ([theDesc length] == dl) { // no LIH, remove the last space 
     268                        [theDesc deleteCharactersInRange:NSMakeRange(dl-1, 1)]; 
     269                } 
     270        } 
     271 
    250272        return theDesc; 
    251273} 
  • apps/iphone/superbook/trunk/DotTel_SDK/English.lproj/DotTel.strings

    r473 r483  
    7979"sa" = "Service Area";    //    e.g. "Hertfordshire, Essex, Cambridgeshire" 
    8080"aux" = "Auxiliary Data"; 
     81 
     82/* Other */ 
     83"LIH Position" = "1";   // Set to 1 for 'Work Phone', to 2 for 'Phone Work' 
  • apps/iphone/superbook/trunk/DotTel_SDK/French.lproj/DotTel.strings

    r476 r483  
    7979"sa" = "Service";    //    e.g. "Hertfordshire, Essex, Cambridgeshire" 
    8080"aux" = "Données auxiliaires"; 
     81 
     82 
     83/* Other */ 
     84"LIH Position" = "2";   // Set to 1 for 'Work Phone', to 2 for 'Phone Work' 
  • apps/iphone/superbook/trunk/DotTel_SDK/Russian.lproj/DotTel.strings

    r481 r483  
    7979"sa" = "ЗПМа ПбслужОваМОя";    //    e.g. "Hertfordshire, Essex, Cambridgeshire" 
    8080"aux" = "ДПпПлМОтельМая ОМфПрЌацОя"; 
     81 
     82 
     83/* Other */ 
     84"LIH Position" = "2";   // Set to 1 for 'Work Phone', to 2 for 'Phone Work' 
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us