Skip to content

Repository files navigation

fluent-web

A web component that uses Fluent for localization.

Interactive example.

Locale en-USLocale pl
example result locale en-USexample result locale pl

Basic Usage:

yarn add @wolfadex/fluent-web or npm install @wolfadex@fluent-web

import"@wolfadex/fluent-web"import{FluentResource,FluentBundle}from"@fluent/bundle";constresource=newFluentResource(`hello = Hello, Fluent!`);constbundle=newFluentBundle("en-US");bundles.addResource(resource);consttextEl=document.getElementById("my-text-element");textEl.bundles=[bundle];

HTML:

<fluent-textid="my-text-element" messageid="hello"></fluent-text>

Result:

Hello, Fluent!

For how to build messages, see the Fluent docs.

Examples:

Docs:

See the Docs for more details.

About

A web component for using projectfluent.org/

Topics

Resources

Stars

45 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages