With genstrings command line tool that's packaged with Xcode, we use that to extract all of the strings from our "NSLocalizedString" macros and compile a strings file.
The first thing that I need to create a new file in the root of our project directory.
Add a new strings file and call it "Localizable", that's the default title and put it in our base project folder. So here we have an empty "Localizable.strings" file. So now switch over to Terminal and run this command is your project directory not folder.
Use this command to import strings from Swift files only
find . -type f -name \*.swift -print0 | xargs -0 genstrings -o Base.lproj
use the genstrings command line tool to output our strings into the localizable strings file right here in our base folder.If you use objC project, run genstrings command below
Use this command to import strings from Objective-C implementation files only
find . -type f -name \*.m -print0 | xargs -0 genstrings -o Base.lproj
It didn't take long at all for your project and it extracted all of the strings.
Use this command to import strings from both Objective-C implementation files and Swift files
find . -type f \( -name \*.m -o -name \*.swift \) -print0 | xargs -0 genstrings -o Base.lproj