Page MenuHomePhabricator

Install AnonymousI18N.js on gom.wikipedia.org
Closed, ResolvedPublic

Description

Sushilmishra, can you help? A sysop/whatever needs to paste this into https://gom.wikipedia.org/wiki/MediaWiki:Common.js :

window.wpAvailableLanguages={"aa":"Qafár af","ab":"Аҧсшәа","ace":"Acèh","aeb":"تونسي\/Tûnsî","aeb-arab":"تونسي","aeb-latn":"Tûnsî","af":"Afrikaans","ak":"Akan","aln":"Gegë","als":"Alemannisch","am":"አማርኛ","an":"aragonés","ang":"Ænglisc","anp":"अङ्गिका","ar":"العربية","arc":"ܐܪܡܝܐ","arn":"mapudungun","arq":"جازايرية","ary":"Maġribi","arz":"مصرى","as":"অসমীয়া","ast":"asturianu","av":"авар","avk":"Kotava","awa":"अवधी","ay":"Aymar aru","az":"azərbaycanca","azb":"تۆرکجه","ba":"башҡортса","bar":"Boarisch","bat-smg":"žemaitėška","bbc":"Batak Toba","bbc-latn":"Batak Toba","bcc":"بلوچی مکرانی","bcl":"Bikol Central","be":"беларуская","be-tarask":"беларуская (тарашкевіца)‎","be-x-old":"беларуская (тарашкевіца)‎","bg":"български","bgn":"بلوچی رخشانی","bh":"भोजपुरी","bho":"भोजपुरी","bi":"Bislama","bjn":"Bahasa Banjar","bm":"bamanankan","bn":"বাংলা","bo":"བོད་ཡིག","bpy":"বিষ্ণুপ্রিয়া মণিপুরী","bqi":"بختیاری","br":"brezhoneg","brh":"Bráhuí","bs":"bosanski","bto":"Iriga Bicolano","bug":"ᨅᨔ ᨕᨘᨁᨗ","bxr":"буряад","ca":"català","cbk-zam":"Chavacano de Zamboanga","cdo":"Mìng-dĕ̤ng-ngṳ̄","ce":"нохчийн","ceb":"Cebuano","ch":"Chamoru","cho":"Choctaw","chr":"ᏣᎳᎩ","chy":"Tsetsêhestâhese","ckb":"کوردیی ناوەندی","co":"corsu","cps":"Capiceño","cr":"Nēhiyawēwin \/ ᓀᐦᐃᔭᐍᐏᐣ","crh":"qırımtatarca","crh-cyrl":"къырымтатарджа (Кирилл)‎","crh-latn":"qırımtatarca (Latin)‎","cs":"čeština","csb":"kaszëbsczi","cu":"словѣньскъ \/ ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ","cv":"Чӑвашла","cy":"Cymraeg","da":"dansk","de":"Deutsch","de-at":"Österreichisches Deutsch","de-ch":"Schweizer Hochdeutsch","de-formal":"Deutsch (Sie-Form)‎","diq":"Zazaki","dsb":"dolnoserbski","dtp":"Dusun Bundu-liwan","dty":"डोटेली","dv":"ދިވެހިބަސް","dz":"ཇོང་ཁ","ee":"eʋegbe","egl":"Emiliàn","el":"Ελληνικά","eml":"emiliàn e rumagnòl","en":"English","en-ca":"Canadian English","en-gb":"British English","eo":"Esperanto","es":"español","et":"eesti","eu":"euskara","ext":"estremeñu","fa":"فارسی","ff":"Fulfulde","fi":"suomi","fit":"meänkieli","fiu-vro":"Võro","fj":"Na Vosa Vakaviti","fo":"føroyskt","fr":"français","frc":"français cadien","frp":"arpetan","frr":"Nordfriisk","fur":"furlan","fy":"Frysk","ga":"Gaeilge","gag":"Gagauz","gan":"贛語","gan-hans":"赣语(简体)‎","gan-hant":"贛語(繁體)‎","gd":"Gàidhlig","gl":"galego","glk":"گیلکی","gn":"Avañe'ẽ","gom":"गोवा कोंकणी \/ Gova Konknni","gom-deva":"गोवा कोंकणी","gom-latn":"Gova Konknni","got":"\ud800\udf32\ud800\udf3f\ud800\udf44\ud800\udf39\ud800\udf43\ud800\udf3a","grc":"Ἀρχαία ἑλληνικὴ","gsw":"Alemannisch","gu":"ગુજરાતી","gv":"Gaelg","ha":"Hausa","hak":"客家語\/Hak-kâ-ngî","haw":"Hawai`i","he":"עברית","hi":"हिन्दी","hif":"Fiji Hindi","hif-latn":"Fiji Hindi","hil":"Ilonggo","ho":"Hiri Motu","hr":"hrvatski","hrx":"Hunsrik","hsb":"hornjoserbsce","ht":"Kreyòl ayisyen","hu":"magyar","hy":"Հայերեն","hz":"Otsiherero","ia":"interlingua","id":"Bahasa Indonesia","ie":"Interlingue","ig":"Igbo","ii":"ꆇꉙ","ik":"Iñupiak","ike-cans":"ᐃᓄᒃᑎᑐᑦ","ike-latn":"inuktitut","ilo":"Ilokano","inh":"ГӀалгӀай","io":"Ido","is":"íslenska","it":"italiano","iu":"ᐃᓄᒃᑎᑐᑦ\/inuktitut","ja":"日本語","jam":"Patois","jbo":"Lojban","jut":"jysk","jv":"Basa Jawa","ka":"ქართული","kaa":"Qaraqalpaqsha","kab":"Taqbaylit","kbd":"Адыгэбзэ","kbd-cyrl":"Адыгэбзэ","kg":"Kongo","khw":"کھوار","ki":"Gĩkũyũ","kiu":"Kırmancki","kj":"Kwanyama","kk":"қазақша","kk-arab":"قازاقشا (تٴوتە)‏","kk-cn":"قازاقشا (جۇنگو)‏","kk-cyrl":"қазақша (кирил)‎","kk-kz":"қазақша (Қазақстан)‎","kk-latn":"qazaqşa (latın)‎","kk-tr":"qazaqşa (Türkïya)‎","kl":"kalaallisut","km":"ភាសាខ្មែរ","kn":"ಕನ್ನಡ","ko":"한국어","ko-kp":"한국어 (조선)","koi":"Перем Коми","kr":"Kanuri","krc":"къарачай-малкъар","kri":"Krio","krj":"Kinaray-a","ks":"कॉशुर \/ کٲشُر","ks-arab":"کٲشُر","ks-deva":"कॉशुर","ksh":"Ripoarisch","ku":"Kurdî","ku-arab":"كوردي (عەرەبی)‏","ku-latn":"Kurdî (latînî)‎","kv":"коми","kw":"kernowek","ky":"Кыргызча","la":"Latina","lad":"Ladino","lb":"Lëtzebuergesch","lbe":"лакку","lez":"лезги","lfn":"Lingua Franca Nova","lg":"Luganda","li":"Limburgs","lij":"Ligure","liv":"Līvõ kēļ","lmo":"lumbaart","ln":"lingála","lo":"ລາວ","loz":"Silozi","lrc":"لۊری شومالی","lt":"lietuvių","ltg":"latgaļu","lus":"Mizo ţawng","lv":"latviešu","lzh":"文言","lzz":"Lazuri","mai":"मैथिली","map-bms":"Basa Banyumasan","mdf":"мокшень","mg":"Malagasy","mh":"Ebon","mhr":"олык марий","mi":"Māori","min":"Baso Minangkabau","mk":"македонски","ml":"മലയാളം","mn":"монгол","mo":"молдовеняскэ","mr":"मराठी","mrj":"кырык мары","ms":"Bahasa Melayu","mt":"Malti","mus":"Mvskoke","mwl":"Mirandés","my":"မြန်မာဘာသာ","myv":"эрзянь","mzn":"مازِرونی","na":"Dorerin Naoero","nah":"Nāhuatl","nan":"Bân-lâm-gú","nap":"Napulitano","nb":"norsk bokmål","nds":"Plattdüütsch","nds-nl":"Nedersaksies","ne":"नेपाली","new":"नेपाल भाषा","ng":"Oshiwambo","niu":"Niuē","nl":"Nederlands","nl-informal":"Nederlands (informeel)‎","nn":"norsk nynorsk","no":"norsk bokmål","nov":"Novial","nrm":"Nouormand","nso":"Sesotho sa Leboa","nv":"Diné bizaad","ny":"Chi-Chewa","oc":"occitan","om":"Oromoo","or":"ଓଡ଼ିଆ","os":"Ирон","pa":"ਪੰਜਾਬੀ","pag":"Pangasinan","pam":"Kapampangan","pap":"Papiamentu","pcd":"Picard","pdc":"Deitsch","pdt":"Plautdietsch","pfl":"Pälzisch","pi":"पालि","pih":"Norfuk \/ Pitkern","pl":"polski","pms":"Piemontèis","pnb":"پنجابی","pnt":"Ποντιακά","prg":"Prūsiskan","ps":"پښتو","pt":"português","pt-br":"português do Brasil","qu":"Runa Simi","qug":"Runa shimi","rgn":"Rumagnôl","rif":"Tarifit","rm":"rumantsch","rmy":"Romani","rn":"Kirundi","ro":"română","roa-rup":"armãneashti","roa-tara":"tarandíne","ru":"русский","rue":"русиньскый","rup":"armãneashti","ruq":"Vlăheşte","ruq-cyrl":"Влахесте","ruq-latn":"Vlăheşte","rw":"Kinyarwanda","sa":"संस्कृतम्","sah":"саха тыла","sat":"Santali","sc":"sardu","scn":"sicilianu","sco":"Scots","sd":"سنڌي","sdc":"Sassaresu","se":"sámegiella","sei":"Cmique Itom","ses":"Koyraboro Senni","sg":"Sängö","sgs":"žemaitėška","sh":"srpskohrvatski \/ српскохрватски","shi":"Tašlḥiyt\/ⵜⴰⵛⵍⵃⵉⵜ","shi-latn":"Tašlḥiyt","shi-tfng":"ⵜⴰⵛⵍⵃⵉⵜ","si":"සිංහල","simple":"Simple English","sk":"slovenčina","sl":"slovenščina","sli":"Schläsch","sm":"Gagana Samoa","sma":"Åarjelsaemien","sn":"chiShona","so":"Soomaaliga","sq":"shqip","sr":"српски \/ srpski","sr-ec":"српски (ћирилица)‎","sr-el":"srpski (latinica)‎","srn":"Sranantongo","ss":"SiSwati","st":"Sesotho","stq":"Seeltersk","su":"Basa Sunda","sv":"svenska","sw":"Kiswahili","szl":"ślůnski","ta":"தமிழ்","tcy":"ತುಳು","te":"తెలుగు","tet":"tetun","tg":"тоҷикӣ","tg-cyrl":"тоҷикӣ","tg-latn":"tojikī","th":"ไทย","ti":"ትግርኛ","tk":"Türkmençe","tl":"Tagalog","tly":"толышә зывон","tn":"Setswana","to":"lea faka-Tonga","tokipona":"Toki Pona","tpi":"Tok Pisin","tr":"Türkçe","tru":"Ṫuroyo","ts":"Xitsonga","tt":"татарча\/tatarça","tt-cyrl":"татарча","tt-latn":"tatarça","tum":"chiTumbuka","tw":"Twi","ty":"reo tahiti","tyv":"тыва дыл","tzm":"ⵜⴰⵎⴰⵣⵉⵖⵜ","udm":"удмурт","ug":"ئۇيغۇرچە \/ Uyghurche","ug-arab":"ئۇيغۇرچە","ug-latn":"Uyghurche","uk":"українська","ur":"اردو","uz":"oʻzbekcha\/ўзбекча","uz-cyrl":"ўзбекча","uz-latn":"oʻzbekcha","ve":"Tshivenda","vec":"vèneto","vep":"vepsän kel’","vi":"Tiếng Việt","vls":"West-Vlams","vmf":"Mainfränkisch","vo":"Volapük","vot":"Vaďďa","vro":"Võro","wa":"walon","war":"Winaray","wo":"Wolof","wuu":"吴语","xal":"хальмг","xh":"isiXhosa","xmf":"მარგალური","yi":"ייִדיש","yo":"Yorùbá","yue":"粵語","za":"Vahcuengh","zea":"Zeêuws","zh":"中文","zh-classical":"文言","zh-cn":"中文(中国大陆)‎","zh-hans":"中文(简体)‎","zh-hant":"中文(繁體)‎","zh-hk":"中文(香港)‎","zh-min-nan":"Bân-lâm-gú","zh-mo":"中文(澳門)‎","zh-my":"中文(马来西亚)‎","zh-sg":"中文(新加坡)‎","zh-tw":"中文(台灣)‎","zh-yue":"粵語","zu":"isiZulu"};
/**
 * AnonymousI18N
 *
 * Internationalisation for anonymous users.
 *
 * @author [[User:Krinkle]]
 * @stats [[File:Krinkle_AnonymousI18N.js]]
 */
