Load different language html Xcode -
i want load html file no app depending on device language. have code load html file without checking language want load file format: filename_[language].html
here loadhtml code:
self.htmlfile = [_htmlfile stringbyreplacingoccurrencesofstring:@".html" withstring:@""]; nsstring * htmlfilepath = [[nsbundle mainbundle] pathforresource:_htmlfile oftype:@"html"]; nsstring * html = [nsstring stringwithcontentsoffile:htmlfilepath encoding:nsutf8stringencoding error:nil]; what best way this?
nsstring * language = [[nslocale preferredlanguages] objectatindex:0]; this return 2 letter code selected language. "en" english, "es" spanish, "de" german, etc.
Comments
Post a Comment