@sakai-ui/sui-i18n
v3.0.6
Published
A collection of functions to allow code to get Sakai translations
Downloads
9
Readme
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