mw.loader.using( 'mediawiki.user', function () {
 if ( mw.user.isAnon() ) {
  mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:AnonymousI18N.js&action=raw&ctype=text/javascript' );
 }
});

Event Timeline

Nemo_bis created this task.Jul 8 2015, 7:05 AM
Nemo_bis assigned this task to Sushilmishra.
Nemo_bis raised the priority of this task from to Normal.
Nemo_bis updated the task description. (Show Details)
Nemo_bis added subscribers: Liuxinyu970226, Amire80, Nemo_bis and 5 others.

Thanks Nemo, Sushilmishra has installed it and it is working fine.
Is it ok if we modify the code so that only the Konkani options are available instead of all the languages?

Nemo_bis closed this task as Resolved.Jul 14 2015, 5:10 AM

Is it ok if we modify the code so that only the Konkani options are available instead of all the languages?

Sure, it should be enough to remove the language codes from the list I think. Marking resolved, but comments stay open.

Hopefully, this should work. I've kept only the two Konkani variants, and I've changed the labels to their Konkani names. Sushilmishra, please could you replace the code you entered into https://gom.wikipedia.org/wiki/MediaWiki:Common.js by the following:

window.wpAvailableLanguages={"gom-latn":"Romi Konknni","gom-deva":"नगर बरप"};
/**
 * AnonymousI18N
 *
 * Internationalisation for anonymous users.
 *
 * @author [[User:Krinkle]]
 * @stats [[File:Krinkle_AnonymousI18N.js]]
 */
mw.loader.using( 'mediawiki.user', function () {
 if ( mw.user.isAnon() ) {
  mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:AnonymousI18N.js&action=raw&ctype=text/javascript' );
 }
});

Nemo, one thing that could go wrong in my code is in case AnonymousI18N.js wants gom or en to compulsorily be there in the list. Let's wait and see how this works.

My code did not work. I think it's because AnonymousI18N.js checks whether en is in the list of available languages before deploying. Hence, I've added en to the list.

Attempt 2:

window.wpAvailableLanguages={"gom-latn":"Romi Konknni","gom-deva":"नगर बरप","en":"इंग्लेज़ / Ingles"};
/**
 * AnonymousI18N
 *
 * Internationalisation for anonymous users.
 *
 * @author [[User:Krinkle]]
 * @stats [[File:Krinkle_AnonymousI18N.js]]
 */
mw.loader.using( 'mediawiki.user', function () {
 if ( mw.user.isAnon() ) {
  mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:AnonymousI18N.js&action=raw&ctype=text/javascript' );
 }
});

Attempt 2 also did not work. Now I am adding gom instead of gom-deva (gom basically gives the gom-deva messages anyway)

Attempt 3:

window.wpAvailableLanguages={"gom-latn":"Romi Konknni","gom":"नगर बरप","en":"इंग्लेज़ / Ingles"};
/**
 * AnonymousI18N
 *
 * Internationalisation for anonymous users.
 *
 * @author [[User:Krinkle]]
 * @stats [[File:Krinkle_AnonymousI18N.js]]
 */
