5.13.0 • Published 5 days ago

@mi18n/web v5.13.0

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
5 days ago

{% import "../../readmeMacros/macros.njk.md" as macros %}

{{ macros.header('Mi18n JS Web', 'The base of Mi18n JS integrations for Web platform', packageName) }}

What is Mi18n JS Web?

It's the core library of Mi18n JS integrations containing the parts supporting the web platform. For more information about Mi18n JS integrations, visit the docs({{ macros.v5link() }}).

{{ macros.links() }}

{{ macros.installation('web') }}

Usage

First, create a Mi18n instance and run it.

import { Mi18n, DevTools, FormatSimple } from "@mi18n/web";

const tg = Mi18n()
  .use(DevTools())
  .use(FormatSimple())
  .init({
    apiKey: "your_api_key",
    apiUrl: "https://app.mi18n.io",
  })

tg.run();

Then, use it to translate your strings.

tg.onLangLoaded.subscribe(() => {
  document.title = tg.translate("hello_world");
});

{{ macros.why() }}

Development

{{ macros.developmentInstallation() }} {{ macros.developmentCore() }}

{{ macros.developmentTesting('/packages/core') }}

End-to-end (e2e) testing

Each integration is end-to-end tested via cypress. The tests are defined in /e2e/cypress/e2e directory.

To run the e2e tests, simply run the following:

pnpm run e2e run <integration>

E.g.

pnpm run e2e run web

To open and play with e2e tests, run:

pnpm run e2e open <integration>

{{ macros.contributors() }}

5.13.0

5 days ago

5.12.8

3 months ago

5.12.8-alpha.0

3 months ago

5.12.7

3 months ago

5.12.6

3 months ago

5.12.5

8 months ago

5.12.4

8 months ago

5.12.3

8 months ago

5.12.2

8 months ago

5.12.1

8 months ago

5.12.0

8 months ago