![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@gullerya/i18n
Advanced tools
Readme
i18n
is a client (browser) oriented library providing an easy means to quickly internationalize web sites.
As of now the library takes care of translation aspect only. Other kinds of formatting / symboling needs might be considered as per future needs.
i18n
is capable of handling complex web-component based sites with the same easiness as a simple 'flat' ones.
Main aspects:
i18n
library implemented as a classic service from consumer perspective - import it and use the JS APIs and correlated HTML syntaxi18n
library is component-design oriented: each component can and should take care of its own needs
Sharing of resources is super easy, to be sure. But me myself almost always consider it to be a best practice to strive to a self contained, isolated, independent components, even if in this case it means sacrificing some network and memory.
data-tier
engine61+ |
60+ |
79+
0.1.0
0.0.1
APIs described in this documentation.
Generally, it is highly advised to read some of the data-tier
documentation. Being an underlying engine, it has everything needed to understand usage and internals of i18n
.
Import the library as in example below:
import * as i18n from './dist/i18n.min.js';
Define your language data per component as following:
i18n.definePack(packKey, {
en: { ... }, // inlining data
he: '/i18n/about-he.json', // fetched resource
ru: () => { ... } // function returning data
}, options);
Parameters description (sources
stands for the second parameter):
packKey
- unique key per component/pack, requiredsources
- sources of localized texts, required
JSON
, keys of which considered to be a locale keysoptions
- reserved, optionalUnder component I mean any level of segregation up to consumers arbitrary choice. One may define such a pack for each and every micro part in UI, other may throw together all of the language data for the whole site.
Pro tip: it really makes sense to split/pack i18n data according to the components visibility, so that 'About' page texts, for example, won't be dealt with until actually navigated to.
Use the following syntax in your HTML
resources:
<span data-tie="i18n:packKey.path.to.text"></span>
Let's break that attribute to the parts to get is clear:
i18n
- is the default tying namespace, you can change it via setNamespace
API; the namespace is global for the whole applicationpackKey
- first token in the path to the localized text is the component / pack key, used when the internatiolization resources was definedpath.to.text
- rest of the path is just a path within the localization data graphFAQs
client (browser) oriented internationalization library
The npm package @gullerya/i18n receives a total of 0 weekly downloads. As such, @gullerya/i18n popularity was classified as not popular.
We found that @gullerya/i18n 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.