79226132

Date: 2024-11-26 09:55:48
Score: 2
Natty:
Report link

How do I correctly configure a Swift Package in a project to display localized strings from the package where we have strings Localized?

In your package, create a public value that refers to its bundle :

public let module: Bundle = .module

Then in your app, import your package, so you can access its module and use it in your views, i.e. your Text :

import MyPackage

Text(LocalizedStringKey("some.key"), bundle: MyPackage.module))
Reasons:
  • Blacklisted phrase (1): How do I
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): How do I
  • Low reputation (0.5):
Posted by: parapote