ios - Swift : How to change language inside app? -
i using localize-swift
library (link) localize application , works fine .strings files. problem have localize language right left , have localize via interface builder storyboard can make view controllers right in rtl format. question how set storyboard user selected language in real time ?
for example have 2 storyboard files :
1- ... /projectname/base.lproj/main.storyboard
2- ... /projectname/fa-ir.lproj/main.storyboard
how switch between them in real time ?
i know can change in schemes , device language want real time , dont want users restart device.
thanks
found answer :
nsuserdefaults.standarduserdefaults().setobject(["language identifier"], forkey: "applelanguages") nsuserdefaults.standarduserdefaults().synchronize()
unfortunately user must restart app! if find solution not restart application please inform me.
Comments
Post a Comment