I have differents embedded HTML files in different languages.
I'd like to load the correct files in a webview based on the current langage.
Is there a way to do that as easily as NSLocalizableString?
thanks
I have differents embedded HTML files in different languages.
I'd like to load the correct files in a webview based on the current langage.
Is there a way to do that as easily as NSLocalizableString?
thanks
If for current language you mean the phone language you could achieve your goal doing this :
the method return a two letter string representing the current language, IT(Italian),EN(English),DE(German) etc. So based on the language you should be able to load the corresponding HTML file.
If you use "localized resources", for example
then many resource functions will automatically select the correct version (based on the user's language setting), e.g.:
To create a localized resource "index.html" in Xcode:
Now you have one file for each language, for example "index.html (English)" and "index.html (French)", which are copied to the appropriate folder when you install the app.