3.0.6 • Published 1 year ago

@sakai-ui/sui-i18n v3.0.6

Weekly downloads
-
License
ECL-2.0
Repository
github
Last release
1 year ago

sui-i18n

A set of utility functions for handling translations in Sakai. It converts java properties file formats into js objects.

Installation

npm i @sakai-ui/sui-i18n

Usage

import { loadProperties, tr } from "@sakai-ui/sui-i18n";

loadProperties("mybundle").then(r => {
  console.log(r.sometranslationkey);
});

const formattedValue = tr("mybundle", "sometranslationkey", ["sub1"]);

Linting and formatting

To scan the project for linting and formatting errors, run

npm run lint

To automatically fix linting and formatting errors, run

npm run format

Testing with Web Test Runner

To execute a single test run:

npm run test

To run the tests in interactive watch mode run:

npm run test:watch