Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSLocalizedStringFromTable not working in CocoaPod dependency

I've installed REActivityViewController as a pod. Here's the picture of the Resourcesfolder in the pod:

enter image description here

And here's one of the lines trying to pull the strings:

    [_cancelButton setTitle:NSLocalizedStringFromTable(@"button.cancel", @"REActivityViewController", @"Cancel") forState:UIControlStateNormal];

The button titles come out not-localized. In this example it shows button.cancel. It's also not just this button title but all the buttons in this dependancy.


EDIT

So in my Main Project under Info there's this. I can't click it to see what files those are. I have NSLocalizedStrings in my main project but I have yet to create a .strings files out of them:

enter image description here


EDIT

So I checked my Pods-resources.sh and found this:

 install_resource "REActivityViewController/REActivityViewController/REActivityViewController.bundle"
install_resource "REActivityViewController/REActivityViewController/Localizations/de.lproj"
install_resource "REActivityViewController/REActivityViewController/Localizations/en.lproj"
install_resource "REActivityViewController/REActivityViewController/Localizations/fr.lproj"
install_resource "REActivityViewController/REActivityViewController/Localizations/it.lproj"
install_resource "REActivityViewController/REActivityViewController/Localizations/ru.lproj"
install_resource "REActivityViewController/REActivityViewController/Localizations/uk.lproj"
install_resource "REActivityViewController/REActivityViewController/Localizations/zh-Hans.lproj"
like image 261
OdieO Avatar asked Mar 16 '26 22:03

OdieO


1 Answers

OK, I figured this out and it looks like it was somewhat isolated. I had checked the box Run script only when installing under Target -> Copy Pods Resources, because the script were painfully slow, so the script to install the bundle wasn't installing the bundle while debugging.

enter image description here

like image 153
OdieO Avatar answered Mar 21 '26 07:03

OdieO



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!