A URL can consist of a Domain Name and a pathname. In the examples below x.y.z represents the Domain Name, the remainder being the pathname. My experience of the internet is that the pathname is usually written in English or more accurately ASCII. The below ASCII pathname represents a multi-page website in the form of a journey from home to a hotel in Korea.
x.y.z/home/bus/airplane/korea/taxi/hotel
Websites, such as Google, adapt the language of their text content according to the browser preferred display language (BL). This browser preferred language can be set by the user. Letสผs go one step further than Google and adapt the language of the URL pathname according to the BL. Here is the ASCII pathname rewritten into Chinese, Japanese and Korean.
x.y.z/ๅฎถ/ๅ
ฌๅ
ฑๆฑฝ่ฝฆ/้ฃๆบ/้ฉๅฝ/ๅบ็ง่ฝฆ/้ฅญๅบ
x.y.z/ใใผใ /ใใน/้ฃ่กๆฉ/้ๅฝ/ใฟใฏใทใผ/ใใใซ
x.y.z/ํ/๋ฒ์ค/๋นํ๊ธฐ/ํ๊ตญ/ํ์/ํธํ
So, how do we implement these language adaptive URL parthnames? Firstly, we need to programmatically determine the BL. One way of achieving this is to examine the Accept-Language http header sent from the browser to the server. This will contain one or more language tags. If there is more than one language tag they are presented in priority order. Language tags can take many forms. They include: zh, zh-CN and cmn for Mandarin Chinese; ja for Japanese and ko for Korean. Now that we can determine the BL we can select the appropriate URL pathname, thus internationalizing our website with a language adaptive URL pathname.
On a Linux machine, each component of the pathname will be a directory. In my schema I am assuming an index.html or index.php, per directory. A requirement of this schema is that we do not want a directory hierarchy for each language, nor do we want an index.html or index.php for each language.
My native language is English so I will make my master pathname directory names English ie home, bus, airplane, korea, taxi and hotel. I will make the Chinese, Japanese and Korean directory names as aliases to the English named master directories. This can be easily achieved on Linux with the ln -s command, where ln means link and the -s option means create symbolic link, as opposed to a hard link.
ln -s home ๅฎถ
ln -s home ใใผใ
ln -s home ํ
⋮
ln -s hotel ้ฅญๅบ
ln -s hotel ใใใซ
ln -s hotel ํธํ
What if your native language is not English? In that case, create the master pathname directory names in your native language. If your native language is Korean then the master directory names will be ์ง, ๋ฒ์ค, ๋นํ๊ธฐ, ํ๊ตญ, ํ์ and ํธํ
and your links will be:
ln -s ํ home
ln -s ํ ๅฎถ
ln -s ํ ใใผใ
⋮
ln -s ํธํ
hotel
ln -s ํธํ
้ฅญๅบ
ln -s ํธํ
ใใใซ
Emoji are hugely popular so letสผs construct a totally cool Emoji pathname.
x.y.z/๐ก/๐/✈️/๐ฐ๐ท/๐/๐จ
ln -s home ๐ก
ln -s bus ๐
ln -s airplane ✈️
ln -s korea ๐ฐ๐ท
ln -s taxi ๐
ln -s hotel ๐จ
I have never encountered an Emoji URL pathname on a website and so implementing such a pathname on your website would be both totally cool and unique. You could also use an Emoji pathname for those languages your website does not support. My schema only supports Chinese, English, Japanese and Korean. If the BL was an unsupported language, such as Arabic, then the Emoji pathname could be displayed in the browser address bar instead of, for example, defaulting to English.
I have used x.y.x to represent the Domain Name, the implication being it is ASCII. We can complete the language adaptive equation by having Domain Names in supported BL languages. Thus my completed equation schema would have Chinese, Japanese and Korean Domain Names in addition to an ASCII Domain Name.