Universal Language Selector/AutonymFont

From MediaWiki.org
Jump to: navigation, search

Autonym Font[edit | edit source]

Upstream: https://github.com/santhoshtr/AutonymFont

When an article on Wikipedia is available in multiple languages, we see the list of the languages in a column on one side of the page. The names on the list are written in the script that the language uses(Also know as language autonym). Which also means that all the appropriate fonts were needed to be present for the autonyms to be displayed. For instance, an article like the one about the Nobel Prize is written in more than 125 languages and needs around 35 fonts to display the names of the the languages.

Initially this was handled by the native fonts available on the reader's device. If a font did not present, the user would see square boxes (known as tofu) instead of the name of a language. To workaround this problem, not just for the language list, but for other section in the content area as well, the Universal Language Selector (ULS)[LINK] provides a set of webfonts that were loaded with the page. While this ensured that more language texts were displayed, a serious problem was also encountered. The presence of the additional fonts added an overload on the page, and users saw pages loading much slower than before. To improve client-side performance, webfonts are not applied to the interlanguage links area..

Not using the webfonts for the lnterlanguage links seemed like the easiest solution, but it also takes us back to the sup-optimal multilingual experience that we were trying to solve in the first place. Articles may be perfectly displayed thanks to web fonts, but If a link is not displayed in the language list, many users will not be able to discover that there is a version of the article in their language. The autonyms were not just required for the Interlanguage links. They were also required for the Language Search and Selection window of the Universal Language Selector, which allows users to find their language if they are on a wiki displaying content in a script unfamiliar to them.

Autonym font tries to solve this. The font contains glyphs and opentype rules for rendering the language autonyms. And it contains only those glyphs for a language. For example, for Thai, the font has glyphs required for rendering ไทย alone.

Using the font[edit | edit source]

In MediaWiki, add a class 'autonym' to the elements containing language autonyms. The font will be applied automatically from ULS extension.

Example[edit | edit source]

Following language names are shown using the Autonym font. A span wraps the content and it has class 'autonym'

<span class="autonym">
<!-- List of languages goes here -->
</span>

The output is given below:

