My app is cross-platform and I don't use Xcode project.
All localization inside app is performed with an internal code and works fine.
There is a problem with localization in NSOpenPanel and NSSavePanel. They always appear on English and don't use macOS current language (French) of an user.
I added the following code to Info.plist :
But NSOpenPanel still appears on English.
I checked macOS TextEdit app which shows NSOpenPanel correctly with current OS language. Its Info.plist doesn't set any CFBundleLocalizations records. How this app tells macOS what language should be used for NSOpenPanel?
All localization inside app is performed with an internal code and works fine.
There is a problem with localization in NSOpenPanel and NSSavePanel. They always appear on English and don't use macOS current language (French) of an user.
I added the following code to Info.plist :
Code Block <key>CFBundleLocalizations</key> <array> <string>en</string> <string>fr</string> </array>
But NSOpenPanel still appears on English.
I checked macOS TextEdit app which shows NSOpenPanel correctly with current OS language. Its Info.plist doesn't set any CFBundleLocalizations records. How this app tells macOS what language should be used for NSOpenPanel?
Thanks for your all replies.
I found a solution:
It seems to be a bug in macOS, because I run APP bundle and localization must work. So I copied manually real executable to /MacOS folder (as for a release version) and now everything works fine.
2. Also I discovered that I can use one of two options:
A. Add CFBundleLocalizations records for each supported language.
B. Or add an empty folder for each language in /Contents/Resources - fr.lproj , de.lproj , etc.
Any of these variants for to use OS language in NSOpenPanel and NSSavePanel.
I hope that this info will be useful for for somebody else.
I found a solution:
Localization doesn't work if I use a symbolic link to an executable file.
It seems to be a bug in macOS, because I run APP bundle and localization must work. So I copied manually real executable to /MacOS folder (as for a release version) and now everything works fine.
2. Also I discovered that I can use one of two options:
A. Add CFBundleLocalizations records for each supported language.
B. Or add an empty folder for each language in /Contents/Resources - fr.lproj , de.lproj , etc.
Any of these variants for to use OS language in NSOpenPanel and NSSavePanel.
I hope that this info will be useful for for somebody else.