jackocnr / intl-tel-input

A JavaScript plugin for entering and validating international telephone numbers
https://intl-tel-input.com
MIT License
7.38k stars 1.93k forks source link

Demo with javascript locacles #1598

Closed eplatforms-uk closed 2 months ago

eplatforms-uk commented 2 months ago

Has anyone got a working demo with locales but in javascript ?

jackocnr commented 2 months ago

The i18n demo page is in javascript. What issue are you having?

eplatforms-uk commented 2 months ago

This is React though not javascript. Ideally wanted a javascript demo if it exists... otherwise I see only way us to do custom e.g. OPTION 2: define your own custom translations

I tried to do this as I could not fine a demo. So Arabic custom. But the Arabic didn't actually display unless you did a space after the "

e.g.

 // OPTION 2: define your own custom translations

intlTelInput(input, { i18n: {

af: " أفغانستان",

Notice the space after the " If you omit this space it shows English.

jackocnr commented 2 months ago

This is React though not javascript

No, it isn't React. What made you think that?

eplatforms-uk commented 2 months ago

Sorry my mistake I got confused along the way. I found your demo with import didn't actually work though. I had to do the following below this to get the Russian demo to work. Maybe it was due to running on windows hosting, but I was trying locally firstly on my mac then I uploaded sample to windows hosting and then had to make changes as below to get it working.

<!DOCTYPE html>

International Telephone Input

International Telephone Input