Tuesday, April 3, 2012

Typing Hindi, Marathi, Sanskrit on the iPhone or iPad

This is a quick guide to configuring your iPad or iPhone so that you can type in languages that use the Devanagari script – languages such as Hindi, Marathi, Sanskrit, Nepali, Sindhi etc.
There is a similar guide for Android users here.
Note that we don't need to download any fonts or apps or anything, as your iPhone or iPad (or any other iOS device) comes with this functionality built-in. We just need to turn it on and learn how to use it. That's what this guide aims to explain.

For starters, you need to enable the Devnagari keyboard on your device. To do this, follow these steps:
  1. Launch the Settings app on your device by tapping the Settings icon.
  2. Tap General, scroll down and then tap Keyboard.


  4. On the Keyboard page, tap International Keyboards.

  5. Tap Add New Keyboard….

  6. Scroll down and select Hindi.

  7. That's it. Your iPad or iPhone is now ready for Hindi text input.

Here's how you use the keyboard you just configured:

  1. Whenever the keyboard pops up so you can enter something – for instance, as seen here when we start the Notepad app to create a new note – there is a globe icon that shows up on the left of the space bar.

  2. Tapping the globe icon lets you cycle through all your configured international keyboards. When the Hindi keyboard comes up, you can see the layout shown below. This is the common and universally supported INSCRIPT layout for Hindi input. If you don't know this layout, don't be scared. It's super-intuitive and easy to use as I explain below.

How are the keys laid out on the INSCRIPT keyboard?

If you're familiar with the Devanagari consonants and vowels and their order as we learn in school (अ,आ,इ,ई… and क,ख,ग,घ…) you will find it very easy to navigate this keyboard. For starters, these are the Devanagari vowels in order:
The vowels are laid out on the keyboard on the top and middle row on the left. For touch-typists, the areas on the top and middle rows "owned" by the left-hand – ie. the A-G and the Q-T sections on the QWERTY keyboard – are the basic vowels. To type the standalone vowel signs, you use the Shift key. Otherwise, the vowel signs are the combining ones.

Here's the combining vowels when the shift key isn't pressed:

And the standalone vowels when the shift key is pressed:


To give QWERTY positions of the vowels in their order:
  • अ is the D key. Lowercase-D translates to the Reph character which cuts the previous consonant's अ sound and prepares it for a combined consonant (demonstrated further below).
  • आ is the E key. Lowercase-E translates to the combining आ sound (demonstrated further below).
  • इ is the F key.
  • ई is the R key.
  • उ is the G key.
  • ऊ is the T key.
  • ए is the S key.
  • ऐ is the W key.
  • ओ is the A key.
  • औ is the Q key.
The consonants similarly flair out in Devanagari order from the middle-right-key (the K key on QWERTY). For the aspiration versions of the consonants, you tap the Shift key.

Here are the consonants in the Devanagari syllabary, usually read row-wise from left-to-right:
Technical Note for Linguist Nerds. Others Can Ignore:
The Wikipedia page has the technically super-correct arrangement so that it's easy to know how to pronounce these consonants, but the order above is the one we learn and memorise in school where the semi-vowels and others are lumped into one row after the labial sounds.
If you examine the layout, you can work out the pattern in which the consonants are laid out corresponding to their order in the syllabary. Here's the layout without the Shift key pressed:

And when the shift key is pressed:

Typing Some Sample Words

So for instance, to type आप, this is the sequence you'd follow:

To type हिन्दी, again you type it out exactly like you say it:
First, tap the ह.

Then goes the ि   to make it हि:

Followed by the न, we have हिन:

Now, we want to cut the न and turn it into न् to prepare it for joining with the following consonant and turning it into न्द. We do this by pressing the  ्  combining character (called a 'reph'). By the by, as you see below, the in-built Hindi dictionary is already suggesting an auto-correct for हिन – it's wondering if we're trying to say बिन :).

Tap द to join the waiting न् to form the compound consonant (or what we call संयुक्ताक्षर or जोडाक्षर) न्द.

We have हिन्द. We just add the long-ee  ी to get हिन्दी.

Et voilà!

Here's me typing out a sentence:

Now once you know the basic idea behind how the keyboard is laid out, play around. It just takes a bit of practice to get comfortable and gradually ramp up your speed on typing Hindi, or Marathi or Sanskrit or Sindhi on your device. There are some idiosyncrasies and exceptions in the layout of course — the nasals, the semi-vowels row and uncommon signs are strewn about – as you'll find out when you start playing with the keyboard but again, those are also easily learned and become second nature.

Also, just like the English keyboard, keeping some keys pressed provides multiple additional options for that key. For instance, to type the ऱ्य character in Marathi words like बऱ्याच or कैऱ्या, get ऱ which shows up as an option when you keep र pressed and then tap the reph character as described above to turn it into the Marathi र, ready to be joined to its य. Play around and explore the keyboard and you'll find other such characters that you can type.

