Transliterating Text in OpenOffice.org

Productivity Sauce

Dec 19, 2008 GMT

Dmitri Popov

Here is a problem: when working with an OpenOffice.org document you need to insert a few lines of text in a language that uses a non-Latin alphabet, for example Cyrillic. Of course, you can enable the Cyrillic support on your system, but it's overkill if you only need to write just a few sentences every now and then. Instead, you can use the following OpenOffice.org Basic macro to convert a selected text fragment written in the Latin alphabet into its Cyrillic version; for example "martyshka" -> "мартышка", "ogurec" -> "oгурец", and so on (this process is known as transliteration):

The way the macro works is rather simple. First the macro obtains the currently selected text and creates a blank Writer document. It then goes through the selected text snippet and replaces Latin letters and letter combinations with their Cyrillic equivalents specified in the Latin and Cyrillic arrays. This macro converts text from Latin to Cyrillic, but you can easily modify it to work with other alphabets.