Back to Lit

@lit/localize transform example for TypeScript

packages/localize/examples/transform-ts/README.md

1.3.0772 B
Original Source

@lit/localize transform example for TypeScript

This package demonstrates an application that uses @lit/localize in transform mode with TypeScript.

Overview

  • A simple app that renders "Hello World" in 3 languages, with a drop-down locale picker.
  • Uses transform mode, so new locales are loaded with a page refresh, and for each locale there is no rendering overhead.
  • Demonstrates use of the @lit/localize-tools/lib/rollup.js library.
  • Persists the locale to the ?locale= URL parameter.

Setup

bash
git clone https://github.com/lit/lit.git
cd lit/packages/localize/examples/transform-ts
npm i
npm run build
npm run serve

Visit the URL that is logged to the console to view the app.