Loading browser/installer/package-manifest.in +3 −0 Original line number Diff line number Diff line Loading @@ -345,6 +345,9 @@ @RESPATH@/res/dtd/* @RESPATH@/res/language.properties @RESPATH@/res/locale/layout/HtmlForm.properties @RESPATH@/res/locale/layout/MediaDocument.properties @RESPATH@/res/locale/layout/xmlparser.properties @RESPATH@/res/locale/dom/dom.properties #ifdef XP_MACOSX @RESPATH@/res/MainMenu.nib/ #endif Loading dom/base/nsContentUtils.cpp +13 −4 Original line number Diff line number Diff line Loading @@ -3531,7 +3531,9 @@ static const char* gPropertiesFiles[nsContentUtils::PropertiesFile_COUNT] = { "chrome://global/locale/security/security.properties", "chrome://necko/locale/necko.properties", "chrome://global/locale/layout/HtmlForm.properties", "resource://gre/res/locale/layout/HtmlForm.properties"}; "resource://gre/res/locale/layout/HtmlForm.properties", "chrome://global/locale/dom/dom.properties", "resource://gre/res/locale/dom/dom.properties"}; /* static */ nsresult nsContentUtils::EnsureStringBundle(PropertiesFile aFile) { Loading Loading @@ -3580,7 +3582,8 @@ void nsContentUtils::AsyncPrecreateStringBundles() { } } static bool SpoofLocaleEnglish() { /* static */ bool nsContentUtils::SpoofLocaleEnglish() { // 0 - will prompt // 1 - don't spoof // 2 - spoof Loading @@ -3591,9 +3594,12 @@ static bool SpoofLocaleEnglish() { nsresult nsContentUtils::GetLocalizedString(PropertiesFile aFile, const char* aKey, nsAString& aResult) { // When we spoof English, use en-US default strings in HTML forms. // When we spoof English, use en-US properties in strings that are accessible // by content. if (aFile == eFORMS_PROPERTIES_MAYBESPOOF && SpoofLocaleEnglish()) { aFile = eFORMS_PROPERTIES_en_US; } else if (aFile == eDOM_PROPERTIES_MAYBESPOOF && SpoofLocaleEnglish()) { aFile = eDOM_PROPERTIES_en_US; } nsresult rv = EnsureStringBundle(aFile); Loading @@ -3608,9 +3614,12 @@ nsresult nsContentUtils::FormatLocalizedString(PropertiesFile aFile, const char16_t** aParams, uint32_t aParamsLength, nsAString& aResult) { // When we spoof English, use en-US default strings in HTML forms. // When we spoof English, use en-US properties in strings that are accessible // by content. if (aFile == eFORMS_PROPERTIES_MAYBESPOOF && SpoofLocaleEnglish()) { aFile = eFORMS_PROPERTIES_en_US; } else if (aFile == eDOM_PROPERTIES_MAYBESPOOF && SpoofLocaleEnglish()) { aFile = eDOM_PROPERTIES_en_US; } nsresult rv = EnsureStringBundle(aFile); Loading dom/base/nsContentUtils.h +4 −0 Original line number Diff line number Diff line Loading @@ -1119,6 +1119,8 @@ class nsContentUtils { eNECKO_PROPERTIES, eFORMS_PROPERTIES_MAYBESPOOF, eFORMS_PROPERTIES_en_US, eDOM_PROPERTIES_MAYBESPOOF, eDOM_PROPERTIES_en_US, PropertiesFile_COUNT }; static nsresult ReportToConsole( Loading @@ -1132,6 +1134,8 @@ class nsContentUtils { static void LogMessageToConsole(const char* aMsg); static bool SpoofLocaleEnglish(); /** * Get the localized string named |aKey| in properties file |aFile|. */ Loading dom/html/HTMLSelectElement.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1539,7 +1539,7 @@ nsresult HTMLSelectElement::GetValidationMessage(nsAString& aValidationMessage, case VALIDITY_STATE_VALUE_MISSING: { nsAutoString message; nsresult rv = nsContentUtils::GetLocalizedString( nsContentUtils::eDOM_PROPERTIES, "FormValidationSelectMissing", nsContentUtils::eDOM_PROPERTIES_MAYBESPOOF, "FormValidationSelectMissing", message); aValidationMessage = message; return rv; Loading dom/html/HTMLTextAreaElement.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -1001,7 +1001,7 @@ nsresult HTMLTextAreaElement::GetValidationMessage( const char16_t* params[] = {strMaxLength.get(), strTextLength.get()}; rv = nsContentUtils::FormatLocalizedString( nsContentUtils::eDOM_PROPERTIES, "FormValidationTextTooLong", params, nsContentUtils::eDOM_PROPERTIES_MAYBESPOOF, "FormValidationTextTooLong", params, message); aValidationMessage = message; } break; Loading @@ -1017,13 +1017,13 @@ nsresult HTMLTextAreaElement::GetValidationMessage( const char16_t* params[] = {strMinLength.get(), strTextLength.get()}; rv = nsContentUtils::FormatLocalizedString( nsContentUtils::eDOM_PROPERTIES, "FormValidationTextTooShort", params, nsContentUtils::eDOM_PROPERTIES_MAYBESPOOF, "FormValidationTextTooShort", params, message); aValidationMessage = message; } break; case VALIDITY_STATE_VALUE_MISSING: { nsAutoString message; rv = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES, rv = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES_MAYBESPOOF, "FormValidationValueMissing", message); aValidationMessage = message; Loading Loading
browser/installer/package-manifest.in +3 −0 Original line number Diff line number Diff line Loading @@ -345,6 +345,9 @@ @RESPATH@/res/dtd/* @RESPATH@/res/language.properties @RESPATH@/res/locale/layout/HtmlForm.properties @RESPATH@/res/locale/layout/MediaDocument.properties @RESPATH@/res/locale/layout/xmlparser.properties @RESPATH@/res/locale/dom/dom.properties #ifdef XP_MACOSX @RESPATH@/res/MainMenu.nib/ #endif Loading
dom/base/nsContentUtils.cpp +13 −4 Original line number Diff line number Diff line Loading @@ -3531,7 +3531,9 @@ static const char* gPropertiesFiles[nsContentUtils::PropertiesFile_COUNT] = { "chrome://global/locale/security/security.properties", "chrome://necko/locale/necko.properties", "chrome://global/locale/layout/HtmlForm.properties", "resource://gre/res/locale/layout/HtmlForm.properties"}; "resource://gre/res/locale/layout/HtmlForm.properties", "chrome://global/locale/dom/dom.properties", "resource://gre/res/locale/dom/dom.properties"}; /* static */ nsresult nsContentUtils::EnsureStringBundle(PropertiesFile aFile) { Loading Loading @@ -3580,7 +3582,8 @@ void nsContentUtils::AsyncPrecreateStringBundles() { } } static bool SpoofLocaleEnglish() { /* static */ bool nsContentUtils::SpoofLocaleEnglish() { // 0 - will prompt // 1 - don't spoof // 2 - spoof Loading @@ -3591,9 +3594,12 @@ static bool SpoofLocaleEnglish() { nsresult nsContentUtils::GetLocalizedString(PropertiesFile aFile, const char* aKey, nsAString& aResult) { // When we spoof English, use en-US default strings in HTML forms. // When we spoof English, use en-US properties in strings that are accessible // by content. if (aFile == eFORMS_PROPERTIES_MAYBESPOOF && SpoofLocaleEnglish()) { aFile = eFORMS_PROPERTIES_en_US; } else if (aFile == eDOM_PROPERTIES_MAYBESPOOF && SpoofLocaleEnglish()) { aFile = eDOM_PROPERTIES_en_US; } nsresult rv = EnsureStringBundle(aFile); Loading @@ -3608,9 +3614,12 @@ nsresult nsContentUtils::FormatLocalizedString(PropertiesFile aFile, const char16_t** aParams, uint32_t aParamsLength, nsAString& aResult) { // When we spoof English, use en-US default strings in HTML forms. // When we spoof English, use en-US properties in strings that are accessible // by content. if (aFile == eFORMS_PROPERTIES_MAYBESPOOF && SpoofLocaleEnglish()) { aFile = eFORMS_PROPERTIES_en_US; } else if (aFile == eDOM_PROPERTIES_MAYBESPOOF && SpoofLocaleEnglish()) { aFile = eDOM_PROPERTIES_en_US; } nsresult rv = EnsureStringBundle(aFile); Loading
dom/base/nsContentUtils.h +4 −0 Original line number Diff line number Diff line Loading @@ -1119,6 +1119,8 @@ class nsContentUtils { eNECKO_PROPERTIES, eFORMS_PROPERTIES_MAYBESPOOF, eFORMS_PROPERTIES_en_US, eDOM_PROPERTIES_MAYBESPOOF, eDOM_PROPERTIES_en_US, PropertiesFile_COUNT }; static nsresult ReportToConsole( Loading @@ -1132,6 +1134,8 @@ class nsContentUtils { static void LogMessageToConsole(const char* aMsg); static bool SpoofLocaleEnglish(); /** * Get the localized string named |aKey| in properties file |aFile|. */ Loading
dom/html/HTMLSelectElement.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1539,7 +1539,7 @@ nsresult HTMLSelectElement::GetValidationMessage(nsAString& aValidationMessage, case VALIDITY_STATE_VALUE_MISSING: { nsAutoString message; nsresult rv = nsContentUtils::GetLocalizedString( nsContentUtils::eDOM_PROPERTIES, "FormValidationSelectMissing", nsContentUtils::eDOM_PROPERTIES_MAYBESPOOF, "FormValidationSelectMissing", message); aValidationMessage = message; return rv; Loading
dom/html/HTMLTextAreaElement.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -1001,7 +1001,7 @@ nsresult HTMLTextAreaElement::GetValidationMessage( const char16_t* params[] = {strMaxLength.get(), strTextLength.get()}; rv = nsContentUtils::FormatLocalizedString( nsContentUtils::eDOM_PROPERTIES, "FormValidationTextTooLong", params, nsContentUtils::eDOM_PROPERTIES_MAYBESPOOF, "FormValidationTextTooLong", params, message); aValidationMessage = message; } break; Loading @@ -1017,13 +1017,13 @@ nsresult HTMLTextAreaElement::GetValidationMessage( const char16_t* params[] = {strMinLength.get(), strTextLength.get()}; rv = nsContentUtils::FormatLocalizedString( nsContentUtils::eDOM_PROPERTIES, "FormValidationTextTooShort", params, nsContentUtils::eDOM_PROPERTIES_MAYBESPOOF, "FormValidationTextTooShort", params, message); aValidationMessage = message; } break; case VALIDITY_STATE_VALUE_MISSING: { nsAutoString message; rv = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES, rv = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES_MAYBESPOOF, "FormValidationValueMissing", message); aValidationMessage = message; Loading