johnno1962 / injectionforxcode

Runtime Code Injection for Objective-C & Swift
MIT License
6.55k stars 565 forks source link

NSLocalizedString isn't replaced after injection #127

Open castus opened 8 years ago

castus commented 8 years ago

I was wondering if this is possible to refresh all NSLocalizedStrings after injection? Now, when I inject the code and re-render the view in "injected" method, instead of proper translated labels I have key strings. What do you recon?

johnno1962 commented 8 years ago

Not sure why that would be or how it could be automated. Any ideas?

orta commented 8 years ago

I bet the NSLocalizedString macro looks inside the current bundle for the key value lookup, then when injected it looks up inside the injection bundle for the key value, which fails