@sakai-ui/sui-i18n
v3.0.6
Published
A collection of functions to allow code to get Sakai translations
Downloads
10
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-i18nUsage
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 lintTo automatically fix linting and formatting errors, run
npm run formatTesting with Web Test Runner
To execute a single test run:
npm run testTo run the tests in interactive watch mode run:
npm run test:watch