APIs & Integrations

nathanielleee
メンバー

"numbersOutOfRange" is wrong value to changing Phone Error Message

We have been trying to get a translation to work where instead of "

The number you entered is not in range., 

Shows instead; 

"Please enter a phone number that's at least 7 numbers long."

 

The value given to us on this hubspot thread: says that we should use the value numbersOutOfRange to translate the copy but that value doesnt seem to work. The full script we have is as follows:

 

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
hbspt.forms.create({
portalId: "5988104",
formId: "a0a2a594-e18f-42cc-bea3-7fc924afaf96",
locale: "en",
translations: {
en: {
phoneInvalidCharacters: "Please enter a phone number that's at least 7 numbers long.",
numbersOutOfRange:"test",
}
}

});
</script>

The phone invalid characters is working but the numbersoutofrange is not. Does anyone know of any other values that would work in this situation? It's supposed to show this error if they put any value less than 7 characters. 

0 いいね!
5件の返信
Oezcan
トップ投稿者 | Diamond Partner
トップ投稿者 | Diamond Partner

"numbersOutOfRange" is wrong value to changing Phone Error Message

Hey @dennisedson thanks for the mention and hello @nathanielleee .

 

I haven't worked with it yet, but to me it looks like you want to show a group of errors.

So I would set groupErrors to true.

Don't know if that makes sense.

 

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
hbspt.forms.create({
portalId: "5988104",
formId: "a0a2a594-e18f-42cc-bea3-7fc924afaf96",
groupErrors: true,
locale: "en",
translations: {
en: {
phoneInvalidCharacters: "Please enter a phone number that's at least 7 numbers long.",
numbersOutOfRange:"test",
}
}
});
</script>

 

Or you have to use for this case {locale: {fieldLabels: {fieldName: customLabel}}}

 

I hope it helps, best regards,

Özcan

Oezcan Eser Signature
0 いいね!
nathanielleee
メンバー

"numbersOutOfRange" is wrong value to changing Phone Error Message

Hey thanks but I think we are just trying to get the "numbersOutOfRange" translation to work. Currently with this fix, its still showing the default text instead of "test"

0 いいね!
nathanielleee
メンバー

"numbersOutOfRange" is wrong value to changing Phone Error Message

For the record, ive tried:

defaultInvalidRange
invalidNumberRangeTooSmall
defaultInvalidNumberRange
numbersOutOfRange
inputTooLarge
invalidNumberRangeTooLarge
phoneInvalidRangeTooShort

0 いいね!
TCD1975
参加者

"numbersOutOfRange" is wrong value to changing Phone Error Message

I know it's been a long time since you posted this issue, but I just came across the same problem, and I have just found the solution, so you (or anyone else who happen upon this page) may find it useful.

Change the translate value from "numbersOutOfRange" to "numberOutOfRange" (remove the "s" at the end of "numbers").

Niot great that HubSpot couldn't provide better support on the issue.

0 いいね!
dennisedson
HubSpot製品開発チーム
HubSpot製品開発チーム

"numbersOutOfRange" is wrong value to changing Phone Error Message

@Oezcan , any chance you could help here?