diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 1060e1d5b4f2..7c766e065599 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -3361,6 +3361,13 @@ nsIDocument::LocalizationLinkAdded(Element* aLinkElement) AutoTArray resourceIds; resourceIds.AppendElement(href); mDocumentL10n->AddResourceIds(resourceIds); + } else if (mReadyState == READYSTATE_COMPLETE) { + // Otherwise, if the document has already been parsed + // we need to lazily initialize the localization. + AutoTArray resourceIds; + resourceIds.AppendElement(href); + InitializeLocalization(resourceIds); + mDocumentL10n->TriggerInitialDocumentTranslation(); } else { // Otherwise, we're still parsing the document. // In that case, add it to the pending list. This list