Swift Localization
- Open Project properties and under
LocalizationsaddFrenchtoBaseandEnglish-Development Language - Add a new file called
Localizable.stringsusing theNew Filedialog and filtering toStrings File - Right-click the new file, select
Show File Inspectorand underLocalizationcheck bothEnglishandFrench - Two sub-files under
Localizable.stringsshould have appeared
To preview a language in SwiftUI
struct HomeView_Previews: PreviewProvider {
static var previews: some View {
HomeView()
.environment(\.locale, .init(identifier: "fr"))
}
}