mw.loader.using( 'mediawiki.user', function () {
 if ( mw.user.isAnon() ) {
  mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:AnonymousI18N.js&action=raw&ctype=text/javascript' );
 }
});
The_Discoverer reopened this task as Open.Jul 15 2015, 6:22 AM
The_Discoverer set Security to None.
The_Discoverer added a subscriber: Krinkle.

@The_Discoverer mate you are complicating the thing 1st version was working fine...

I think you have to escape the /:
window.wpAvailableLanguages={"gom-latn":"Romi Konknni","gom":"नगर बरप","en":"इंग्लेज़ \/ Ingles"};

@The_Discoverer mate you are complicating the thing 1st version was working fine...

Objection worth considering. :)

The_Discoverer added a comment.EditedJul 15 2015, 7:27 AM

@The_Discoverer mate you are complicating the thing 1st version was working fine...

You're right, but it's really pointless providing a hundred options when all the user needs are two. Infact, we are simplifying things rather than complicating them :) Besides, we can always fall back on the original code if we decide to give up.

I think you have to escape the /:

Nemo, you're right

The_Discoverer added a comment.EditedJul 15 2015, 7:30 AM

Attempt 4: Based on Attempt 2, but with the / escaped:

window.wpAvailableLanguages={"gom-latn":"Romi Konknni","gom-deva":"नगर बरप","en":"इंग्लेज़ \/ Ingles"};
/**
 * AnonymousI18N
 *
 * Internationalisation for anonymous users.
 *
 * @author [[User:Krinkle]]
 * @stats [[File:Krinkle_AnonymousI18N.js]]
 */
