Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pseudolocale

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pseudolocale

Simple pseudolocale (psuedolocalization) for strings

  • 1.4.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is pseudolocale?

The pseudolocale npm package is used to generate pseudolocalized versions of strings for testing internationalization (i18n) in software applications. Pseudolocalization helps developers identify potential issues with string length, character encoding, and layout before actual translation work begins.

What are pseudolocale's main functionalities?

Basic Pseudolocalization

This feature allows you to convert a simple string into its pseudolocalized version. The pseudolocalized string will have additional characters and accents to simulate the appearance of translated text.

const pseudolocale = require('pseudolocale');
const originalString = 'Hello, world!';
const pseudolocalizedString = pseudolocale.str(originalString);
console.log(pseudolocalizedString);

Custom Pseudolocalization

This feature allows you to customize the pseudolocalization process by adding specific characters or strings before and after the original text. This can help simulate different localization scenarios.

const pseudolocale = require('pseudolocale');
pseudolocale.option.prepend = '>>';
pseudolocale.option.append = '<<';
const originalString = 'Hello, world!';
const pseudolocalizedString = pseudolocale.str(originalString);
console.log(pseudolocalizedString);

Pseudolocalize JSON Objects

This feature allows you to pseudolocalize all string values within a JSON object. This is useful for testing the localization of entire data structures.

const pseudolocale = require('pseudolocale');
const originalObject = { greeting: 'Hello, world!', farewell: 'Goodbye!' };
const pseudolocalizedObject = {};
for (const key in originalObject) {
  pseudolocalizedObject[key] = pseudolocale.str(originalObject[key]);
}
console.log(pseudolocalizedObject);

Other packages similar to pseudolocale

Keywords

FAQs

Package last updated on 05 Apr 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc