Smartface allows you to support multiple languages in your app. Let’s take a look at how you can do it!
Adding New Language
Smartface is supporting the i18n adopting language system. “i18n.js” is available at i18n folder. When you open that file, you’ll see some language files added as a default. You can also add your own language with following steps;
- Simply just duplicate one of the language .js files inside i18n folder.
- Change the .js file as your new example.js file.
- After you complete your ".js" file into i18n folder, you need to "include" that file in i18n.js file.
You can add two-letter ISO 639-1 standard language code after adding ‘case’ command into Language section.
Changing App Language
If you like change the app language, go to “i18n.js" script file and edit "SMF.i18n.switchLanguage();" function. For example; add “fi” for Finnish. However, for use the device language as default, just leave that string as “Device.language”. See example below;
lang array which is described in “i18n.js” is used for binding the keys of the language. Let's add two label into our projects which are getting text from lang array.
AppStore Localization Settings
Smartface supports English by defaut. You can add another languages for App Store manually. Firstly publish your project for iOS and open the xCode project in your MAC.
Select Info Tab from “Smartface” Project. You can See “Localizations” segment in that window and press “+” to adding a new language.
After that it shows you the languages which you want to add just select one of them for example German.
Now, it shows you a popup window just press “Finish” Button.
Now you can see the German as a Localization String in your project.
This setting only required for App Store. It shows the supported languages by this way in the application description.