Skip to content

Commit

Permalink
Merge pull request ResearchKit#47 from Erin-Mounts/master
Browse files Browse the repository at this point in the history
Enable localization of onboarding HTML content
  • Loading branch information
Erin-Mounts committed Nov 30, 2015
2 parents d49cde2 + 2101100 commit a865cf6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions APCAppCore/APCAppCore/Consent/APCConsentTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ - (void)loadDocumentProperties:(NSDictionary*)properties

if (documentHtmlContent != nil)
{
NSString* path = [[NSBundle mainBundle] pathForResource:documentHtmlContent ofType:@"html" inDirectory:@"HTMLContent"];
NSString* path = [[NSBundle mainBundle] pathForResource:documentHtmlContent ofType:@"html"];
NSAssert(path != nil, @"Unable to locate HTML file: %@", documentHtmlContent);

if (path != nil)
Expand Down Expand Up @@ -527,7 +527,7 @@ - (void)loadDocumentProperties:(NSDictionary*)properties
NSString* htmlContent = [properties objectForKey:kHtmlContentTag];
if (htmlContent != nil)
{
NSString* path = [[NSBundle mainBundle] pathForResource:htmlContent ofType:@"html" inDirectory:@"HTMLContent"];
NSString* path = [[NSBundle mainBundle] pathForResource:htmlContent ofType:@"html"];
NSAssert(path != nil, @"Unable to locate HTML file: %@", htmlContent);

NSError* error = nil;
Expand Down Expand Up @@ -790,7 +790,7 @@ - (void)loadSections:(NSArray*)properties

if (htmlContent != nil)
{
NSString* path = [[NSBundle mainBundle] pathForResource:htmlContent ofType:@"html" inDirectory:@"HTMLContent"];
NSString* path = [[NSBundle mainBundle] pathForResource:htmlContent ofType:@"html"];
NSAssert(path != nil, @"Unable to locate HTML file: %@", htmlContent);

NSError* error = nil;
Expand Down
4 changes: 2 additions & 2 deletions APCAppCore/APCAppCore/Startup/APCAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ - (NSMutableArray*)consentSectionsAndHtmlContent:(NSString**)htmlContent

if (documentHtmlContent != nil && htmlContent != nil)
{
NSString* path = [[NSBundle mainBundle] pathForResource:documentHtmlContent ofType:@"html" inDirectory:@"HTMLContent"];
NSString* path = [[NSBundle mainBundle] pathForResource:documentHtmlContent ofType:@"html"];
NSAssert(path != nil, @"Unable to locate HTML file: %@", documentHtmlContent);

NSError* error = nil;
Expand Down Expand Up @@ -492,7 +492,7 @@ - (NSMutableArray*)consentSectionsAndHtmlContent:(NSString**)htmlContent

if (htmlContent != nil)
{
NSString* path = [[NSBundle mainBundle] pathForResource:htmlContent ofType:@"html" inDirectory:@"HTMLContent"];
NSString* path = [[NSBundle mainBundle] pathForResource:htmlContent ofType:@"html"];
NSAssert(path != nil, @"Unable to locate HTML file: %@", htmlContent);

NSError* error = nil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ - (void)viewDidLoad {

self.title = self.studyDetails.caption;

NSString *filePath = [[NSBundle mainBundle] pathForResource:self.studyDetails.detailText ofType:@"html" inDirectory:@"HTMLContent"];
NSString *filePath = [[NSBundle mainBundle] pathForResource:self.studyDetails.detailText ofType:@"html"];
NSURL *targetURL = [NSURL URLWithString:filePath];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
self.webView.delegate = self;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell
} else {
APCStudyOverviewCollectionViewCell *webViewCell = (APCStudyOverviewCollectionViewCell *)[collectionView dequeueReusableCellWithReuseIdentifier:kAPCStudyOverviewCollectionViewCellIdentifier forIndexPath:indexPath];

NSString *filePath = [[NSBundle mainBundle] pathForResource: studyDetails.detailText ofType:@"html" inDirectory:@"HTMLContent"];
NSAssert(filePath, @"Expecting file \"%@.html\" to be present in the \"HTMLContent\" directory, but didn't find it", studyDetails.detailText);
NSString *filePath = [[NSBundle mainBundle] pathForResource: studyDetails.detailText ofType:@"html"];
NSAssert(filePath, @"Expecting file \"%@.html\" to be present in Resources, but didn't find it", studyDetails.detailText);
NSURL *targetURL = [NSURL URLWithString:filePath];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[webViewCell.webView loadRequest:request];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ - (IBAction)editFields:(UIBarButtonItem *)sender
- (void)showPrivacyPolicy
{
APCWebViewController *webViewController = [[UIStoryboard storyboardWithName:@"APCOnboarding" bundle:[NSBundle appleCoreBundle]] instantiateViewControllerWithIdentifier:@"APCWebViewController"];
NSString *filePath = [[NSBundle mainBundle] pathForResource: @"PrivacyPolicy" ofType:@"html" inDirectory:@"HTMLContent"];
NSString *filePath = [[NSBundle mainBundle] pathForResource: @"PrivacyPolicy" ofType:@"html"];
NSURL *targetURL = [NSURL URLWithString:filePath];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
webViewController.title = NSLocalizedStringWithDefaultValue(@"Privacy Policy", @"APCAppCore", APCBundle(), @"Privacy Policy", @"");
Expand Down

0 comments on commit a865cf6

Please sign in to comment.