I searched for this error online and here. Online it shows me results in a different language then english nice Google. Here it has one post and a guy that never really answered the guys question.
I have my xcode project folder on my desktop. Inside the project folder I have an en.lproj folder that has both iPad and iPhone storyboards inside along with a localization.plist file. However when I launch the project in Xcode this en.lproj folder is nowhere to be found. So this might be the problem?
With the project folder on my desktop I launch terminal type in: cd
then drag my project folder into Terminal and it gives me the path. I then paste this line of code into the Terminal
find . -name *.m | xargs genstrings -o en.lproj
I get this error message in the Terminal:
genstrings: couldn't connect to output directory en.lproj
it prints this line multiple times and then says my project is a path to a directory?
No .strings file is made. Any thoughts on what I am doing wrong? I got UILabels that I dragged and dropped from inside Storyboards, but I also I strings that are coded with
NSLocalizedString(@"First Level Passed", @"This is a message displayed on screen to allow the user to know they have passed the first level!");
So the above Terminal code snippet should be finding those NSLocalizedStrings right? I think it isn't even getting to find the en.lproj folder in the first place but I don't know?
Any help would be great.
I got the same error, while execute the following command as per the tutorials.
genstrings -o en.lproj *.swift
Above command gives me following error:
genstrings: couldn't connect to output directory en.lproj
My issue:
Solution:
On command line move to the Root directory of project where you can get the all the ".lproj" directories.
Add the path of file, where you listed all the "NSLocalizedString("TEXT", comment: "COMMENT")" - in my case i have listed everything on "Constants.swift" file.
So, i have execute the following command and its work like charm.
genstrings -o en.lproj/ #ProjectPath#/Constants/Constants.swift
Note: File path will be easily get via just drag file from the Xcode and drop to the terminal.
Better late then never,
you are creating a file (localizable.strings) in the folder projectroot/en.lproj. If this folder doesn't exist you get this error message. Simply create the folder en.lproj in the root and the command should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With