Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
l10n-language-builder
Advanced tools
Readme
Command line utility for building internationalized JSON-based language files across multiple regions.
Install from NPM:
npm install l10n-language-builder
Now that your application has hit it big, you'd like to translate it into multiple languages. JSON seems like a good format to use since it's easy to traverse in JavaScript and has good support for nesting and grouping related terms together using objects. Also, Format.js and i18next are pretty cool, as is the ICU Message Syntax.
You'll start with your base language files. These should be named using the two character primary language subtag (ISO 639-1). For example: en.json (English), es.json (Spanish), fr.json (French).
Sample English (en.json):
{
"Intro": "Welcome to harbor center",
"Opening": "It's where ships seek shelter from stormy weather"
}
Any English speakers using your application from outside the United States will quickly point out that "center" is spelled "centre" and "harbor" is actually "harbour". To solve this, we need some regional overrides...
For each language, there might be zero or more regional overrides to handle region-specific changes. These files should be prefixed with the language subtag of the base language, followed by a hyphen, followed by a two character regional subtag. For example: en-CA.json (Canadian English), en-GB.json (United Kingdom English), en-AU.json (Australian English), and so on.
Sample Canadian English (en-CA.json):
{
"Intro": "Welcome to harbour centre"
}
These region-specific files only need to override the terms that differ from the base language. They can also be empty.
When you point l10n-language-builder
at a directory containing your base
and regional language files, it will produce a set of files that contains the
union of each base file with each regional override file. This is most useful
as a step in your application's build process.
Other features:
l10n-language-builder <path> <output> --fallback=fr
Where:
You can also use l10n-language-builder
from your JavaScript application:
var langBuilder = require('l10n-language-builder');
var opts = {
input: 'inputDir',
output: 'outputDir',
fallback: 'fr' // defaults to "en"
};
langBuilder(opts, function(err) {
// callback when processing is complete
});
Contributions are welcome, please submit a pull request!
This repository is configured with EditorConfig rules and contributions should make use of them.
FAQs
Library for generating localized language files for multiple regions
The npm package l10n-language-builder receives a total of 17 weekly downloads. As such, l10n-language-builder popularity was classified as not popular.
We found that l10n-language-builder 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.