Giter VIP home page Giter VIP logo

Comments (4)

jackocnr avatar jackocnr commented on June 16, 2024

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

from intl-tel-input.

eplatforms-uk avatar eplatforms-uk commented on June 16, 2024

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.

from intl-tel-input.

jackocnr avatar jackocnr commented on June 16, 2024

This is React though not javascript

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

from intl-tel-input.

eplatforms-uk avatar eplatforms-uk commented on June 16, 2024

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.

<title>International Telephone Input</title>

International Telephone Input

Submit
<script src="./build/js/intlTelInput.js"></script>
<script type="module">
  // Import named exports
  import { countryTranslations, interfaceTranslations } from "./build/js/i18n/ru/index.js";
  
  // Import default export
  import ruTranslations from "./build/js/i18n/ru/index.js";

  const input = document.querySelector("#phone");

  // You can use either the named exports or the default export here
  window.intlTelInput(input, {
    // Using named exports
    i18n: { ...countryTranslations, ...interfaceTranslations },

    // Using default export
    // i18n: ruTranslations,

    initialCountry: "ru",
    utilsScript: "./build/js/utils.js",
  });
</script>

from intl-tel-input.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.