Permalink
Browse files

Refactored HTML index and hierarchy page titles handling by moving al…

…l strings to GBApplicationStringsProvider.

This keep all hard coded strings in one place and make the tool simpler to translate.
  • Loading branch information...
1 parent 6048ada commit e1150648e22e5011bb1f925d949aa56bb8e00932 @tomaz committed Dec 22, 2010
Showing with 6 additions and 2 deletions.
  1. +2 −0 Application/GBApplicationStringsProvider.m
  2. +4 −2 Generating/GBHTMLTemplateVariablesProvider.m
View
2 Application/GBApplicationStringsProvider.m
@@ -86,6 +86,7 @@ - (NSDictionary *)indexPage {
static NSMutableDictionary *result = nil;
if (!result) {
result = [[NSMutableDictionary alloc] init];
+ [result setObject:@"%@ Reference" forKey:@"titleTemplate"];
[result setObject:@"Class References" forKey:@"classesTitle"];
[result setObject:@"Category References" forKey:@"categoriesTitle"];
[result setObject:@"Protocol References" forKey:@"protocolsTitle"];
@@ -97,6 +98,7 @@ - (NSDictionary *)hierarchyPage {
static NSMutableDictionary *result = nil;
if (!result) {
result = [[NSMutableDictionary alloc] init];
+ [result setObject:@"%@ Hierarchy" forKey:@"titleTemplate"];
[result setObject:@"Class Hierarchy" forKey:@"classesTitle"];
[result setObject:@"Category References" forKey:@"categoriesTitle"];
[result setObject:@"Protocol References" forKey:@"protocolsTitle"];
View
6 Generating/GBHTMLTemplateVariablesProvider.m
@@ -333,11 +333,13 @@ - (NSArray *)delimitObjectSpecificationValues:(NSArray *)values withDelimiter:(N
@implementation GBHTMLTemplateVariablesProvider (IndexVariables)
- (NSString *)pageTitleForIndex {
- return [NSString stringWithFormat:@"%@ Reference", self.settings.projectName];
+ NSString *template = [self.settings.stringTemplates.indexPage objectForKey:@"titleTemplate"];
+ return [NSString stringWithFormat:template, self.settings.projectName];
}
- (NSString *)pageTitleForHierarchy {
- return [NSString stringWithFormat:@"%@ Hierarchy", self.settings.projectName];
+ NSString *template = [self.settings.stringTemplates.hierarchyPage objectForKey:@"titleTemplate"];
+ return [NSString stringWithFormat:template, self.settings.projectName];
}
- (NSArray *)classesForIndex {

0 comments on commit e115064

Please sign in to comment.