![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
lisan
Advanced tools
Readme
i18n, Reimagined!
A blazing fast and super small i18n library for Javascript
Website
Installation ·
API ·
Guides & Tips
Lisan (Turkish: lee · sun) is an i18n (internationalization) library.
It provides all essential tooling to have multiple languages in your applications and format numbers, currencies, ordinals & dates based on locale.
Lisan's biggest difference compared to traditional i18n libraries is taking advantage of ES6 Template Literals and using them to generate functions to interpolate strings.
Most of the i18n libraries are based on some sort of template engine to interpolate strings and these template engines use regex or loops under the hood to find & replace the placeholders.
However, using regex lookups or javascript loops decreases the performance significantly (especially on client-side) since find & replace is being done on runtime.
Lisan adds an extra step to CI, but a giant performance gain to app kind!
Lisan introduces a Dictionary concept where a dictionary entry can be either just a string or a javascript function that interpolates placeholders and returns a string. Since there is no need finding & replacing placeholder templates, we can avoid using regex or loops.
It is that simple.
Of course, maintaining javascript files to store translations could be challenging and not ideal. Especially when using third-party software like transifex or crowdin.
That's why Lisan also provides a compiler and a command line tool to generate Dictionary objects from Translation JSON files. Dictionary objects are saved in javascript files.
Also, you can use existing plugins or write your plugins to extend the capabilities of Lisan.
lisan-plugin-l10n
:
adds localization formatters.lisan-plugin-loader
:
adds loading methods to dynamically import javascript files.You can install lisan from the sources below, as you see fit.
npm install lisan
<script src="https://unpkg.com/lisan/dist/index.umd.js" type="text/javascript"></script>
After adding the script tag above, all public variables
will be accessible via window.lisanJS
variables.
Usage:
<script
src="https://unpkg.com/lisan/dist/index.umd.js"
type="text/javascript"
></script>
<script type="text/javascript">
(() => {
const { lisan, t, c, Lisan } = window.lisanJS;
})();
</script>
Platform | IE | Edge | Firefox | Chrome | Nodejs |
---|---|---|---|---|---|
Version | 8+ | All | All | All | 8+ |
This package is MIT licensed.
FAQs
Lisan - A Blazing fast i18n library
The npm package lisan receives a total of 11 weekly downloads. As such, lisan popularity was classified as not popular.
We found that lisan demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.