Localization & Customization

Switch between predefined languages or provide custom text for all UI elements.

Library setup

Localization uses the normal table import plus whichever locale bundles you want to switch between.

<link rel="stylesheet" href="../src/data-table.css" />

<script type="module">
  import { DogTable } from "../src/data-table.js";
  import { en } from "../src/locale/en.js";
  import { fr } from "../src/locale/fr.js";

  const table = new DogTable("#app", {
    data,
    language: en,
    columns: [
      { key: "name", label: "Name" },
      { key: "region", label: "Region" },
    ],
  });

  table.init();
  table.setLanguage(fr);
</script>