Another cool trick: Apple has already added our new Rupee symbol (₹) to these devices. To type it, press the numerals key, then keep the $ (dollar sign) pressed, and the new Rupee symbol will show up as one of the options! Cool, huh!?

By the way, once you learn this keyboard, you can type on Macs, Windows or any other system that support Devanagari input because this INSCRIPT layout is the one that's supported by all systems by default as it's definitive – ie. the character is exactly what you type in and isn't something that needs to be guessed by an intelligent IME software component.

Happy typing! And I look forward to seeing more Devanagari tweets, iMessages, photo captions…

If you have any questions or need more clarification, fire away using the Comments section below.

हिन्दी – iPad या iPhone पर हिन्दी, मराठी, संस्कृत, नेपाली, सिंधी या अन्य किसी देवनागरी भाषा कैसे लिखें? यह पृष्ठ आपको सही तरीक़ा समझाएगा।
मराठी – iPad किंवा iPhone वर मराठी, संस्कृत, हिन्दीत, देवनागरीत कसे लिहावे हे समजण्यास वरील माहिती नीट वाचावी.

India and its neighbours

I'm glad articles like this one (Pakistan Tribune, April 1, 2012) are being written in the Pak press. I do believe as I've mentioned earlier that if we were to develop economic ties, borders would become soft like in Europe and these disputes a thing of the past. Not just between India Pakistan but far beyond. Goods and people being transported freely from Teheran to Bangkok on freeways and railways. Everyone prospering as a result of the peace and economic buzz.

One of the Pakistanis (usmanx) commented on this news article that India had mistreated all its neighbours since Independence, and so it was good for Pakistan to remain hostile to keep India in check. Here's his post:

How are India’s relations with Sri Lanka who despise her for her interference. How about Nepal who have no-visa policy but 400 sq. km have been encroached by her more powerful southern neighbor. How about Bangladesh, although liberated by India (really bengali freedom-fighters) terminated its friendship treaty with India and constantly feels over-powered. How about China – who taught the Indians a lesson for the provocative forward policy (indians belived themselves to be the inheritors of its northern boundary imagined by her former masters (the british). How about Maldives where India sponsored a coup. Imagine the regional countries condition if Pakistan was not there to counter India’s hegemony.
I would like to respond to usmanx's post, specifically his references to India's other neighbours, as his appears to be a common view among his countrymen:

China: China wasn't even on the scene in the Ladakh border area until they occupied and annexed Tibet in the 50s. The British
may have been pushing into the north and the border India inherited a newer border. But you could make that case for KP as well, not to mention Balochistan. KP is a vestige of the British foray into Afghanistan. It is the main reason Afghanistan did not recognize Pak for the longest time. And is still a dispute from their perspective. Will Pakistanis support Pakistan giving up this area as well? Baluchistan was a free country until very recently. And Pakistan just inherited a new British acquisition. By his argument, it should be let go as well; it's not like they haven't been struggling for independence for decades.

Nepal: I've never heard of any encroachment or border dispute here. There is visa-free movement and lots of Nepalis live and work in India without any problems.

Bhutan: they too much appreciate that India is there to protect them from Chinese takeover if the need arises. Never has any Indian army encroached into their land. They maintain their distinct culture and independent monarchy as they prefer.

Burma: The US and India are cooperating to drive the military junta to implement democratic reforms and change is already evident.

Bangladesh: as political parties change in BD, the relations have ups and downs depending on their issues of the day.

Sri Lanka: FYI India intervened in SL on the side of the govt to stop the terrorism. This is why Rajiv Gandhi was assassinated by the LTTE. Hardly would SL be wary of us. AFAIK, we enjoy good relations as proven by the UN vote just last week.

Meanwhile, Pakistan isn't exactly the favorite among its neighbors either. Afghans hate you for having used and abused their country since 1979 and unleashing the Taliban on them. Iran is wary and dislikes Pakistan for its treatment of Shias. Chinese look at it as a good means of making money and getting linked to the Gulf but in private, snicker about the fanaticism and the fantasies Pakistanis live in (read all about it if one can google). And I don't even need to mention India that has suffered constant terrorist attacks and aggression from Pakistan.

Ultimately, I believe all countries will always have some issues with their neighbors. China has issues, Japan does, the US does. It's human nature. Singling out India as the bad guy is more indicative of Pakistanis' distorted view than any reflection of reality.

The fact of the matter is that today India has no interest in these ridiculous squabbles with Pakistan. Our primary interest is in prosperity and security for our people. We have always been open to a cooperative relationship with Pakistan. It is really for Pakistan to work out its issues, stop living in a made-up world and make up its mind vis-a-vis India.