Skip to content
Snippets Groups Projects
Verified Commit c482ead8 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

Bug 1875306 - Localize numbers in the underflow and overflow error messages. r=emilio

parent 0cf18a7d
No related branches found
No related tags found
1 merge request!1135Bug 43084: Rebased stable onto 115.15.0esr
......@@ -52,11 +52,7 @@ nsresult NumericInputTypeBase::GetRangeOverflowMessage(nsAString& aMessage) {
MOZ_ASSERT(!maximum.isNaN());
nsAutoString maxStr;
char buf[32];
DebugOnly<bool> ok = maximum.toString(buf, ArrayLength(buf));
maxStr.AssignASCII(buf);
MOZ_ASSERT(ok, "buf not big enough");
ConvertNumberToString(maximum, maxStr);
return nsContentUtils::FormatMaybeLocalizedString(
aMessage, nsContentUtils::eDOM_PROPERTIES,
"FormValidationNumberRangeOverflow", mInputElement->OwnerDoc(), maxStr);
......@@ -67,11 +63,7 @@ nsresult NumericInputTypeBase::GetRangeUnderflowMessage(nsAString& aMessage) {
MOZ_ASSERT(!minimum.isNaN());
nsAutoString minStr;
char buf[32];
DebugOnly<bool> ok = minimum.toString(buf, ArrayLength(buf));
minStr.AssignASCII(buf);
MOZ_ASSERT(ok, "buf not big enough");
ConvertNumberToString(minimum, minStr);
return nsContentUtils::FormatMaybeLocalizedString(
aMessage, nsContentUtils::eDOM_PROPERTIES,
"FormValidationNumberRangeUnderflow", mInputElement->OwnerDoc(), minStr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment