
Security News
Google’s OSV Fix Just Added 500+ New Advisories — All Thanks to One Small Policy Change
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
@polymer/app-localize-behavior
Advanced tools
app-localize-behavior
is a behavior that wraps the format.js library to
help you internationalize your application. Note that if you're on a browser that
does not natively support the Intl
object, you must load the polyfill yourself. An example polyfill can
be found here.
See: Documentation, Demo.
npm install --save @polymer/app-localize-behavior
<html>
<head>
<!-- Optional: Intl polyfill -->
<script src="https://unpkg.com/intl@1.2.5/dist/Intl.min.js"></script>
<script src="https://unpkg.com/intl@1.2.5/locale-data/jsonp/en.js"></script>
<script src="https://unpkg.com/intl@1.2.5/locale-data/jsonp/fr.js"></script>
<!-- Elements using the behaviour -->
<script type="module" src="sample-element.js"></script>
</head>
<body>
<sample-element></sample-element>
</body>
</html>
import {PolymerElement, html} from '@polymer/polymer';
import {mixinBehaviors} from '@polymer/polymer/lib/legacy/class.js';
import {AppLocalizeBehavior} from '@polymer/app-localize-behavior/app-localize-behavior.js';
class SampleElement extends mixinBehaviors([AppLocalizeBehavior], PolymerElement) {
static get template() {
return html`
<div>{{localize('hello', 'name', 'Batman')}}</div>
`;
}
static get properties() {
return {
language: { value: 'en' },
}
}
function attached() {
this.loadResources(this.resolveUrl('locales.json'));
}
}
customElements.define('sample-element', SampleElement);
If you want to send a PR to this element, here are the instructions for running the tests and demo locally:
git clone https://github.com/PolymerElements/app-localize-behavior
cd app-localize-behavior
npm install
npm install -g polymer-cli
polymer serve --npm
open http://127.0.0.1:<port>/demo/
polymer test --npm
FAQs
A behavior to help with internationalizating apps
The npm package @polymer/app-localize-behavior receives a total of 2,088 weekly downloads. As such, @polymer/app-localize-behavior popularity was classified as popular.
We found that @polymer/app-localize-behavior demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 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
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
Research
/Security News
175 malicious npm packages (26k+ downloads) used unpkg CDN to host redirect scripts for a credential-phishing campaign targeting 135+ organizations worldwide.
Security News
Python 3.14 adds template strings, deferred annotations, and subinterpreters, plus free-threaded mode, an experimental JIT, and Sigstore verification.