Reversed transliterations are transliterations made from target language to
source language (in terms they are defined in language packs). In case of
reversed transliterations, you may leave out the language_code attribute,
although if you know it on beforehand, specify it since it works faster that
way.

It’s possible to replace existing language packs with your own ones. By
default, existing language packs are not force-installed.

To force install a language pack, set the force argument to True when
registering a language pack. In that case, if a language pack with same
language code has already been registered, it will be replaced; otherwise,
if language pack didn’t exist in the registry, it will be just registered.

registry.register(ExampleLanguagePack,force=True)

Forced language packs can’t be replaced or unregistered.

API in depth

There are 7 class properties that you could/should be using in your language
pack, of which 4 are various sorts of mappings.

Mappings

mapping (tuple): A tuple of two strings, that simply represent the
mapping of characters from the source language to the target language. For
example, if your source language is Latin and you want to convert “a”, “b”,
“c”, “d” and “e” characters to appropriate characters in Russian Cyrillic,
your mapping would look as follows:

reversed_specific_mapping (tuple): When making reversed translations,
the mapping property is still used, but in some cases you need to provide
additional rules. This property (reversed_specific_mapping) is meant for
such cases. Further, is alike the mapping.

Example (taken from the Greek language pack).

reversed_specific_mapping=(u"θΘ",u"uU")

pre_processor_mapping (dict): A dictionary of mapping from source
language to target language. Use this only in cases if a single character
in source language shall be represented by more than one character in the
target language.

reversed_specific_pre_processor_mapping: Same as
pre_processor_mapping, but used in reversed translations.

Example (taken from the Armenian language pack)

reversed_specific_pre_processor_mapping={u"ու":u"u",u"Ու":u"U"}

Additional

character_ranges (tuple): A tuple of character ranges (unicode table).
Used in language detection. Works only if detectable property is set
to True. Be aware, that language (or shall I better be saying - script)
detection is very basic and is based on characters only.

detectable (bool): If set to True, language pack would be used
for automatic language detection.

Using the lorem ipsum generator

Note, that due to incompatibility of the original lorem-ipsum-generator
package with Python 3, when used with Python 3 transliterate uses its’ own
simplified fallback lorem ipsum generator (which still does the job).