write Turkish with a QWERTY Keyboard and without any special switching
This code is a very easy way to allow people to write in Turkish in their website without expecting the user to change any special keyboard switching or pressing external buttons.
Introduction
There are generally two ways to be able to write in Turkish visiting a website:
- use Turkish Keyboard layout;
- website provides external buttons to represent some six letters that do not exist in a typical QWERTY English keyboard.
I would like to present to the Internet community a third method of writing Turkish that neither expects a special keyboard switching, nor peripheral buttons that hinder the flow of writing Turkish on a website.
Turkish Letters That Are Not In English
There are different Turkish letters not included in English depending on the case. For capital letters the sequence goes like this:
and small-case letters:
Letters that are not in a typical QWERY keyboard should be easily evident. The S with the cedilla, or the g with the breve accent are all subtle differences between Turkish and English.
A Simple Solution
In regular writing it is certainly common to have a space after a punctuation mark, such as the period, or the command, or the colon, etc. If there is not a space after such punctuation marks and one of the letters in QWERTY but not exactly in Turkish could mean a letter we need. For example, if we type "Buras.i Mu,stur" then the software can immediately replace the ".i" combination with the dotless-i letter that is in Turkish but not English. The Javascript code attached to this article precisely does this.
The following QWERTY sequences translates to the following Turkish letters:
and
There is really only one special case for the small-case letters and that's the dotless-i:
Please remember that there is no space in between the punctuation mark and the letter that follows it in order to display the mapped Turkish letter.