MediaWiki talk:Gadget-TranslationAdder-Data.js

From Wiktionary, the free dictionary
Latest comment: 2 months ago by Erutuon in topic Conversion of Min Nan to a family
Jump to navigation Jump to search

Kurdish[edit]

@Vahagn Petrosyan: Can you add:

sdh: 'Kurdish/Southern Kurdish',
lki: 'Kurdish/Laki',

under ckb please? Thanks.--Calak (talk) 13:49, 12 August 2018 (UTC)Reply

@Calak, I'm unfamiliar with the syntax of this gadget. I may break something. Asking @Wyang or @-sche instead. --Vahag (talk) 13:59, 12 August 2018 (UTC)Reply
Thanks. you pinged them.--Calak (talk) 14:02, 12 August 2018 (UTC)Reply
Ok, I've added them. Let me know if there are any problems. - -sche (discuss) 20:27, 12 August 2018 (UTC)Reply

Edit access[edit]

I need edit access to this page, how do I get it and why my rights have been taken away? --Anatoli T. (обсудить/вклад) 07:38, 25 April 2019 (UTC)Reply

@Atitarev: That's because in August 2018 edit rights for JavaScript pages in the MediaWiki namespace was restricted to a newly created user group, interface administrators, separate from sysops. See Wiktionary:Beer parlour/2018/August § Editing of sitewide CSS/JS is only possible for interface administrators from now. — Eru·tuon 21:53, 25 April 2019 (UTC)Reply
@Erutuon Thanks, are you able to give me rights? As it says, it could be done on request from admins. I am an admin and I need to edit it, please. Who else needs to be notified/asked? --Anatoli T. (обсудить/вклад) 22:16, 25 April 2019 (UTC)Reply
You have to ask a Bureaucrat, apparently. @Chuck Entz? ChignonПучок 22:28, 25 April 2019 (UTC)Reply

Arabic-script corrections[edit]

@Erutuon: Hi. Thanks for the latest additions to script corrections! I am sure Urdu could use the same treatment (for now) as Persian. WT:UR TR

I'm not a big fan of the names for some of the letters, though.

  1. kaf/keheh: Arabic ك (k) is called "kāf" and the Persian equivalent ک is called "kâf". How about calling them "arabicKaf" and "persianKaf"?
  2. yeh/farsiYeh: Arabic ي (y) is called "yāʾ" (with a ʾ symbol at the end but no "h") and the Persian equivalent ی is called "ye". How about calling them "arabicYa" and "persianYe"?
  3. alefMaksura: Let's call the Arabic letter ى "alifMaqsura", which looks more Arabic - from the standard transliteration of أَلِف مَقْصُورَة (ʔalif maqṣūra). --Anatoli T. (обсудить/вклад) 05:29, 12 May 2020 (UTC)Reply
@Atitarev: Yeah, I simply used the Unicode names, which are odd. I have no objection to renaming them. — Eru·tuon 05:32, 12 May 2020 (UTC)Reply
Heh, about Urdu, my script assigned it the same replacements as Persian, but I read too hastily to notice when I was adding ota and the rest. Thanks for correcting that. — Eru·tuon 22:41, 12 May 2020 (UTC)Reply
@Erutuon: No worries. Thanks for this new function. Perhaps this method should be used for many other things, not just the translation adder. E.g. I have just corrected the Russian entry ны́не (nýne), which had a Latin "i" on the Ukrainian cognate ни́ні (nýni). --Anatoli T. (обсудить/вклад) 23:00, 12 May 2020 (UTC)Reply

Three Languages To Add[edit]

Here are the following languages I would like to have added:

  • hrx: Hunsrik (with masculine, feminine and neuter)
  • lb: Luxembourgish (with masculine, feminine and neuter)
  • pms: Piedmontese (with masculine and feminine)

Thanks for reading. --Apisite (talk) 06:49, 2 October 2020 (UTC)Reply

@Apisite: I have tried in diff. I am no longer sure it's the right place. @Erutuon: could you please help? --Anatoli T. (обсудить/вклад) 10:26, 2 October 2020 (UTC)Reply
@Atitarev: You forgot the neuter for Hunsrik, but thanks anyway. --Apisite (talk) 10:28, 2 October 2020 (UTC)Reply
@Apisite: I've added the neuter. It seems to take a while, even after a hard refresh. --Anatoli T. (обсудить/вклад) 10:37, 2 October 2020 (UTC)Reply
@Atitarev: That's right, this JavaScript page is loaded by ResourceLoader, and such JavaScript and CSS pages (except for your personal JavaScript and CSS) isn't immediately updated and sent to users by the server, and there's no way I know of to force it, unlike with templates and modules. It usually takes a few minutes for changes to be seen. — Eru·tuon 18:12, 2 October 2020 (UTC)Reply
@Atitarev If you have the time, add Ladin (lld), Lombard (lmo) and Romagnol (rgn), which may have two genders, masculine (m) and feminine (f). --Apisite (talk) 10:11, 6 October 2020 (UTC)Reply
@Apisite: Done. --Anatoli T. (обсудить/вклад) 22:42, 6 October 2020 (UTC)Reply
@Atitarev Could you add Friulian (fur)? It has two genders, masculine (m) and feminine (f), as well. --Apisite (talk) 05:54, 13 December 2020 (UTC)Reply
@Apisite:  Done. You need to give a full list and if they have a Wiktionary. Since most languages also have plural genders, like masc. plural, feminine plural. I've modelled on some others. --Anatoli T. (обсудить/вклад) 06:04, 13 December 2020 (UTC)Reply

Sama languages[edit]

@Atitarev Anatoli, here's the list of languages to list under Sama:

  • ssb – Southern Sama
  • sml – Central Sama
  • sse – Balangingi Sama
  • slm – Pangutaran Sama

Sami languages coming up next. --Apisite (talk) 02:38, 8 December 2021 (UTC)Reply

@Apisite: Already done in diff - Cham, Sama, Sami. Please check if anything is still missing. --Anatoli T. (обсудить/вклад) 03:24, 8 December 2021 (UTC)Reply
@Atitarev: Couldn't the Sama languages be sorted like this?
		//Sama
		sse: 'Sama/Balangingi Sama',
		sml: 'Sama/Central Sama',
		slm: 'Sama/Pangutaran Sama',
		ssb: 'Sama/Southern Sama',
Again, thanks, Anatoli. --Apisite (talk) 04:24, 8 December 2021 (UTC)Reply
@Atitarev: Thanks again, Anatoli. --Apisite (talk) 04:25, 8 December 2021 (UTC)Reply

@Atitarev: Anatoli, couldn't this be done?

		//Sami
		sia: 'Sami/Akkala Sami',
		smn: 'Sami/Inari Sami',
		sjk: 'Sami/Kemi Sami',
		sjd: 'Sami/Kildin Sami',
		smj: 'Sami/Lule Sami',
		sme: 'Sami/Northern Sami',
		sma: 'Sami/Southern Sami',
		sje: 'Sami/Pite Sami',
		sms: 'Sami/Skolt Sami',
		sjt: 'Sami/Ter Sami',
		sju: 'Sami/Ume Sami',

Thanks for your help. --Apisite (talk) 04:00, 8 December 2021 (UTC)Reply

@Atitarev: I sorted the language names almost alphabetically, Anatoli. --Apisite (talk) 04:18, 8 December 2021 (UTC)Reply

Eastern Lawa and Western Lawa[edit]

@Atitarev Anatoli, here are the Eastern Lawa and Western Lawa languages.

		//Lawa
		lwl: 'Lawa/Eastern Lawa',
		lcp: 'Lawa/Western Lawa',

Thanks for listening. --Apisite (talk) 08:28, 9 December 2021 (UTC)Reply

