Implementing a multilanguage app with localized strings in SwiftUI
One of the beauties of iOS and the Apple App Store is that you can sell your app to the whole world, just by configuring the markets in App Store Connect.
Given that, you must consider that only one language is not enough, and you should customize the app to be presented in the language of your customers. The localization mechanism in iOS is sophisticated, and luckily it works very well in SwiftUI too.
In this recipe, we'll create a sample app that presents a cooking recipe detail page, and we are going to localize it in English, French, and Italian.
Getting ready
Let's start by creating a SwiftUI app called RecipeApp
in Xcode.
We are going to use an image for the recipe, and you can find it in the GitHub repo here: https://github.com/PacktPublishing/SwiftUI-Cookbook/blob/master/Resources/Chapter13/recipe3/recipe.jpg.
The image was taken by the user FotoDanilo on Flickr (https://www.flickr...