Skip to content

Translate ICU message strings into pseduo-translated ICU message strings.

Notifications You must be signed in to change notification settings

1stdibs/icu-pseudo-translate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

icu-pseudo-translate

Třáñƨℓáƭè ÌÇÛ ₥èƨƨáϱè ƨƭřïñϱƨ ïñƭô ƥƨèδúô-ƭřáñƨℓáƭèδ ÌÇÛ ₥èƨƨáϱè ƨƭřïñϱƨ.

install

yarn add icu-pseudo-translate
# or, probably..
yarn add icu-pseudo-translate --dev

use

const { pseudoTranslate } = require('icu-pseudo-translate');

pseudoTranslate(`On {takenDate, date, short} {name} took {numPhotos, plural,
    =0 {no photos.}
    =1 {one photo.}
    other {# photos.}}`);
/**
outputs
`Óñ {takenDate, date, short} {name} ƭôôƙ {numPhotos, plural,
    =0 {ñô ƥhôƭôƨ.}
    =1 {ôñè ƥhôƭô.}
    other {# ƥhôƭôƨ.}}`
*/

credits