1

I have a xib file in my xcode project that is localized into two languages (English and German), due to some changes in the xib, this (German) localization is no longer required.

Is there an easy way remove this localization from it using xcode? At the moment I have just been unchecked both languages, and then manually copying the file out the .lproj directory back into the root.

I also thought I could just remove all the other languages except english, and it would automatically fall back, but this does not seem to be the case? When I do this and I am running the german, application crashes when it tries to load that xib file.

2
  • Did you "Project -> Clean" after removing the languages? It might help.
    – Martin R
    Dec 5, 2012 at 12:23
  • Did my answer serve you? Dec 6, 2012 at 10:19

1 Answer 1

1

NOTE: You need to use your project path. If you use find / it will recursively delete all lproj with supplied languages.

You can use a shell script to do this.

Create a shell script with following contents

sync
df
date
foreach language ( German )
    find / -name $language.lproj -type d -exec rm -r -- {} ; -prune
end
date
df
sync

Run it.

If you are new to shell script follow these:

Make it executable by using chmod +x nolproj in Terminal.

Run the above file by entering this in Terminal sudo ~/nolproj .

German will be removed!!!

If you want to remove few more langauage(lproj), just add languages as ( German Italian French)

2
  • find / ... - Do you really recommend to traverse the root filesystem and remove the matching language files in all projects stored on the computer? And on all mounted network volumes?
    – Martin R
    Dec 5, 2012 at 12:37
  • No from all projects...he can customize it accordingly. Sorry if someone tried this and ended by loosing all the lprojs :( Dec 5, 2012 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.