From b0c4944d0af8cfdeaca3ed98c1324a81b12068d8 Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Thu, 13 Jan 2005 12:46:52 +0000 Subject: [PATCH] Bug 188557 Application name should not be hard-coded in "Illegal plug-in operation" dialog p=bugmail@q1n.org r+sr=jst git-svn-id: svn://10.0.0.236/trunk@167666 18797224-902f-48f8-a5cc-f745e15eee43 --- .../modules/plugin/base/src/nsPluginHostImpl.cpp | 15 +++++++++++++-- .../chrome/global/downloadProgress.properties | 5 +++-- .../locale/en-US/downloadProgress.properties | 5 +++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp index 657ae46948d..19eb3568d46 100644 --- a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -247,6 +247,7 @@ PRLogModuleInfo* nsPluginLogging::gNPPLog = nsnull; PRLogModuleInfo* nsPluginLogging::gPluginLog = nsnull; #endif +#define BRAND_PROPERTIES_URL "chrome://global/brand.properties" #define PLUGIN_PROPERTIES_URL "chrome://global/locale/downloadProgress.properties" #define PLUGIN_REGIONAL_URL "chrome://global-region/locale/region.properties" @@ -6141,6 +6142,15 @@ nsPluginHostImpl::HandleBadPlugin(PRLibrary* aLibrary, nsIPluginInstance *aInsta return rv; nsCOMPtr bundle; + rv = strings->CreateBundle(BRAND_PROPERTIES_URL, getter_AddRefs(bundle)); + if (NS_FAILED(rv)) + return rv; + + nsXPIDLString brandName; + if (NS_FAILED(rv = bundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(), + getter_Copies(brandName)))) + return rv; + rv = strings->CreateBundle(PLUGIN_PROPERTIES_URL, getter_AddRefs(bundle)); if (NS_FAILED(rv)) return rv; @@ -6150,8 +6160,9 @@ nsPluginHostImpl::HandleBadPlugin(PRLibrary* aLibrary, nsIPluginInstance *aInsta getter_Copies(title)))) return rv; - if (NS_FAILED(rv = bundle->GetStringFromName(NS_LITERAL_STRING("BadPluginMessage").get(), - getter_Copies(message)))) + const PRUnichar *formatStrings[] = { brandName.get() }; + if (NS_FAILED(rv = bundle->FormatStringFromName(NS_LITERAL_STRING("BadPluginMessage").get(), + formatStrings, 1, getter_Copies(message)))) return rv; if (NS_FAILED(rv = bundle->GetStringFromName(NS_LITERAL_STRING("BadPluginCheckboxMessage").get(), diff --git a/mozilla/toolkit/locales/en-US/chrome/global/downloadProgress.properties b/mozilla/toolkit/locales/en-US/chrome/global/downloadProgress.properties index aef5e4b6c46..25b03876a27 100644 --- a/mozilla/toolkit/locales/en-US/chrome/global/downloadProgress.properties +++ b/mozilla/toolkit/locales/en-US/chrome/global/downloadProgress.properties @@ -5,13 +5,14 @@ FilePickerTitle=Save File # LOCALIZATION NOTE (BadPluginTitle): # # This dialog is displayed when plugin throws unhandled exception -BadPluginTitle=Illegal Operation in Plugin +BadPluginTitle=Illegal Operation in Plug-in # LOCALIZATION NOTE (BadPluginMessage): # # This is the message for the BadPlugin dialog. +# %S will be replaced by brandShortName. # # Localizable URLs -BadPluginMessage=The plugin performed an illegal operation. You are strongly advised to restart Navigator. +BadPluginMessage=The plug-in performed an illegal operation. You are strongly advised to restart %S. # LOCALIZATION NOTE (BadPluginCheckboxMessage): # # This message tells the user that if they check this checkbox, they diff --git a/mozilla/xpfe/components/xfer/resources/locale/en-US/downloadProgress.properties b/mozilla/xpfe/components/xfer/resources/locale/en-US/downloadProgress.properties index aef5e4b6c46..25b03876a27 100644 --- a/mozilla/xpfe/components/xfer/resources/locale/en-US/downloadProgress.properties +++ b/mozilla/xpfe/components/xfer/resources/locale/en-US/downloadProgress.properties @@ -5,13 +5,14 @@ FilePickerTitle=Save File # LOCALIZATION NOTE (BadPluginTitle): # # This dialog is displayed when plugin throws unhandled exception -BadPluginTitle=Illegal Operation in Plugin +BadPluginTitle=Illegal Operation in Plug-in # LOCALIZATION NOTE (BadPluginMessage): # # This is the message for the BadPlugin dialog. +# %S will be replaced by brandShortName. # # Localizable URLs -BadPluginMessage=The plugin performed an illegal operation. You are strongly advised to restart Navigator. +BadPluginMessage=The plug-in performed an illegal operation. You are strongly advised to restart %S. # LOCALIZATION NOTE (BadPluginCheckboxMessage): # # This message tells the user that if they check this checkbox, they