krislyz

RTL-Flipper

A python RTL-flipping script for translation, and anything else. It reverses text while keeping the important bits readable, because sometimes you need backwards text that doesn't look like complete gibberish.

I mainly made it for translating games and software, where RTL just doesn't work.

It does not work well with Arabic and it doesn't flip English. Just wanted to let you know.


try it

Runs in your browser. Nothing is sent anywhere. The output box shows the text in stored order, left to right, which is what software without RTL support will draw.


what it does

It flips text around, but it won't destroy your brackets and what's inside them (like this), [this] or {this}, your email addresses, URLs and other token-y things, or the general structure of your text.

It handles grapheme clusters properly (emojis, combining characters), and it keeps the whitespace around preserved tokens.


usage

You need Python 3 and the regex library: pip install regex

python flip_lines.py input.txt output.txt
echo "hello world" | python flip_lines.py

On Windows there's a RUN.ps1. Put whatever you want into input.txt.


links

Source

github.com/Krislyz/RTL-Flipper

License

AGPL-3.0. If you run it as a web service, you share the source.

← back