Greater Bai Languages[edit]

@Atitarev Anatoli, here are the Greater Bai languages.

		//Bai
		bca: 'Bai/Central Bai',
		bfc: 'Bai/Northern Bai',
		bfs: 'Bai/Southern Bai',
		lay: 'Bai/Lama Bai',

Also, the Laki Kurdish line is under the Lawa lines. --Apisite (talk) 11:58, 9 December 2021 (UTC)Reply

Roglai Languages[edit]

@Atitarev Anatoli, here are the two Roglai languages:

		//Roglai
		rog: 'Roglai/Northern Roglai',
		rgs: 'Roglai/Southern Roglai',
        roc: 'Roglai/Cacgia Roglai'

At your service. --Apisite (talk) 02:20, 11 December 2021 (UTC)Reply

@Atitarev P.S. They are Chamic languages as well. --Apisite (talk) 02:21, 11 December 2021 (UTC)Reply

@Atitarev What could we do about the language name Cacgia Roglai? --Apisite (talk) 02:32, 11 December 2021 (UTC) Moved from MediaWiki talk:Gadget-TranslationAdder-Data.js.Reply

@Atitarev Anatoli, the Southern Roglai language (rgs) is of the Chamic family of languages (cmc) like Northern Roglai. --Apisite (talk) 02:27, 11 December 2021 (UTC) @Atitarev Don't forget the Cacgia Roglai language (roc) as well. --Apisite (talk) 02:29, 11 December 2021 (UTC)Reply

@Apisite: Hi. I am not enjoying adding new codes regularly. I've added the code as you have provided. --Anatoli T. (обсудить/вклад) 02:35, 11 December 2021 (UTC)Reply

Interwiki links for "fa-ira" and "fa-cls"[edit]

@Benwing2, @Sameerhameedy, @Theknightwho, @Erutuon:

Hi. I lost track where I asked for this last time, so asking the same question again. We still have the issue with Interwiki links for "fa-ira" and "fa-cls" codes. Adding wiktprefix: "fa" doesn't seem to have any effect. Only "fa" and "prs" work as expected.

  1. بَحْث (fa) with "fa" ✅
  2. بَحْث (fa) (bahs) with "fa-ira" ❌
  3. بَحْث (fa) (bahs) with "fa-cls" ❌
  4. بَحْث (fa) (bahs) with "prs" ✅

Is that doable?

Compare also with 討論讨论 (zh) (tǎolùn) or diskusjon (no) where "cmn" joins well with zh:wikt and "nb" with no:wikt. Is something wrong with these codes still? Anatoli T. (обсудить/вклад) 02:18, 10 November 2023 (UTC)Reply

@Benwing2: Thanks for diff but it seems not enough. Anatoli T. (обсудить/вклад) 02:58, 10 November 2023 (UTC)Reply
@Benwing2: Oh no, it did the trick, thank you!! Anatoli T. (обсудить/вклад) 02:59, 10 November 2023 (UTC)Reply

Character replacement required for new language codes[edit]

@Erutuon:

Hi, I can't remember, which module is responsible for replacing incorrect characters, such as Arabic ك and ي with Persian ک and ی, when adding translations. We now need to extend it to the codes: "prs" (Dari), "fa-cls" (Classical Persian) and "fa-ira" (Iranian Persian). Could you please point me in the right direction or extend it for these codes? FYI: @Sameerhameedy, @Benwing2. Anatoli T. (обсудить/вклад) 22:15, 12 November 2023 (UTC)Reply

