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

@l10nmonster/helpers-demo

v3.1.3

Published

Helpers demonstrations

Readme

@l10nmonster/helpers-demo

Demo and pseudo-localization helpers for L10n Monster, providing development and testing utilities.

Installation

npm install @l10nmonster/helpers-demo

Components

|Component|Export|Type|Description| |---|---|---|---| |Provider|PigLatinizer|Translation Provider|Pseudo-localization using Pig Latin transformation|

PigLatinizer Provider

A pseudo-localization provider that converts source text into Pig Latin for development and testing purposes.

Features

  • Visual Testing: Identifies hard-coded strings and text concatenation issues
  • Text Expansion: Simulates text expansion that occurs in real translations
  • Layout Testing: Helps test UI layout with longer text
  • Development Aid: Provides immediate feedback without waiting for real translations

Usage

import { PigLatinizer } from '@l10nmonster/helpers-demo';

const pigProvider = new PigLatinizer({
    quality: 1  // Low quality score (1-100)
});

Configuration

// l10nmonster.config.mjs
import { PigLatinizer } from '@l10nmonster/helpers-demo';

export default {
    providers: [{
        id: 'demo-translator',
        provider: new PigLatinizer({
            quality: 1,
            preservePlaceholders: true,
            addBrackets: true
        })
    }]
};

Configuration Options

  • quality (number): Quality score for translations (default: 1)
  • preservePlaceholders (boolean): Keep placeholders intact (default: true)
  • addBrackets (boolean): Add brackets to identify pseudo-translated text (default: false)
  • expansion (number): Text expansion factor (default: 1.3)

Pig Latin Rules

The PigLatinizer follows standard Pig Latin rules:

  1. Consonant start: "hello" → "ello-hay"
  2. Vowel start: "apple" → "apple-way"
  3. Consonant clusters: "string" → "ing-stray"
  4. Preserve placeholders: "Hello {{name}}" → "Ello-hay {{name}}"

Examples

// Basic transformation
"Hello world" → "Ello-hay orld-way"

// With placeholders preserved
"Welcome {{user}}" → "Elcome-way {{user}}"

// With brackets for identification
"Save changes" → "[Ave-say anges-chay]"

// Numbers and special characters preserved
"You have 5 messages" → "Ou-yay ave-hay 5 essages-may"

Integration Examples

Development Workflow

// Development configuration
export default {
    providers: [
        {
            id: 'internal',
            provider: 'InternalLeverage'
        },
        {
            id: 'demo',
            provider: new PigLatinizer({ 
                quality: 1,
                addBrackets: true 
            })
        }
    ]
};

Testing Configuration

// Testing environment with pseudo-localization
export default {
    providers: [{
        id: 'test-pseudo',
        provider: new PigLatinizer({
            quality: 1,
            expansion: 1.5,  // 50% text expansion
            addBrackets: true
        })
    }],
    
    channels: [{
        source: new FsSource({ globs: ['src/**/*.json'] }),
        target: new FsTarget({ 
            targetPath: (lang, resourceId) => {
                // Create pseudo-locale for testing
                if (lang === 'pseudo') {
                    return resourceId.replace('/en/', '/pseudo/');
                }
                return resourceId.replace('/en/', `/${lang}/`);
            }
        })
    }]
};

Multi-Provider Chain

export default {
    providers: [
        { id: 'leverage', provider: 'InternalLeverage' },
        { id: 'repetition', provider: 'Repetition' },
        { id: 'demo', provider: new PigLatinizer({ quality: 1 }) },
        { id: 'fallback', provider: 'Invisicode' }
    ]
};

Use Cases

Development

  • Immediate feedback: See translation layout without waiting for real translations
  • Hard-coded string detection: Identify text that isn't being translated
  • Concatenation issues: Find problematic string concatenation

QA Testing

  • Layout testing: Verify UI handles longer text properly
  • Text expansion: Simulate real-world text growth
  • Placeholder verification: Ensure placeholders are preserved correctly

Demonstration

  • Client demos: Show localization capabilities quickly
  • Proof of concept: Demonstrate translation workflows
  • Training: Teach localization concepts

Advanced Features

Custom Transformation

class CustomPigLatinizer extends PigLatinizer {
    transformText(text) {
        // Custom transformation logic
        let result = super.transformText(text);
        
        // Add custom markers
        return `🐷 ${result} 🐷`;
    }
}

Selective Processing

const provider = new PigLatinizer({
    quality: 1,
    shouldTransform: (text, context) => {
        // Skip certain content types
        if (context.resourceId.includes('error-messages')) {
            return false;
        }
        return true;
    }
});

Performance

The PigLatinizer is optimized for development use:

  • Fast processing: Immediate transformation without API calls
  • Low overhead: Minimal CPU and memory usage
  • Deterministic: Same input always produces same output
  • Offline capable: No network dependencies

Testing

npm test

The test suite covers:

  • Pig Latin transformation rules
  • Placeholder preservation
  • Text expansion calculations
  • Error handling
  • Integration with L10n Monster core

Comparison with Other Pseudo-Localization

| Feature | PigLatinizer | Invisicode | Traditional Pseudo | |---------|-------------|------------|-------------------| | Human readable | ✅ Yes | ❌ No | ✅ Partial | | Text expansion | ✅ Natural | ✅ Configurable | ✅ Padding | | Layout testing | ✅ Good | ✅ Excellent | ✅ Good | | Fun factor | ✅ High | ✅ Medium | ❌ Low |

Requirements

  • Node.js >= 20.12.0
  • @l10nmonster/core (peer dependency)

Related Documentation