We added Russian to RedPen, now it’s your turn…

RedPen proved to be an extremely flexible and universal tool. We managed to add basic Russian language support without any major changes done to the code. In fact, the only thing that we had to implement was Russian language auto-detection. The rest worked out the box with simple modification made to the default symbols configuration: in Russian language «quote» is used instead of “quote” and instead of #. Most likely, it will work equally fine for Ukrainian and Belorussian as well, and maybe some other languages using the Cyrillic script. This is how it looks like in RedPen Intellij Plugin:


Actually adding custom languages to RedPen can be done in Intellij IDEA without making any modifications to RedPen itself. Use Settings -> Editor -> RedPen-> Import.


For example, to add Russian language with correct double quotation marks, number sign and a couple of validators all you need to do is import a file with the following contents:

<redpen-conf lang="ru">
        <validator name="InvalidSymbol"/>
        <validator name="NumberFormat">
            <property name="decimal_delimiter_is_comma" value="false"/>
            <property name="ignore_years" value="true"/>
        <symbol name="NUMBER_SIGN" value="№" invalid-chars="##" before-space="true"/>
        <symbol name="LEFT_DOUBLE_QUOTATION_MARK" value="«" invalid-chars="&quot;" before-space="true"/>
        <symbol name="RIGHT_DOUBLE_QUOTATION_MARK" value="»" invalid-chars="&quot;" after-space="true"/>

Only symbols that are different from English configuration should be listed. As for validators, you need to list all that you would like to use.

Most European/Western languages should also work fine with RedPen either using the default English configuration or a slight modification of it.

If you decide to add your own custom language, then it is a good idea to export English language configuration via Settings -> Editor -> RedPen-> Export and to change the language name in lang attribute of redpen-conf tag of the resulting file. It will serve as a good template to start with.

Then, optionally, you can add spelling and/or other dictionaries by specifying file names in either dict or list validator properties. Dictionary files are just text files with words listed one per line.

We added Russian to RedPen, now it’s your turn…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s