In a normal macOS .app package, I can get localized text from various frameworks, like
NSLocalizedDescriptionKey, as long as I have added the system's current language as a localization in Xcode. This amounts to an .lproj directory being added inside the app package's Contents/Resources directory.
But command line tools don't have any such directory.
So how can I get the same behaviour from those frameworks in a command line tool?
Weird. This just came up on Swift Forums, so I assumed it was a duplicate but that’s clearly not the case.
Personally, if I need to localise a tool I just embed the tool in an app-like structure and use all the standard bundle localisation techniques.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"