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

tririga-react-label-sync-plugin

v1.0.1

Published

Automates converting hardcoded string labels in your Tririga React app into appMessages[AppMsg.MESSAGES.KEY] pattern

Readme

🔄 Tririga React Label Sync Plugin

Automate i18n for TRIRIGA React apps — scan, sync, and replace hardcoded strings in one command.

npm license vite i18n


⚠️ Disclaimer: This is an independent, community-built tool and is not affiliated with, endorsed by, or officially supported by IBM or IBM TRIRIGA. Always run --dry-run before applying changes to your codebase.

📌 What It Does

Writing hardcoded strings during development is fast — but cleaning them up for internationalization is painful. This plugin automates the entire process.

Before                                    After
──────────────────────────────────────    ──────────────────────────────────────
<h1>Welcome Home</h1>          ──►        <h1>{appMessages[AppMsg.MESSAGES.WELCOME_HOME]}</h1>
<button>Login</button>         ──►        <button>{appMessages[AppMsg.MESSAGES.LOGIN]}</button>
<p>User Details</p>            ──►        <p>{appMessages[AppMsg.MESSAGES.USER_DETAILS]}</p>

It also updates your message files automatically:

| File | What changes | |---|---| | messages.json | New key-value pairs added | | ApplicationMessages.js | New constants added to MESSAGES object | | *.jsx / *.tsx | Hardcoded strings replaced with appMessages calls |


📦 Installation

npm install --save-dev tririgaReactLabelSyncPlugin

🚀 Usage

# Run the full sync
npx tririgaReactLabelSyncPlugin

# Preview changes without modifying any files
npx tririgaReactLabelSyncPlugin --dry-run

# Undo — restore all JSX files to their original state
npx tririgaReactLabelSyncPlugin --undo

⚙️ How It Works

┌─────────────────────────────────────────────────────────┐
│                                                         │
│  1. SCAN       Finds all .jsx / .tsx in src/            │
│       │                                                 │
│       ▼                                                 │
│  2. FILTER     Keeps purely alphabetic strings only     │
│       │        (skips numbers, symbols, colons, etc.)   │
│       ▼                                                 │
│  3. SYNC       Adds entries to messages.json            │
│       │        Creates constants in ApplicationMessages │
│       ▼                                                 │
│  4. REPLACE    Swaps strings → appMessages[AppMsg.KEY]  │
│       │                                                 │
│       ▼                                                 │
│  5. BACKUP     Saves originals for --undo               │
│                                                         │
└─────────────────────────────────────────────────────────┘

🧩 Accessing appMessages in Components

Three ways to use appMessages — pick what fits your component:

Option 1 — Hook (recommended)

import { useDictionary } from '../../providers/DictionaryProvider';

const MyComponent = () => {
  const appMessages = useDictionary();
  return <h1>{appMessages[AppMsg.MESSAGES.WELCOME_HOME]}</h1>;
};

Option 2 — HOC

import { withDictionary } from '../../providers/DictionaryProvider';

const MyComponent = ({ appMessages }) => (
  <h1>{appMessages[AppMsg.MESSAGES.WELCOME_HOME]}</h1>
);

export default withDictionary(MyComponent);

Option 3 — Prop

const MyComponent = ({ appMessages }) => (
  <h1>{appMessages[AppMsg.MESSAGES.WELCOME_HOME]}</h1>
);

💡 Wrap your app root with <DictionaryProvider> to make appMessages available throughout.


✨ Features at a Glance

| Feature | Details | |---|---| | 🔍 Smart scanning | Scans all .jsx / .tsx in src/pages and src/components | | 🔑 Auto key generation | Converts text to SCREAMING_SNAKE_CASE keys | | 🚫 Intelligent filtering | Skips strings with numbers, symbols, or special characters | | 🔄 Dual sync | Updates both messages.json and ApplicationMessages.js | | ♻️ Duplicate prevention | Deduplicates keys automatically | | 👁️ Dry-run mode | Preview all changes before applying | | ↩️ Full undo | Restore original JSX files with one command | | ⚡ Vite compatible | Works with Vite-based TRIRIGA React templates |


↩️ Undoing Changes

npx tririgaReactLabelSyncPlugin --undo
  • Restores all .jsx / .tsx files to their original state
  • messages.json and ApplicationMessages.js are not reverted
  • Deletes the .tririga-sync-changes backup directory
  • Lets you re-run the tool after fixing any issues

⚠️ Notes

  • Only purely alphabetic strings are captured — strings with :, numbers, or symbols are ignored
  • Backups are stored in .tririga-sync-changes/ — do not delete this manually if you need undo
  • Designed specifically for Vite-based TRIRIGA React applications

📄 License

MIT