Insert Pali and Sanskrit Characters with diacritical marks on Discourse and operating systems

Dear all

I would like to learn from you, how you insert Paali words into discourse.suttacentral posts (or into documents in general). Currently, I am stuck to spelling out a “long a” as “aa”. Also, I would have to spell out a short consonant for example as “t.”, so this gives for example: "satipat.t.haana"
However, I saw that a number of people used the correct Paali character set in their posts. Also, these characters are used in the Paali-Suttas on suttacentral.

I just discovered that these characters are available in the Symbols-Table in MS-Word. So I could probably write a post in Word and copy it into the editor in discourse.suttacentral. This gives:
“satipaṭṭhāna” => This works! :slight_smile:

  1. It is quite a lot of work to look for all the right characters in the Symbols Table. Is there an efficient way of doing this? Do you define a makro for each character together with a corresponding keyboard shortcut?

  2. Is there any other efficient and easy way to do this?

Many thanks for your help and with much metta,
Robert

2 Likes

I’ve been doing it (very rarely) via copy-paste from the internet, so I’d be interested in learning an easier way as well…

With metta,
Raivo

1 Like

Interesting question. Perhaps @blake could see whether we can develop an easy and universal way for entering these here.

Meanwhile, there is a native method that works well on Ubuntu. Probably other Linux systems work similarly. The trick is to use your compose key:

This must be assigned first in most systems. In Ubuntu it is in System settings > Keyboard > Shortcuts > Typing. I’ve assigned my right control key. Then you just use a set of keyboard sequences to enter diacritical marks and other non-standard characters.

  • compose - a produces ā,
  • compose . m produces ṁ
  • compose ! m produces ṃ
  • compose ' s produces ś

and so on. For capitals add shift as usual.

There doesn’t seem to be a native solution for this on Windows and Mac. There are, however, various softwares and hacks that can do something similar.

10 Likes

Hi Robert,

to do it efficiently on Windows OS I’m using “English (US) + Pali” from this website.

3 Likes

Dear Piotr, dear Bhante, dear all,

First of all many thanks for your diverse, interesting, and helpful suggestions.

Since I have a Microsoft Windows 7 OS, I could not test Bhante Sujato’s suggestion, but I did look into Piotr’s suggestion. Both approaches are equally powerful, as they enhance the keyboard settings for the whole operating system. So the changes work in pretty much any editor including Notepad, Email, Webbrowser, ect… Unfortunately, the installation of the “Pali Keyboard” package - ‘dedepali.zip’ for German + Pāli - was not succesfull on my laptop. I got an error message saying something like “Required resource ‘DATABASE’ is not available.” However, with the information given on the website I was able to create a similar package using the Miscrosoft Keyboard Layout Creator (‘MKLC’ - the tool used to create the packages on the website) and could install that one on my system. The result is: “satipaṭṭhāna” - Yeay, it works! :smile:

My conclusion is, that there are two quick ways on Microsoft Windows to use Pali characters and a hard way (where one of the quick ways is not always available).

  1. The first quick way is to simply use MS Word and assign Keyboard Shortcuts within the Symbol Table of Word:

image

This can be done if you navigate to the specific character and press the button around which I drew a green frame to define your custom keyboard shortcut for that character. The drawback is, that then you will always have to type any text which includes Pāli using MS Word and then use Raivo’s method of paste&copy to insert the text where you need it.

  1. If the packages which are found at Piotr’s linked website “Pali Keyboard” install on your machine without errors, then this is also pretty quick&easy. (Apart from the fact that you have to resolve some conflicts with predefined keyboard shortcuts in MS-Word to use this fix with MS-Word. Again, the details are given on the website.)

  2. Alternatively, you can download the MKLC and define your own keyboard layout. The website Piotr provided a link for (i.e. “Pali Keyboard”) gives all the details you need. I used the MS Word Symol Table to find the character codes for all Pāli Characters (see the red frames in above screenshot). In case anyone wants to try this out, I put together a list with all the character codes:

Pali_Character_Hex_Codes.pdf (305.3 KB)

You can open your standard Language Package in the MKLC and save it under a new name. Then insert the Pāli Characters as described on the “Pali Keyboard” website. Subsequently, you can build your own installer for this package. As in above solution number 2) you have to resolve some conflicts with predefined keyboard shortcuts in MS-Word if you want to use this solution within MS-Word.

I know the third option is a bit of work. I will try to let the person, who provides the “Pali Keyboard” know, that I experienced problems (I still have to look for the contact details). Maybe he is able to update the package.

With much mettā,
Robert

5 Likes

