In my company, I need to localize our jni-library. Our main application is written in Java and over JNI we are working with CEF3
(I know, there is a JCEF, but I need to resolve problem with CEF3)
The jnilib handles main menu like in this picture
I need to localize this menu, english and german.
What I did:
- Added Localizable.strings
- Added Strings in info tab on project settings
- Added Localizable.strings in copy bundle resources on target settings
- Renamed Localizable.strings and tried NSLocalizedStringFromTable
- Changed Localizable.strings encoding to UTF-16
- And of course tried all other "solutions" posted on stackoverflow and other webpages
- Tried this method: Localization of static lib
But every time I only get the key as value. If I print out BundlePath I get following path: (jdk home dir)
*/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin*
If I copy en.lproj and de.lproj to the bin dir (for test purposes), the localization is still not used.
I don't know what to do :/
I am working on MacOsX 10.10.3 with Xcode 6.3
Edit: Code snipped, that doesn't work, too.
NSString *path = @"pathtobundle/JNILIB.bundle";
bundle = [[NSBundle bundleWithPath:path] retain];
NSString *tmp = NSLocalizedStringFromTableInBundle(key, nil, bundle, nil);
jnilib.bundle structure:
/JNILIB.bundle
/en.lproj
/Localized.strings
/de.lproj
/Localized.strings