I tried to implement a solution to this by creating a set of localized strings with embedded HTML formatting, and the idea was to concatenate those to get a single string which then I'd assign to the loadHTMLString:baseURL:
method of UIWebView
.
However, mixing HTML with regular text in the localized strings seemed like a future maintenance nightmare waiting to happen, so instead I tried this:
I wrote a simple test HTML file with English text and copied it to my Xcode project. Then I added a Spanish localization for this file. When I tested this in the iPhone Simulator it worked fine. The line of code I used to read the content of the HTML file and assign it to the UIWebView is this:
NSString *path = [[NSBundle mainBundle] pathForResource:@"help" ofType:@"html"];
[myUIWebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:path]]];
Having several HTML files to maintain might seem to be a lot of work, but it's the same thing you do when localizing nib files, and I think this approach works best when we think about separating this type of content from the regular localized strings.
Hope this helps!