longlang

Generates fake language (longer or shorter) from a localisation file, preserving inline HTML.

LongLang

Generates fake language (longer or shorter) from existing localisation file, preserving inline HTML.


LongLang is designed to facilitate multi-national application and website testing by generating a fake localisation file that is longer (or shorter) than the source localisation (e.g. English).

By generating the longer, fake language, you can easily see whether the layout adapts well or if it needs tweaks.

LongLang begins all copy with "S" after which "X"s follow, and appends "E" at the end so you can easily notice whether something is timmed / cropped or if the copy renders well.

LongLang also preserves inline HTML so no tags, attributes or class names will be altered.

LongLang is compatible with AngularJS's ng-translate, i18next and many others.

npm install -g longlang
longlang inputFile [--scale=int]

path to the input JSON file with the original localisation.

copy length multiplier. 1 = same length, 2 = twice as long, 0.5 = 50% shorter

Output will be saved to your current working directory as longlang.json.

Example:

longlang en-us.json
longlang fr.json --scale=2.5
{
    "one": "This is a test. A nice test.",
    "two": "Another example 3245345435. Awesome!!!",
    "html_test": "this is a <span class=\"green grass is cool\">test <div attribute=\"test\">(quite a long one)</div></span> and it goes to here."
}
longlang source.json --scale=2
{
    "one": "SXXXXXXXXX XXXXX XXX XXXXXXXXXXX XXX XXXXXXXXX XXXXXXXXXXXE",
    "two": "SXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXE",
    "html_test": "SXXXXXXXXX XXXXX XXX X<span class=\"green grass is cool\">XXXXXXXXX X<div attribute=\"test\">XXXXXXXXXXXXX XXX XXXXXXXXX XXXXXXXXX</div>X</span>X XXXXXXX XXXXX XXXXXXXXX XXXXX XXXXXXXXXXXE"
}