Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
juclientlang
Advanced tools
For client-side language text.
$ npm install juclientlang
├── node_modules
│ ├── juclientlang
├── page.build.js
├── locales
│ ├── tr.js
│ └── en.js
├── page.html
└── page.js
<!-- lang attribute is required! -->
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="utf-8" />
</head>
<body>
<julang text="language"></julang>
<button id="changeBtn" julang="title:title;">
<julang text="title"></julang>
</button>
<script src="./page.build.js"></script>
</body>
</html>
const juLang = require("juclientlang");
const langPath = './locales';
juLang(langPath)
.then(function () {
console.log("language loaded.");
}).catch(function (err) {
console.log(err.message);
});
document.addEventListener("juLangChanged", function (e) {
console.log(e.detail);
});
document.getElementById("changeBtn").addEventListener("click", function (e) {
var html = document.getElementsByTagName("html")[0];
if (html.attributes.lang.value == "en")
html.setAttribute("lang", "tr");
else
html.setAttribute("lang", "en");
});
page.build.js file is generated from page.js with libraries like browserify or babel or parcel or webpack.
var juLangObject = {
language: "Türkçe",
title: "Değiştir"
}
juLang(languageScriptPath)
With the return of the Promise object, you can capture the completion of the process and errors.
Parameters:
languageScriptPath
: Path of language javascript files.juLangChanged Event
If you want to catch events after each change, use
document.addEventListener("juLangChanged", function handle(e) { ... })
handle Function Parameters:
e.detail
: Event result.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 juclientlang receives a total of 6 weekly downloads. As such, juclientlang popularity was classified as not popular.
We found that juclientlang 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.