
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
A JavaScript library useful for compiling i18n translations in a custom language to JavaScript functions.
A JavaScript library useful for compiling i18n translations written in a DSL to JavaScript functions.
With an API that is to be considered unstable.
The DSL is defined in JISON files (see src/parsers/grammars). But to illustrate the key parts of the language here is an example:
Hello $name, it has been {{formatDate($timeSinceLastVisit, "months"}} since your last visit.
This would roughly translate into the following javascript function:
function(parameters, functions) {
return 'Hello ' + parameters.name + ', it has been ' + functions['formatDate'](parameters.timeSinceLastVisit, 'months') + ' since your last visit.';
}
It is worth noting that the actual function generated includes various rules regarding escaping output, that complicates the actual function.
Sometimes we need to use a different translation string based on the input variables.
Think situations where a you need to show the number of items in a shopping basket.
If there are 0 items in the basket we might want to show something like You have no items in your basket.
.
If there is 1 item we might want to show You have one item in your basket.
, and otherwise You have $n items in your basket
.
This is supported by adding constraints to the variables, basically allowing a series of if-statements to be generated inside the function.
FAQs
A JavaScript library useful for compiling i18n translations in a custom language to JavaScript functions.
We found that hablar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers 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.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.