Qafár af Аҧсшәа Acèh Afrikaans Akan Gegë Alemannisch አማርኛ aragonés Ænglisc अङ्गिका العربية ܐܪܡܝܐ mapudungun Maġribi مصرى অসমীয়া asturianu авар Kotava Aymar aru azərbaycanca تورکجه башҡортса Boarisch žemaitėška Batak Toba Batak Toba بلوچی مکرانی Bikol Central беларуская беларуская (тарашкевіца)‎ беларуская (тарашкевіца)‎ български भोजपुरी भोजपुरी Bislama Bahasa Banjar bamanankan বাংলা བོད་ཡིག বিষ্ণুপ্রিয়া মণিপুরী بختياري brezhoneg Bráhuí bosanski ᨅᨔ ᨕᨘᨁᨗ буряад català Chavacano de Zamboanga Mìng-dĕ̤ng-ngṳ̄ нохчийн Cebuano Chamoru Choctaw ᏣᎳᎩ Tsetsêhestâhese کوردی corsu Capiceño Nēhiyawēwin / ᓀᐦᐃᔭᐍᐏᐣ qırımtatarca qırımtatarca (Latin)‎ къырымтатарджа (Кирилл)‎ čeština kaszëbsczi словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ Чӑвашла Cymraeg dansk Deutsch Österreichisches Deutsch Schweizer Hochdeutsch Deutsch (Sie-Form)‎ Zazaki dolnoserbski Dusun Bundu-liwan ދިވެހިބަސް ཇོང་ཁ eʋegbe Emiliàn Ελληνικά emiliàn e rumagnòl English Canadian English British English Esperanto español eesti euskara estremeñu فارسی Fulfulde suomi meänkieli Võro Na Vosa Vakaviti føroyskt français français cadien arpetan Nordfriisk furlan Frysk Gaeilge Gagauz 贛語 赣语(简体)‎ 贛語(繁體)‎ Gàidhlig galego گیلکی Avañe'ẽ 𐌲𐌿𐍄𐌹𐍃𐌺 Ἀρχαία ἑλληνικὴ Alemannisch ગુજરાતી Gaelg Hausa 客家語/Hak-kâ-ngî Hawai`i עברית हिन्दी Fiji Hindi Fiji Hindi Ilonggo Hiri Motu hrvatski hornjoserbsce Kreyòl ayisyen magyar Հայերեն Otsiherero interlingua Bahasa Indonesia Interlingue Igbo ꆇꉙ Iñupiak ᐃᓄᒃᑎᑐᑦ inuktitut Ilokano ГӀалгӀай Ido íslenska italiano ᐃᓄᒃᑎᑐᑦ/inuktitut 日本語 Patois Lojban jysk Basa Jawa ქართული Qaraqalpaqsha Taqbaylit Адыгэбзэ Адыгэбзэ Kongo کھوار Gĩkũyũ Kırmancki Kwanyama қазақша قازاقشا (تٴوتە)‏ қазақша (кирил)‎ qazaqşa (latın)‎ قازاقشا (جۇنگو)‏ қазақша (Қазақстан)‎ qazaqşa (Türkïya)‎ kalaallisut ភាសាខ្មែរ ಕನ್ನಡ 한국어 한국어 (조선) Перем Коми Kanuri къарачай-малкъар Krio Kinaray-a कॉशुर / کٲشُر کٲشُر कॉशुर Ripoarisch Kurdî Kurdî (latînî)‎ كوردي (عەرەبی)‏ коми kernowek Кыргызча Latina Ladino Lëtzebuergesch лакку лезги Lingua Franca Nova Luganda Limburgs Ligure Līvõ kēļ lumbaart lingála ລາວ Silozi lietuvių latgaļu Mizo ţawng latviešu 文言 Lazuri मैथिली Basa Banyumasan мокшень Malagasy Ebon олык марий Māori Baso Minangkabau македонски മലയാളം монгол молдовеняскэ मराठी кырык мары Bahasa Melayu Malti Mvskoke Mirandés မြန်မာဘာသာ эрзянь مازِرونی Dorerin Naoero Nāhuatl Bân-lâm-gú Napulitano norsk bokmål Plattdüütsch Nedersaksies नेपाली नेपाल भाषा Oshiwambo Niuē Nederlands Nederlands (informeel)‎ norsk nynorsk norsk bokmål Novial Nouormand Sesotho sa Leboa Diné bizaad Chi-Chewa occitan Oromoo ଓଡ଼ିଆ Ирон ਪੰਜਾਬੀ Pangasinan Kapampangan Papiamentu Picard Deitsch Plautdietsch Pälzisch पालि Norfuk / Pitkern polski Piemontèis پنجابی Ποντιακά Prūsiskan پښتو português português do Brasil Runa Simi Runa shimi Rumagnôl Tarifit rumantsch Romani Kirundi română armãneashti tarandíne русский русиньскый armãneashti Vlăheşte Влахесте Vlăheşte Kinyarwanda संस्कृतम् саха тыла Santali sardu sicilianu Scots سنڌي Sassaresu sámegiella Cmique Itom Sängö žemaitėška srpskohrvatski / српскохрватски Tašlḥiyt/ⵜⴰⵛⵍⵃⵉⵜ ⵜⴰⵛⵍⵃⵉⵜ Tašlḥiyt සිංහල Simple English slovenčina slovenščina Schläsch Gagana Samoa Åarjelsaemien chiShona Soomaaliga shqip српски / srpski српски (ћирилица)‎ srpski (latinica)‎ Sranantongo SiSwati Sesotho Seeltersk Basa Sunda svenska Kiswahili ślůnski தமிழ் ತುಳು తెలుగు tetun тоҷикӣ тоҷикӣ tojikī ไทย ትግርኛ Türkmençe Tagalog толышә зывон Setswana lea faka-Tonga Toki Pona Tok Pisin Türkçe Ṫuroyo Xitsonga татарча/tatarça татарча tatarça chiTumbuka Twi reo tahiti тыва дыл удмурт ئۇيغۇرچە / Uyghurche ئۇيغۇرچە Uyghurche українська اردو oʻzbekcha Tshivenda vèneto vepsän kel’ Tiếng Việt West-Vlams Mainfränkisch Volapük Vaďďa Võro walon Winaray Wolof 吴语 хальмг isiXhosa მარგალური ייִדיש Yorùbá 粵語 Vahcuengh Zeêuws 中文 文言 中文(中国大陆)‎ 中文(简体)‎ 中文(繁體)‎ 中文(香港)‎ Bân-lâm-gú 中文(澳門)‎ 中文(马来西亚)‎ 中文(新加坡)‎ 中文(台灣)‎ 粵語 isiZulu

Other examples: