{"_id":"pseudolocalise","name":"pseudolocalise","dist-tags":{"latest":"5.0.0"},"versions":{"5.0.0":{"name":"pseudolocalise","version":"5.0.0","private":false,"description":"Several implementation of pseudolocalizing ICU strings","keywords":["hyperlocalise","i18n","icu","l10n","pseudolocalize"],"homepage":"https://github.com/hyperlocalise/pseudolocalize#readme","bugs":{"url":"https://github.com/hyperlocalise/pseudolocalize/issues"},"license":"MIT","author":{"name":"Minh Cung"},"repository":{"type":"git","url":"git+https://github.com/hyperlocalise/pseudolocalize.git"},"type":"module","sideEffects":false,"main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","require":"./dist/index.cjs","default":"./dist/index.mjs"}},"scripts":{"build":"vp pack","check":"vp check","clean":"bin/clean.sh","format":"vp fmt","format:ci":"vp fmt --check","lint":"vp lint --deny-warnings","postversion":"git push && git push --tags","prepare":"vp config && vp pack","prepublishOnly":"vp test && vp check && vp pack","preversion":"vp check","test":"vp test","version":"vp fmt && git add -A src"},"devDependencies":{"@formatjs/icu-messageformat-parser":"3.5.3","@formatjs/intl":"4.1.5","@types/bun":"1.3.11","intl-messageformat":"11.2.0","typescript":"6.0.2","vite-plus":"latest"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.7.8 || ^3.0.0","@formatjs/intl":"^2.10.4 || ^3.0.0 || ^4.0.0","intl-messageformat":"^10.5.14 || ^11.0.0","typescript":"^5.5.4 || ^6.0.0"},"peerDependenciesMeta":{"typescript":{"optional":true}},"overrides":{"vite":"npm:@voidzero-dev/vite-plus-core@latest","vitest":"npm:@voidzero-dev/vite-plus-test@latest"},"packageManager":"bun@1.3.11","gitHead":"7e2c8d64a625ee19964f12b95184b7a9ec473175","_id":"pseudolocalise@5.0.0","_nodeVersion":"24.13.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-yKsnQyZipgtciDNwlVGIIDDzH8WJYvI90sQSYoTDWTGfCgsFxa+HPLxzEY5tUyXF5TUZ8qOc7688JiNmR1eUww==","shasum":"05745f83b0535cf5a95c230af1f6f1f1f6246ca9","tarball":"https://registry.npmjs.org/pseudolocalise/-/pseudolocalise-5.0.0.tgz","fileCount":7,"unpackedSize":13637,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBwnw4P++8zcIj/wfkYMHwz+VEyPBr8n6RubeWl/1EWTAiEAsOfK+L8/Ln3pM6tLxmYbVPoQ/SYc59vSZE0q39X5BNo="}]},"_npmUser":{"name":"cungminh2710","email":"cungminh2710@gmail.com"},"directories":{},"maintainers":[{"name":"cungminh2710","email":"cungminh2710@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pseudolocalise_5.0.0_1775119438497_0.5885155862099511"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-02T08:43:58.427Z","5.0.0":"2026-04-02T08:43:58.667Z","modified":"2026-04-02T08:43:58.827Z"},"maintainers":[{"name":"cungminh2710","email":"cungminh2710@gmail.com"}],"description":"Several implementation of pseudolocalizing ICU strings","homepage":"https://github.com/hyperlocalise/pseudolocalize#readme","keywords":["hyperlocalise","i18n","icu","l10n","pseudolocalize"],"repository":{"type":"git","url":"git+https://github.com/hyperlocalise/pseudolocalize.git"},"author":{"name":"Minh Cung"},"bugs":{"url":"https://github.com/hyperlocalise/pseudolocalize/issues"},"license":"MIT","readme":"# Pseudolocalize\n\n![NPM](https://img.shields.io/npm/dw/@cungminh2710/pseudolocalize) [![Node.js CI](https://github.com/cungminh2710/pseudolocalize/actions/workflows/node.js.yml/badge.svg)](https://github.com/cungminh2710/pseudolocalize/actions/workflows/node.js.yml)\n\nPseudolocalization is the process of using mock translations to aid in the testing of UI adaption and responsiveness to localized text.\n\nThis package contains several implementations of pseudolocalizing ICU strings. Some implementations are ported from @formatjs/cli\n\nThere are three techniques to pseudolocalize text:\n\n- Accents (for example, “Lōrêm ípsüm”): Applies accents and diacritics to some characters. Not only does this help engineers clearly identify when text is pseudolocalized, it can also help identify issues with non-latin characters, character height and vertical space, and unsupported characters.\n\n- Encapsulation (for example, “[Lorem ipsum]”): Clearly identifies the start and end of text. This helps detect cases where text is being concatenated, truncated, or where text has been hard-coded.\n\n- Expansion (for example, “Loongeeer iiiipsuuum”): Simulates the expansion of text as it might appear in a translation. Shorter strings can expand by as much as 300%, with longer strings generally sitting somewhere between 150% and 250%. For more information, see [the IBM/W3 guidelines](https://www.w3.org/International/articles/article-text-size/#predict).\n\nRead more on my [Canva Engineering blog about how to localize at scale](https://canvatechblog.com/how-to-design-in-every-language-at-once-f2dd66a2780f)\n\n## Available pseudo-locales\n\n- `en-XA` is ported from @formatjs/cli to test with accents technique.\n- `en-XB` is ported from @formatjs/cli to test with encapsulation technique.\n- `en-XC` is implemented using all three techniques: accents, encapsulation and expansion.\n- `en-XD` is similar to `en-XC` and friendlier to dyslexic engineers.\n\nGiven the English message `my name is {name}`\n\n| Locale  | Message                           |\n| ------- | --------------------------------- |\n| `en-XA` | `ṁẏ ńâṁè íś {name}`               |\n| `en-XB` | `[!! ṁẏ ńâṁṁṁè íííś !!]Minh`      |\n| `en-XC` | `မြ······ṁẏ ńâṁè íś Minh······မြ` |\n| `en-XD` | `မြ······mẏ nâmè ís Minh······မြ` |\n\n- As of 1 June 2022, on NPM, `code` component in this table above will fail for this tall burmese character `မြ`\n\n![image](https://user-images.githubusercontent.com/8063319/173707554-2b65f143-4d78-420e-a908-f5d4fc294e12.png)\n\n## How to use\n\n- Simple:\n\n```javascript\nimport { generateENXA, prettify } from '@cungminh2710/pseudolocalize';\n\nconst input = 'my name is {name}';\n\nconsole.log(prettify(generateENXA(input))); // ṁẏ ńâṁè íś {name}\n```\n\n- With `react-intl`:\n\nCheck out the examples\n\n- [with-react-intl-next](https://github.com/cungminh2710/pseudolocalize/tree/main/examples/with-react-intl-next)\n","readmeFilename":"README.md","_rev":"1-ef76b0a3d1e9f159857e97ca9c54fe33"}