Ask Your Question
4

When placed within ForEach, text in SwiftUI is not being localized.

asked 2023-06-02 23:00:55 +0000

david gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-06-02 23:18:02 +0000

devzero gravatar image

This may be because the localization key is not correctly specified for the text within the ForEach loop. To localize text within a ForEach loop, the localized string key needs to be specified in the following format:

ForEach(data) { item in
    Text(LocalizedStringKey("localizedStringKeyHere"))
}

Make sure that the proper key is being used, and that it is correctly localized in the different language folders of the project.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-02 23:00:55 +0000

Seen: 18 times

Last updated: Jun 02 '23