Closed Bug 753220 Opened 12 years ago Closed 7 years ago

plugin-container must support mixed localizations

Categories

(Core Graveyard :: Plug-ins, defect)

12 Branch
x86_64
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: towatson, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0
Build ID: 20120420145725

Steps to reproduce:

Develop a plug-in that has multiple language bundles.  This is a Localizable.strings file in a <locale>.lproj (e.g. fr.lproj) folder all under the Resources folder of the application package.

Change the system language and try to use localized strings for that language.


Actual results:

English is always used even though when I debug the settings, the preferred language is not English...

[NSLocale preferredLanguages] objectAtIndex: 0]

and even though the plug-in has the desired language bundle and the plug-in's own bundle...

[NSBundle bundleWithIdentifier: @"com.adobe.acroat.pdfviewerNPAPI"]

has shows that the language is available and in fact even the preferred one...

[bundle preferredLocalizations] objectAtIndex: 0]

The reason for this is that the plugin-container has it's own bundle that only contains an English.lproj language bundle and this causes English to be used in all cases (assuming the plug-in has an English language bundle which it does.

The solution is to add the property...

CFBundleAllowMixedLocalizations = YES

to the plugin-contaner's Info.plist.  This is a not vey well documented Apple feature that is designed for just this situation where an application wants to load one or more frameworks and let them use their own bundles.  This is not the default because of concern that there might be confusion between multiple bundles in the same process.  

Other solutions are possible, but I don't think as good.  You could, for example, have more language bundles in the plugin-process, but you would have to have all language bundles that any plug-in might have.  I have also tried removing all language bundles from the plugin-container and this causes the plug-in to use the default cases when loading localized strings instead of any of the localizations.

BTW, I tested this in a French version of FireFox 12 running on OSX7 with the language set to French and a plug-in with English and French (fr) language bundles.  While FireFox had a fr.lproj bundle, the plugin-container always has only English. 






Expected results:

The plug-in should be able to use language bundles corresponding to the preferred language on the platform provided that it has these.
OS: Windows 7 → Mac OS X
Priority: -- → P4
Hardware: x86 → x86_64
Component: Untriaged → Plug-ins
Priority: P4 → --
Product: Firefox → Core
QA Contact: untriaged → plugins
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.