1

I have an app with two targets. Some localizations supported in one target is not supported in the other. Since in Xcode the localizations are specified on the project level and not on the target level, I need to know how to remove certain languages from each target.

I have tried adding build phase script

rm -r "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/fr.lproj"

but there is no effect. I still see the french localizations when the device is set to french (French should not be supported in this target), I want it to fall back to English localization. Is it possible?

Help would be appreciated.

shim
  • 9,289
  • 12
  • 69
  • 108
Neelesh
  • 3,673
  • 8
  • 47
  • 78
  • Make sure you're adding the script step after the copy resources step. – David Berry Apr 02 '14 at 15:14
  • How do i ensure that? In XCode I see this runscript is after "copy bundle resources" – Neelesh Apr 02 '14 at 15:17
  • Then it's in the right place. In the "Shell" field try adding -xe and double-check the path. – David Berry Apr 02 '14 at 15:19
  • 1
    Also you'll need to both clean in Xcode and remove the application from the target device for the change to take effect. Installing through Xcode just copies the new resources over the existing old resources, it doesn't ever delete anything. – David Berry Apr 02 '14 at 15:20
  • @David Can you write it as an answer, so I can mark it as correct or approved. – Neelesh Apr 03 '14 at 08:11
  • You can see optional solution (without script) at: https://stackoverflow.com/questions/47692289/xcode-target-specific-localization?answertab=active#tab-top – Ido Nave Dec 11 '17 at 09:10

1 Answers1

3

You'll need to both clean in Xcode and remove the application from the target device for the change to take effect. Installing through Xcode just copies the new resources over the existing old resources, it doesn't ever delete anything.

David Berry
  • 40,941
  • 12
  • 84
  • 95