Thanks so much, @Robert_Grosch. We now have solutions for Linux and Windows: Mac, anyone?

2 Likes

:pray:

Dear Bhantes and all,

Kataññu!!! Woot it works !! Pāli keyboard worked :+1:

:pray:

Sukhi hotu.

russ

1 Like

I bet I could add a miniature ‘pali keyboard’ to the compose new post dialog. Think this would be a worthy feature? Note that like the rest of compose controls it wouldn’t be available on mobile. In principle it would be possible to convert aa->ā automatically, the problem being words like ‘skiing’ - although a control to turn the feature on or off could be included. In any case, one or the other would be an option - a mouse usable pali character selector, or an automagic Velthuis converter which be selectively disabled.

1 Like

Probably the miniature Pali keyboard would be best, rather than first requiring people to learn Velthuis and then coping with the ambiguities of it. A lot of people will just want to insert characters occasionally, and a little widget would be just the ticket.

2 Likes

I think you’re right. Anyone who is really keen on typing pali will setup a proper keyboard entry method.

Hello,

Tipitaka.org page gives solution for Mac users aswell. I don’t know how and if it works – but here’s the link.

3 Likes

Thanks, Piotr. These are derived from the Early Buddhist Manuscript Project site here.

If someone with a Mac can test this method and let us know whether it still works that would be great.

2 Likes

There is now an easy way to enter pali characters! So you can enter words like Satipaṭṭhāna, or Ānanda, in all their diacritically correct glory. I think it should be obvious how it works! But if not, it’s just another button on the tool bar, next to the bold, italic and smilies and stuff.
Strictly mouse based. Anyone who wants a keyboard option should use one of the existing setups in this thread, as applicable to their OS.

4 Likes

Acchariyaṁ āvuso! Abbhutaṁ āvuso! Seyyathāpi āvuso nikkujjitaṁ vā ukkuyyeya, paṭicchannaṁ vā vivareyya, muḷhassa vā maggaṁ ācikkheyya…

Not to be picky, but I’m wondering whether we couldn’t get the Sanskrit ś ṣ ṛ ḥ …

Dear Blake, dear Bhante,

thanks so much! This is just āwesoṁe! :slight_smile: …I mean to say that this is a very easy and convenient solution for occasional Pāli users… (where “easy” means easy to use… thanks a ton for the programming effort!)

With much mettā,
Robert

1 Like

:pray:
Sadhu! Sadhu! Sadhu!

Kataññu-katavedi

Sabbe sattā bhavantu sukhitattā

:pray:

russ

Well, since you were wondering… ṛṝḹḥśṣ
I decided to put the sanskrit chars after the pali ones, instead of putting everything in sanskrit alphabetical order.

2 Likes

Dear Piotr, dear all,

@Linda asked me to share her instructions for a Pali keyboard layout on MAC, because she had some problems uploading the attachments.

The instructions seem similar as those on the web-site @Piotr had provided a link to, but they are a bit better readable. I am not sure in how far both packages are related. Linda uses her layout package on a relatively old machine. She had received those files (see zip-archive) and instructions from Ven Punnadhammo:

Pali_MAC.zip (16.8 KB)

  1. Put the two files attached to this email (pali.icns and pali.keylayout) into Library > Keyboard Layouts

  2. Open up “System Preferences” go into “International” and then from there into “Input Menu” and make sure the option box at the bottom “Show > input menu in menu bar” is ticked.

  3. You should now have a flag visible near the top right of the menu bar. Scroll down and you will see an option for Pali. (you may have to restart your system to get this)

  4. If you select the Pali Keymap option from the flag menu, you have access to pali letters on the option key. Example - option “a” is now ā etc. Some of the variations of “n” are located on option-period and option-comma but the rest should be obvious. [This seems similar as the keyboard layout you find as a graphic scheme in pdf-format under the link Piotr had provided.]

  5. When you are not using the Pali letters it is better to go back to your standard layout (the original flag) because the switched options will confuse some applications.

Thanks @Linda and much mettā to all,
Robert

2 Likes

Thanks so much, we know have instructions for all three main operating systems.

As a long term Linux and FOSS advocate, I cannot resist pointing out that Linux, as usual, wins: the only system with a standardized and inbuilt method of entering non-standard characters from the keyboard in any application. Once more, dāna beats capitalism…

5 Likes

@blake, the add diacriticals button was busted some time ago, needs a-fixin’. Discourse has changed the handling of the editor buttons; previously when you narrowed the screen they would reflow, which was a problem as they obscured the first line of the editor. Now they disappear off the edge. I’m guessing this switch may have nixed our add-on.