ios - How can i present different webview based on localization? -
i have app want localize multiple languages. terms , conditions page web address, , each language support has different link.
in controller present web view, how can "localize" link, switch links based on locale?
to build off of randy's answer you'd want have following code site:
objective-c:
// getting url language nsstring *websitestring = nslocalizedstring(@"website", nil); // calling said url [self.webview loadrequest:[nsurlrequest requestwithurl:[nsurl urlwithstring: websitestring]]];
swift:
// getting url language let websitestring = nslocalizedstring("website", comment: "language"); // calling said url uiwebview.loadrequest(webviewinstance)(nsurlrequest(url: nsurl(string: websitestring)!))
and in localizable.strings
file language:
// "language" differ various supported languages "website" = "https://destination.com/language";
Comments
Post a Comment