mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1490444 - Localization should register its observers. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D5574 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
d43f067572
commit
164b059344
@ -65,6 +65,12 @@ DocumentL10n::Init(nsTArray<nsString>& aResourceIds)
|
||||
// is ready for localization.
|
||||
uint32_t ret;
|
||||
mDOMLocalization->AddResourceIds(aResourceIds, true, &ret);
|
||||
|
||||
// Register observers for this instance of
|
||||
// mozDOMLocalization to allow it to retranslate
|
||||
// the document when locale changes or pseudolocalization
|
||||
// gets turned on.
|
||||
mDOMLocalization->RegisterObservers();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ interface mozIDOMLocalization : nsISupports
|
||||
{
|
||||
unsigned long addResourceIds(in Array<AString> resourceIds, in bool aEager);
|
||||
unsigned long removeResourceIds(in Array<AString> resourceIds);
|
||||
void registerObservers();
|
||||
|
||||
Promise formatMessages(in Array<jsval> aKeys);
|
||||
Promise formatValues(in Array<jsval> aKeys);
|
||||
|
@ -27,6 +27,7 @@ L10nRegistry.registerSource(source);
|
||||
add_task(function test_methods_presence() {
|
||||
equal(typeof domLocalization.addResourceIds, "function");
|
||||
equal(typeof domLocalization.removeResourceIds, "function");
|
||||
equal(typeof domLocalization.registerObservers, "function");
|
||||
|
||||
equal(typeof domLocalization.formatMessages, "function");
|
||||
equal(typeof domLocalization.formatValues, "function");
|
||||
|
Loading…
Reference in New Issue
Block a user