@Atitarev It looks to be here: MediaWiki:Gadget-TranslationAdder-Data.js#L-1764 Benwing2 (talk) 22:29, 12 November 2023 (UTC)Reply
@Benwing2: Thank you! I will try extending the handling
Sorry but I keep finding flaws with these codes. In diff I added مالِیات‌دَهَنْدِه (mâliyât-dahande), which doesn't have an entry at fa:wikt but it has used {{t+}} rather than {{t}}. Which module is responsible for checking {{t+}} vs {{t}}? Anatoli T. (обсудить/вклад) 22:35, 12 November 2023 (UTC)Reply
@Atitarev The use of {{t+}} vs. {{t}} is done by bot; specifically by User:Rukhabot, operated by User:Ruakh. It doesn't run that often but still does occasionally. Are you saying the translation adder automatically added {{t+}} instead of {{t}}? That is strange if so. Benwing2 (talk) 22:40, 12 November 2023 (UTC)Reply
@Benwing2: It does actually. Try adding a gibberish vs an actual word in for a language, which has its own Wiktionary and the word exists in that Wiktionary. @Ruakh added that functionality too. Anatoli T. (обсудить/вклад) 22:43, 12 November 2023 (UTC)Reply
@Benwing2: Also, User:Rukhabot needs to be aware of the code changes and mappings (e.g. fa-cls->fa), so it doesn't remove the links :) Anatoli T. (обсудить/вклад) 22:46, 12 November 2023 (UTC)Reply
@Atitarev OK, I found the code in MediaWiki:Gadget-TranslationAdder-Data.js#L-1873 but I'm not sure what's going wrong. User:Erutuon or User:This, that and the other, can you give me some pointers in how to debug JavaScript? How do I insert print statements into the code to see what's going on and do the equivalent of previewing a page without saving the gadget? Is that possible, or do I have to create a sandbox gadget? Benwing2 (talk) 22:54, 12 November 2023 (UTC)Reply
@Benwing2 Gosh, this brings back memories of when I used to maintain Twinkle on Wikipedia. Debugging gadgets was rather difficult then, and probably remains so.
Well, you can fork the gadget in your userspace, and include it using the importScript function in User:Benwing2/common.js. You can do debugging using console.log calls, which will dump the relevant variable(s) to your browser's developer tools console (Ctrl+Shift+I).
Alternatively, there is an interactive debugger in the developer tools as well (in Chrome it's on the Sources tab), where you can set breakpoints and the like. This is often easier to use if you add ?debug=true to the end of the URL of the Wiktionary page you are viewing. This would save you having to fork the gadget and repeatedly edit it. This, that and the other (talk) 00:32, 13 November 2023 (UTC)Reply
I did some quick debugging and wasn't able to identify an issue. The script correctly used {{t}} rasther than {{t+}} for مالِیات‌دَهَنْدِه. This, that and the other (talk) 00:53, 13 November 2023 (UTC)Reply
@This, that and the other:
Thanks, yes, it will work fine with "fa" مالِیات‌دَهَنْدِه but need to extent the same to work with "fa-ira"/"fa-cls"/"prs". Anatoli T. (обсудить/вклад) 00:59, 13 November 2023 (UTC)Reply
Whoops, I see the code used was fa-ira rather than fa. Sorry!
The issue is that it is trying to establish the existence on fawiktionary of the title <strong class="error"><span class="scribunto-error" id="mw-scribunto-error-c24d210a">Lua error in Module:languages/errorGetBy at [[Module:languages/errorGetBy#L-16|line 16]]: Please specify a language code; the value "fa-ira" is not valid (see [[Wiktionary:List of languages]]).</span></strong>. So we need some way of telling it that fa-ira should map to fa for the purpose of title normalisation? @Atitarev This, that and the other (talk) 01:06, 13 November 2023 (UTC)Reply
I can come back to this later but I need to move onto other tasks now. This, that and the other (talk) 01:07, 13 November 2023 (UTC)Reply
@This, that and the other Aha, the call to getByCode needs to accept etymology languages. Benwing2 (talk) 01:07, 13 November 2023 (UTC)Reply
@This, that and the other This line: MediaWiki:Gadget-TranslationAdder-Data.js#L-2046 Benwing2 (talk) 01:09, 13 November 2023 (UTC)Reply
Also a couple of places in MediaWiki:Gadget-TranslationAdder.js. Let me see if I can fix. Benwing2 (talk) 01:09, 13 November 2023 (UTC)Reply
@Atitarev Please try now. Benwing2 (talk) 01:16, 13 November 2023 (UTC)Reply
@Benwing2: Perfect, thank you! Anatoli T. (обсудить/вклад) 01:23, 13 November 2023 (UTC)Reply

More codes to nest under Chinese[edit]

@Erutuon @Benwing2 @-sche @Surjection Having discussed this with the Chinese editors on Discord, could we please nest a few more languages under the Chinese header?

  • cnp (Northern Pinghua)
  • csp (Southern Pinghua)
  • ltc (Middle Chinese)
  • och (Old Chinese)
  • wxa (Waxiang)
  • zhx-lui (Leizhou Min)
  • zhx-sht (Shaozhou Tuhua)

Three of these (Northern/Southern Pinghua and Leizhou Min) are pretty new additions, while Waxiang and Shaozhou Tuhua are divergent lects which we have very low coverage of, so they've essentially just been overlooked.

The consensus is that Middle and Old Chinese translations should not be entered, as they should go under Literary (aka Classical) Chinese, so I've added a feature to Module:translations that throws an error explaining this. However, it would still be useful to nest them under Chinese, since if someone tries to add them with the translation-adder in a large list of translations, they're more likely to spot the error message if it's grouped with all the other Chinese languages, instead of hundreds of entries away where they might miss it. @Wpi, Justinrleung. Theknightwho (talk) 12:24, 13 February 2024 (UTC)Reply

Added those codes. — SURJECTION / T / C / L / 12:37, 13 February 2024 (UTC)Reply
@Surjection Would it please be possible to add Sichuanese (zhx-sic)? Theknightwho (talk) 19:38, 27 February 2024 (UTC)Reply
 DoneSURJECTION / T / C / L / 19:40, 27 February 2024 (UTC)Reply

Yokuts[edit]

A couple of changes for the Yokuts languages:

  1. I've standardised the codes to start with yok, as per the macrolanguage:
    • nai-bvyyok-bvy
    • nai-dlyyok-dly
    • nai-gsyyok-gsy
    • nai-kryyok-kry
    • nai-nvyyok-nvy
    • nai-plyyok-ply
    • nai-svyyok-svy
    • nai-tkyyok-tky
  2. Gashowu (yok-gsy) is missing from the list anyway, so should be added.

Pinging @Surjection and @Erutuon. Theknightwho (talk) 18:12, 1 March 2024 (UTC)Reply

 DoneEru·tuon 19:23, 1 March 2024 (UTC)Reply

Conversion of Min Nan to a family[edit]

Hi, could we please do the following re languages under the Chinese header?

  1. Add Hokkien (nan-hbl) and Hainanese (nan-hnm).
  2. Change the codes of Teochew (zhx-teonan-tws) and Leizhou Min (zhx-luinan-luh).

Thanks. Pinging @Surjection and @Erutuon. Theknightwho (talk) 20:23, 3 March 2024 (UTC)Reply

 DoneEru·tuon 01:54, 4 March 2024 (UTC)Reply
@Erutuon Sorry, you've made a typo with the Leizhou Min code in the data: it's nan-luh not zhx-luh.
Also, the Teochew code seems to be used elsewhere in the code (though I'm not sure what that part does), so it'll need to be changed there as well. Thanks! Theknightwho (talk) 19:08, 5 March 2024 (UTC)Reply
Ah, I've just checked: it's the part that automatically corrects aliases to the canonical code. So on top of changing over the Teochew code, it's worth adding the old codes for Teochew and Leizhou Min as aliases. Theknightwho (talk) 19:10, 5 March 2024 (UTC)Reply
 Done, and added some other plausible (?) aliases for these languages. — Eru·tuon 22:46, 5 March 2024 (UTC)Reply