Get started with jquery-localize CDN

MIT licensed

JQuery-localize is a plugin that enables dynamic content translation in jQuery applications.

Tags:
  • jquery
  • localize
  • internationalize
  • i18n

Stable version

Copied!

How to start using jquery-localize CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with jquery-localize CDN - cdnhub.io</title>
  <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  <script src="https://cdn.cdnhub.io/jquery-localize/0.1.0/jquery.localize.min.js"></script>
  <script>
    $(document).ready(function() {
      // Define your localization data
      $.localize({
        en: {
          greeting: "Hello, {0}!"
        },
        es: {
          greeting: "Hola, {0}!"
        }
      });

      // Set the language
      $.localize.language = 'es';

      // Use the localized string
      $('#greeting').text($.localize('greeting', 'John Doe'));
    });
  </script>
  <style>
    #greeting {
      font-size: 2em;
    }
  </style>
</head>
<body>
  <div id="greeting"></div>
</body>
</html>
Copied!
Copied!

All versions