Trying to make adding localized strings a bit easier:
prefix func § (string: String) -> String {
return NSLocalizedString(string, comment: "")
}
Using it like this:
let hello = §"hello_string"
While this works great when manually adding these strings to Localizable.strings, they are not automatically added with "Export Localizations" anymore. Also tried the following approaches which seem to have the same issue:
- https://stackoverflow.com/a/56445894/14542345
- Localized string with argument adds line breaks and brackets around argument
Is there a way around this? Or is the only solution to use NSLocalizedString("hello_string", comment: "")
?