Jump to content

Universal Language Selector/AutonymFont

From mediawiki.org

Autonym Font

[edit]

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]

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

Example

[edit]

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 ak Gegë Alemannisch አማርኛ aragonés Ænglisc अंगिका العربية ܐܪܡܝܐ mapudungun الدارجة مصرى অসমীয়া asturianu авар Kotava Aymar aru azərbaycanca تۆرکجه башҡортса Boarisch žemaitėška Batak Toba Batak Toba جهلسری بلوچی Bikol Central беларуская беларуская (тарашкевіца) беларуская (тарашкевіца) български भोजपुरी भोजपुरी Bislama Banjar bamanankan বাংলা བོད་ཡིག বিষ্ণুপ্রিয়া মণিপুরী بختیاری brezhoneg Bráhuí bosanski Basa Ugi буряад català Chavacano de Zamboanga 閩東語 / Mìng-dĕ̤ng-ngṳ̄ нохчийн Cebuano Chamoru Chahta anumpa ᏣᎳᎩ 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 Kadazandusun ދިވެހިބަސް ཇོང་ཁ eʋegbe emiliàn e rumagnòl Ελληνικά 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ñupiatun ᐃᓄᒃᑎᑐᑦ inuktitut Ilokano гӀалгӀай Ido íslenska italiano ᐃᓄᒃᑎᑐᑦ / inuktitut 日本語 Patois la .lojban. jysk 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ēļ lombard lingála ລາວ Silozi lietuvių latgaļu Mizo ţawng latviešu 文言 Lazuri मैथिली Basa Banyumasan мокшень Malagasy Ebon олык марий Māori 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 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 čhib ikirundi română armãneashti tarandíne русский русиньскый armãneashti Vlăheşte Влахесте Vlăheşte Ikinyarwanda संस्कृतम् саха тыла ᱥᱟᱱᱛᱟᱲᱤ sardu sicilianu Scots سنڌي Sassaresu davvisámegiella Cmique Itom Sängö žemaitėška srpskohrvatski / српскохрватски Taclḥit ⵜⴰⵛⵍⵃⵉⵜ Taclḥit සිංහල Simple English slovenčina slovenščina Schläsch Gagana Samoa åarjelsaemien chiShona Soomaaliga shqip српски / srpski српски (ћирилица) srpski (latinica) Sranantongo SiSwati Sesotho Seeltersk Sunda svenska Kiswahili ślůnski தமிழ் ತುಳು తెలుగు tetun тоҷикӣ тоҷикӣ tojikī ไทย ትግርኛ Türkmençe Tagalog tolışi Setswana lea faka-Tonga tokipona 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: