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

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -