Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
adds support for base internationalization #846
If a pod uses base internationalization in it's resources files (.xibs, .storyboards) then this change will make sure external strings files are used when appropriate. Recommended strategy that has worked for me is the following, my podspec contains the following resource line:
With lproj in the resources line, they will be included as folders in the Pods project. While not ideal in that XCode does not recognize them as localization bundles, the change to the script will now instruct ibtool to use the external strings in Base.lproj and the language files rather than assuming the text is hardcoded.
The important thing is that when doing this, do not include *.strings as a resource or it will copy the strings out of the lproj bundles into the root and further confuse XCode.
Did you test to see what happens in that case?
Looks good to me... @alloy what is your take?
Yeah, if you include *.strings as part of that resources string, then you will just see all the strings files under your localization bundles show up in the root resources group for that pod. Doesn't really damage anything, app still runs, but I make no guarantees about whether or not i18n works in that case.
Ideally, I would say if you have any external strings that you really do want to copy as normal files, then you should name them explicitly, or put them somewhere else (like you had suggested earlier) where you can add a mask to specifically include them without picking up all the .lproj/.strings files. For example, I have a file called Templates.strings which includes some string resources that don't need to be i18n'd. I just explicitly added that file to my resources list.
added a commit
this pull request
Mar 12, 2013
This breaks my pods with non base i18ned xibs and storyboards. I get the following error on iOS5...
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLocalizableString'
To get around the error I have to remove --reference-external-strings-file.
Same problem as @onato here. From the ibtool man pages:
and seemingly available on iOS 6+ only