struct TabItem: Identifiable { var id = UUID() var name: String var icon: String var tab: TabEnum } var tabItems = [ TabItem(name: "home", icon: "house", tab: .home), ] ForEach(tabItems) { item in // string localizable not working in here // item.name is "home" Text(item.name) // but if write code like this, it's ok Text("home") } It has been proved that if a string in Text(“home) is passed as a text, it can only be interpreted as a localized keyword.
https://blog.iostao.com/2022/09/swiftui-string-localization-notwork/
struct TabItem: Identifiable { var id = UUID() var name: String var icon: String var tab: TabEnum } var tabItems = [ TabItem(name: "home", icon: "house", tab: .home), ] ForEach(tabItems) { item in // string localizable not working in here // item.name is "home" Text(item.name) // but if write code like this, it's ok Text("home") } It has been proved that if a string in Text(“home) is passed as a text, it can only be interpreted as a localized keyword.