Why it matters
- A tap on "call us" is the shortest road to an order on a phone. When the link has Arabic digits, or no country code and the visitor is abroad, nothing dials or the wrong number does.
- A number in Eastern Arabic digits is common because the same text is shown to people: the link's address must be a different, plain string.
- A
mailto:with a typo opens a mail app addressed to nobody, and the customer never writes. - The global form
+<country code><number>follows RFC 3966, which defines thetel:links.
Example
<li><a href="tel:0501234567" dir="ltr">اتصل بالرياض</a></li> <li><a href="tel:+٩٦٦٥٠١٢٣٤٥٦٧" dir="ltr">اتصل بالفرع الرئيسي</a></li>
<li><a href="tel:+966501234567" dir="ltr">اتصل بالرياض</a></li> <li><a href="tel:+96891234567" dir="ltr">اتصل بمسقط</a></li>
How to fix
Keep the text people read as you like, and write the address the machine dials in global form:
html
<a href="tel:+966501234567" dir="ltr">+966 50 123 4567</a>
<a href="mailto:[email protected]">[email protected]</a>- Country code first (
+966Saudi Arabia,+971UAE,+968Oman,+965Kuwait,+973Bahrain,+974Qatar,+20Egypt), then the number without its local 0. - Digits 0–9 in the address, whatever the digits shown.
- Show the number left to right with
dir="ltr"so its digits stay in order inside Arabic text. - Test each link on a phone.
How we detect
- We find the links that start with
tel:ormailto:. - A
tel:number is flagged when it has Eastern Arabic digits, when it does not start with+or00, or when, with a country code, it is not a possible number by the numbering plans libphonenumber uses (Google's data). - A
mailto:address is flagged when its first address has no @, no domain with a dot, or has spaces. Internationalised domains are accepted.
We never dial or send: the check is of the written form.