0.2.1 • Published 2 years ago

invert-text v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

invert-text

A simple tool to generate inverted/upside-down/australiaized/upended/upturned text. Generates inverted text using Unicode characters.

A better mechanism for testing Localization (L10N) compared to translations of a different language, for two reasons:

  • It's easy to quickly generate a JSON with inverted texts. (You don't need a paid translation API).
  • When testing l10n on the interface, it's easy to identify if the right word/phrase is being translated (just need to rotate your head enough 🙃 ).

Examples

OriginalInverted
the quick brown fox jumps over the lazy dog..ƃop ʎzɐʅ ǝɥʇ ɹǝʌo sdɯnɾ xoⅎ uʍoɹq ʞɔᴉnb ǝɥʇ
THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG..⅁Oᗡ ⅄Z∀⅂ ƎHꓕ ꓤƎɅO SԀWՈᒋ XOᖵ NMOꓤꓭ ꓘϽIՈꝹ ƎHꓕ
98765432100⇂ᄅƐh59ㄥ86
Random %^&* Characters !@#$ in ()+,./-_ betweenuǝǝʍʇǝq _-/.,+() uᴉ $#@! sɹǝʇɔɐɹɐɥϽ *&^% ɯopuɐꓤ
(parentheses) brackets {braces}{sǝɔɐɹq} sʇǝʞɔɐɹq

Installation

  • Install Node.js and npm
  • Install the invert-text CLI globally using npm i -g invert-text
    • Or, run it directly using npx

Usage

Invert a JSON file

To invert all leaf-level text phrases in a given JSON file, use the invert-text command as below:

foo@bar:~$ invert-text -i path/to/input.json -o path/to/output.json

✅ Generated the inverted output file at "path/to/output.json"

Invert phrase(s)

To invert single/multiple text phrases, use the invert-text command as below:

foo@bar:~$ invert-text -p this that "and something else"

sᴉɥʇ
ʇɐɥʇ
ǝsʅǝ ƃuᴉɥʇǝɯos puɐ

⚠️  Limitations

  • Works mainly with AlphaNumeric characters. Most other characters are returned without any inversion.
  • Depending on the font used, some of the inverted characters can look odd/incorrect when inverted.