npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kryptand/transmono

v0.0.8

Published

A web component based translation library built with StencilJs. Use it whenever and wherever you like to.

Downloads

5

Readme

TRANS.mono

Built With Stencilsemantic-release Commitizen friendlynpm version NPM

TRANS.mono is a customizable and easy to use dependency free, web-component based translation library. It can be used in other web component based projects, Angular, React, Vue or Ember. Currently the library is a build in progress and the API is subject to change.

Installation

npm install @kryptand/transmono

Web components

Import the components directly either by providing a script tag for example : <script type="module" src='https://cdn.jsdelivr.net/npm/@kryptand/[email protected]/dist/index.js'></script> or if you installed the package via npm import the package inside your root component - for example: import "@kryptand/transmono";

Stencil

Switch to your root component, if you use the stencil CLI to generate your project, this file can usually be found at the following location: src/components/global/app.ts.

import within the root component: import "@kryptand/transmono";

Angular

look up https://stenciljs.com/docs/angular

React

look up https://stenciljs.com/docs/react

Vue

look up https://stenciljs.com/docs/vue

Ember

look up https://stenciljs.com/docs/ember

Usage

Register the provider

In the root component of your project create an instance of the translation provider. [...] <kryptand-translation-provider defaultLang="de-DE"> </kryptand-translation-provider> [...] Specify the default language - for example de-DE There are a lot of other inputs you can use to further customize your provider. Look up the Provider documentation for further information.

Translate keys

To translate text in your application use the <kryptand-translate></kryptand-translate> Component. The most basic implementation would be as following: <kryptand-translate name="translationKey" value="World"></kryptand-translate> For further information consult the component documentation.

Provide translation files

TRANS.mono default translation loader looks for translation files in the .json format. The default lookup URL is [BASE_URL]/assets/i18n/[CURRENT_LANG].json

Translation files follow a simple key value pattern. For example your file could look like this: { "translationKey": "Hallo, {{value}}" } Placeholders in your translation texts can be provided as well. To insert a placeholder use the {{PLACEHOLDER}} syntax.

Advanced Usage

As stated in the introduction TRANS.mono gives you the flexibility to customize every bit if you need it.

Roll your own Translation Loader

If you want to load translation files that are not in the .json Format or you have a remote location you want to store your files on you can create your own translation loader.

There will be further information coming soon™.

Add translation entities at runtime

There will be further information coming soon™.