![pnpm 9.5 Introduces Catalogs: Shareable Dependency Version Specifiers](https://cdn.sanity.io/images/cgdhsj6q/production/c06a5b74512bcc6da29d38cef96a454fa947810d-1024x1024.webp?w=400&fit=max&auto=format)
Security News
pnpm 9.5 Introduces Catalogs: Shareable Dependency Version Specifiers
pnpm 9.5 introduces a Catalogs feature, enabling shareable dependency version specifiers, reducing merge conflicts and improving support for monorepos.
i18next-client
Advanced tools
Readme
looking for contributors interested in helping the project (long term):
Project goal is to provide an easy way to translate a website on clientside:
Check out the documentation
Check CHANGELOG for changes.
Assuming we loaded en-US, en and dev resources for two namespaces ('ns.special' and 'ns.common'):
// given loaded and merged dictionaries in i18next.js to:
{
"en_US": {
"ns.special": {
"app": {
"name": "i18n",
"insert": "you are __youAre__",
"child": "__count__ child",
"child_plural": "__count__ children"
}
},
"ns.common": {}
},
"en": {
"ns.special": {
"app": {
"area": "Area 51"
}
},
"ns.common": {}
},
"dev": {
"ns.common": {
"app": {
"company": {
"name": "my company"
}
},
"add": "add"
},
"ns.special": {
"nav": {
"1": "link1",
"2": "link2",
"home": "home"
}
}
}
}
$.t(key, [options])
$.i18n.init({
lng: 'en-US',
ns: { namespaces: ['ns.common', 'ns.special'], defaultNs: 'ns.special'}
}, function() {
$.t('app.name'); // -> i18n (from en-US resourcefile)
$.t('app.area'); // -> Area 51 (from en resourcefile)
$.t('ns.common:app.company.name'); // -> my company (from dev resourcefile)
$.t('ns.common:add'); // -> add (from dev resourcefile)
});
$.t('app.insert', {youAre: 'great'}) // -> you are great
$.t('app.child', {count: 1}) // -> 1 child
$.t('app.child', {count: 3}) // -> 3 children
$.t(['app.missingKey', 'app.existingKey'], {greeting: "hello"}) // -> I am the existing key: hello
$('.mySelector').i18n()
assuming you have added the data-i18n="key"
attribute to your elements // given
<ul class="nav">
<li class="active"><a href="#" data-i18n="nav.home">home</a></li>
<li><a href="#" data-i18n="nav.1">link1</a></li>
<li><a href="#" data-i18n="nav.2">link2</a></li>
</ul>
// Run the following javascript to translate all elements having the _data-i18n_ attribute:
$.i18n.init({
lng: 'en-US',
ns: { namespaces: ['ns.common', 'ns.special'], defaultNs: 'ns.special'}
}, function() {
$('.nav').i18n();
});
For missing keys (if the option 'addMissing' is set to true) will be send to server with actual text as defaultValue.
In the folder you find one static sample.
i18next-node is bringing i18next to node.js
To build your own copy of i18next, check out the repository and:
git clone https://github.com/jamuhl/i18next.git
cd i18next
npm install -g grunt-cli
npm install
grunt
The grunt command will build i18next into the bin/ and release/ folders.
Copyright (c) 2011 Jan Mühlemann
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Unknown package
We found that i18next-client 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
pnpm 9.5 introduces a Catalogs feature, enabling shareable dependency version specifiers, reducing merge conflicts and improving support for monorepos.
Security News
A threat actor on BreachForums is selling an unverified npm vulnerability for account takeover, but npm has not officially confirmed the existence of this security concern.
Security News
Cyber insurance rates are dropping as the market matures, according to a new report projecting global premiums to reach $43 billion by 2030, driven by international market uptake and growth in the SME sector.