Let's assume that we can change in runtime Localizable.strings, that is placed in NSBundle At the current moment, even if we change it's contents, NSLocalizedString would return old(cached) values.
- Run Application
- Get LocalizableString for specific key1 <- value1
- Change Localizable.strings key1 = value2
- <-- Do something in application to invalidate Localization cache -->
- Check if LocalizableString for specific key1 == value2
What I've already tried:
- [[NSBundble mainBundle] invalidateResourceCache]
- [UIApplication _performMemoryWarning]
- Tried to see, if there's some dictionaries. used for caching, in ivars in NSBundle.
- Tried to see, in GNUStep implementation of NSBundle, but it's different from that we have in ios 6.0
What I cannot do (by definition): - I cannot swizzle [NSBundle localizableStringForKey:value:table] - I cannot change macroses - In general, I cannot affect Any Original Project code, only add something at step #4
This is only for development purposes only. So, I don't need to publish it in AppStore or something, so any private methods, or solutions are OK.
So, the question is. May be someone know the way to do it, or someone who give me another ideas how to do it? Thank you.