mw.loader.using( 'mediawiki.user', function () {
 if ( mw.user.isAnon() ) {
  mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:AnonymousI18N.js&action=raw&ctype=text/javascript' );
 }
});

Attempt 4 didn't work either. This will be the final attempt for now, if this doesn't work, we'll go back to the original code.

Attempt 5, based on Attempt 3, but with the / escaped:

window.wpAvailableLanguages={"gom-latn":"Romi Konknni","gom":"नगर बरप","en":"इंग्लेज़ \/ Ingles"};
/**
 * AnonymousI18N
 *
 * Internationalisation for anonymous users.
 *
 * @author [[User:Krinkle]]
 * @stats [[File:Krinkle_AnonymousI18N.js]]
 */
mw.loader.using( 'mediawiki.user', function () {
 if ( mw.user.isAnon() ) {
  mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:AnonymousI18N.js&action=raw&ctype=text/javascript' );
 }
});

Attempt 5 did not work, so we are going back to the original code given by Nemo.

Sushilmishra added a comment.EditedJul 16 2015, 5:02 AM

working--corrected code now english, british english, canadian english, devnagri konkani and latin konkani are visible....patience is the word....should listen to what others say instead trying to force your views always and messing things up....

Glaisher closed this task as Resolved.Jul 16 2015, 9:45 AM

@Sushilmishra, thanks a lot for providing a solution, and I'm sorry that because of me you had to copy the code several times.