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 🙏

© 2026 – Pkg Stats / Ryan Hefner

pyno-translate

v1.0.1

Published

A lightweight Angular translation module with support for: - Nested translation keys - Dynamic parameter interpolation (`{{name}}`) - Runtime JSON loading from assets folder

Readme

pyno-translate

A lightweight Angular translation module with support for:

  • Nested translation keys
  • Dynamic parameter interpolation ({{name}})
  • Runtime JSON loading from assets folder

Designed for Angular 16+ standalone and module-based apps.


📦 Installation

npm install pyno-translate

⚙️ Setup

1. Import the module

For module-based apps:

import { PynoTranslateModule } from 'pyno-translate';

@NgModule({
  imports: [PynoTranslateModule]
})
export class AppModule {}

For standalone apps:

import { PynoTranslateModule } from 'pyno-translate';

bootstrapApplication(AppComponent, {
  providers: [
    importProvidersFrom(PynoTranslateModule)
  ]
});

2. Load translations using APP_INITIALIZER

To ensure translations are loaded before the app renders, use this in your main.ts:

import { bootstrapApplication } from '@angular/platform-browser';
import { provideHttpClient } from '@angular/common/http';
import { APP_INITIALIZER, inject, importProvidersFrom } from '@angular/core';
import { AppComponent } from './app/app.component';
import { PynoTranslateService, PynoTranslateModule } from 'pyno-translate';

bootstrapApplication(AppComponent, {
  providers: [
    provideHttpClient(),
    importProvidersFrom(PynoTranslateModule),
    {
      provide: APP_INITIALIZER,
      multi: true,
      useFactory: () => {
        const translate = inject(PynoTranslateService);
        return () => new Promise<void>((resolve) => {
          translate.setPath('assets/langs'); //for public folder: setPath('langs')
          translate.setLang('en', resolve); //set your default lang
        });
      }
    }
  ]
});

📁 JSON Structure

Create translation files like this: assets/langs/en.json or for public folder public/langs/en.json

{
  "home": {
    "greeting": "Hello {{name}}!",
    "title": "Pyno Translate!"
  }
}

🧪 Usage in Component

For standalone components:

import { PynoTranslateModule } from 'pyno-translate';
@Component({
  imports: [PynoTranslateModule]
})

In Template (HTML):

<h2>{{ 'home.greeting' | translate:{ name: 'Amir' } }}</h2>
<h3>{{ 'home.title' | translate }}</h3>

In Component (TS):

import { PynoTranslateService } from 'pyno-translate';
constructor(private translate: PynoTranslateService) {
  let result = this.translate.translate('home.greeting', { name: 'Amir' });
  console.log(result); // Hello Amir!
  result = this.translate.translate('home.title');
  console.log(result); // Pyno Translate!
}

🧠 API

| Method | Description | |--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | setPath(path: string) | Set the path to JSON translation files. If you're using assets folder => assets/langs. If you're using public folder, do not mention public folder in path => langs | | setLang(lang: string, onComplete?: () => void) | Load a specific language file => translate->setLang('en') | | translate(key: string, params?: object) | Translate a key with optional params |


✅ License

MIT

Designed & Developed by Amir Navidfar