Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
For client-side language text.
$ npm install jang
<!-- html lang attribute default language -->
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="utf-8" />
</head>
<body>
<jang text="language"></jang>
<button id="changeBtn" jang="title:title;">
<jang text="change.title"></jang>
</button>
<script src="./index.build.min.js"></script>
</body>
</html>
const jang = require("jang");
const en = require('./locales/en.js');
const tr = require('./locales/tr.js');
jang.add('en', en);
jang.add([
{ name: 'tr', value: tr }
]);
// html lang attribute is default language or if it doesn't exist, first added language is default
jang.refresh();
jang.onChange(function (name, value) {
console.log('current language: ' + name);
});
document.getElementById("changeBtn").addEventListener("click", function (e) {
jang.set(jang.current == 'tr' ? 'en' : 'tr');
});
document.getElementById("addBtn").addEventListener("click", function (e) {
var div = document.createElement('div');
div.innerHTML = `<jang text="language"></jang>
<button jang="title:new.title;"> <jang text="new.title"></jang> </button>`;
document.querySelector('body').append(div);
jang.refresh();
});
index.build.js file is generated from index.js with libraries like browserify or babel or parcel or webpack.
module.exports = {
title: "Türkçe",
}
module.exports = {
title: "Engilish",
}
This example shows the most basic way of usage.
This software is free to use under the JosephUz. See the LICENSE file for license text and copyright information.
FAQs
For client-side language text
The npm package jang receives a total of 4 weekly downloads. As such, jang popularity was classified as not popular.
We found that jang 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.