Git Product home page Git Product logo

dfralan / loom Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 345 KB

Loom is a lightweight language-switching library for dynamic content translation. Enhance user experience with customizable multilingual support. Easy integration for effortless language conversion.

Home Page: https://getloom.co

License: MIT License

JavaScript 17.49% HTML 82.51%
i18n i18n-js javascript reactive reactive-programming translation

loom's Introduction

loom.js

Loom is a language translation library written in pure javascript, that allows you to easily translate content on your website into different languages. It provides a simple way to integrate multilingual support and dynamically update the content based on the user's language preference.

** Updates 🤖 **

  • Translates content dynamically without page reloads
  • Supports multiple languages
  • Easy integration into existing websites
  • Automatically detects user's language preference
  • Provides language selector for users to switch languages

** Comenzando 🚀 **

  • Include the loom CDN in your HTML file:
<script src="https://cdn.jsdelivr.net/gh/dfralan/goloom@main/src/js/loom.js"></script>
  • Add the loom HTML markup to your page:
<!-- Language Selector -->
<!-- You can add the flag by adding the attribute 'flag', and modify the shape by setting its value to circular ('circular'), rounded ('rounded'), or squared by leaving the attribute blank -->
<loom flag>
  <a loom-indicator></a>
  <ul loom-list>
    <li loom-language="us"></li>
    <li loom-language="ar"></li>
    <li loom-language="br"></li>
    <li loom-language="fr"></li>
    <li loom-language="it"></li>
  </ul>
</loom>

<!-- Plain Label Application -->
<h1 loom="Hello ?? Hola ?? Ola ?? Bonjour ? Ciao"></h1>
   
<!-- Attribute Content Applications -->
<!-- Add 'loom-' as prefix to any attribute you want to set, it will react on changes or even on its creation. (Always add the 'loom' attribute first so 'loom' can observe it.) -->
<input loom-placeholder="Enter email ?? Ingrese su correo ?? Digite seu e-mail" loom>
<input loom-value="[email protected] ?? [email protected] ?? [email protected] [email protected] ?? [email protected] ??" loom>
   
<!-- Advance Applications -->
<!-- In case you deal with a large amount of code, or even are working with a team of translators, you can always fall back on loom matching, just set the default or global phrase, and loom will match the translated phrase based on the browser language, or the selected one by the user, if it doesn't find a match, it will keep the default phrase. -->
<h1 loom="Hello Dora"></h1>
    
<script>
  const loomTranslations = {
    "Hello Dora": {
      "us": "Hello Dora",
      "ar": "Hola Dora",
      "br": "Alô Dora",
      "fr": "Bonjour Dora",
      "it": "Ciao Dora"
    },
  }
</script>

** And you're ready to go! 🔧 **

Just observe the magic

  • Selector if you're using Bootstrap (Latest version):
<loom class="nav-link dropdown align-items-center d-flex" flag="circular">
  <a class="nav-link dropdown-toggle btn btn-secondary p-1 align-items-center" role="button"
    data-bs-toggle="dropdown" aria-expanded="false" loom-indicator>
  </a>
  <ul class="dropdown-menu" loom-list>
    <li role="button" class="dropdown-item" loom-language="us"></li>
    <li role="button" class="dropdown-item" loom-language="ar"></li>
    <li role="button" class="dropdown-item" loom-language="br"></li>
    <li role="button" class="dropdown-item" loom-language="fr"></li>
    <li role="button" class="dropdown-item" loom-language="it"></li>
  </ul>
</loom>

** Construido con 🛠️ **

  • Pure Javascript.

** Contribuyendo 🖇️ **

Por ahora solo ETH, sorry not sorry por el spanglish 🦧

** Autores ✒️ **

https://github.com/dfralan

dfralan - Trabajo Inicial - dfralan

También puedes mirar la lista de todos los contribuyentes quíenes han participado en este proyecto.

** Licencia 📄 **

Este proyecto está bajo la Licencia MIT - mira el archivo LICENSE.md para detalles

** Expresiones de Gratitud 🎁 **

  • Suma tu destreza al proyecto 📢
  • Realiza feedback de tu resultado en ejecución 🤓.
  • Deja volar tu imaginación 💫 (0x87C35820fe988e73c54f71fB69da61Ac05474d26) ETH wallet.

⌨️ con ❤️

https://github.com/dfralan 💁‍♂️

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.