MediaWiki talk:Gadget-AcceleratedFormCreation.js

Definition from Wiktionary, the free dictionary
Jump to navigation Jump to search


minor edit[edit]

Can the script check the minor-edit box?—msh210 08:05, 9 November 2008 (UTC)

It used to, but User:RJFJR asked me not to :). I think it should, so might change it back. Conrad.Irwin 08:25, 9 November 2008 (UTC)
Yes please - flooding RC. SemperBlotto 09:41, 10 November 2008 (UTC)
Now done, but I have no easy way of asking people to hard refresh, which they need to do in order to get the latest version. (Caching again). Conrad.Irwin 13:20, 10 November 2008 (UTC)


Something seems to have gone wrong here - I have seen it once before (different language). SemperBlotto 12:35, 10 November 2008 (UTC)

p.s. It's been corrected, so see its history.

That happens if the user clicks "save" too quickly - it had read the contents of User:Conrad.Irwin/creation.js/plural but not substituted the correct values. Conrad.Irwin 13:19, 10 November 2008 (UTC)

more uses[edit]

How would one go about adding this feature to another inflection-line (or conjugation-table) template?—msh210 07:13, 11 November 2008 (UTC)

It's more intended for inflection lines, as when you get to a whole conjugation table, it makes sense to have a bot to do it. In theory you just add a <span class=""></span> around the form to be created (as in the examples above see my contribs to templates for actual use). Conrad.Irwin 00:31, 12 November 2008 (UTC)
If you want forms that aren't listed above, then you'll have to edit the script. If you don't want to risk breaking things, just prod me nicely and I'll add support for stuff (assuming I'm still feeling just as nice :p) - same goes for editing templates. Conrad.Irwin 00:35, 12 November 2008 (UTC)
Yeah, I'd rather avoid risking my ruining things. Would it be possible for you to add support for:
  • template:he-noun's {{{pl}}} parameter? It should create a new page at [[{{{pl}}}]] that looks like ==Hebrew==/===Noun===/{{infl|he|noun|sc=Hebr|head={{{plwv}}} parameter from singular page, or {{{pl}}} parameter if plwv doesn't exist}}/# {{plural of|[[singular form|{{{wv}}} parameter from singular page if it exists]]|lang=he|sc=Hebr}}
  • template:en-adj's first two numbered parameters?
  • template:en-noun's {{{pl2}}} parameter?
Thanks ever so much.—msh210 07:15, 12 November 2008 (UTC)
en-adj and en-noun now work better, you'll need to hard refresh to see any difference. I'll get round to doing he-noun at some point soon, as it will require changes to the javascript too. Conrad.Irwin 09:29, 12 November 2008 (UTC)
he-noun should now work for plural too. Could you review אנשים for me? Conrad.Irwin 23:14, 12 November 2008 (UTC)
Great, thanks! Is it possible to add Category:Entries missing romanizations of Hebrew? —RuakhTALK 01:39, 13 November 2008 (UTC)
Now does. Conrad.Irwin 16:27, 13 November 2008 (UTC)
Rock! Thanks! :-D   —RuakhTALK 18:57, 13 November 2008 (UTC)
Thank you!!—msh210 05:42, 13 November 2008 (UTC)
This script is great! Thanks again for writing it. Now, can I bug you for more implementations? (See what happens when you do something nice? People start expecting things of you. Better to leave well enough alone.) How about {{he-noun}}'s {{{cons}}} parameter? I'm thinking that that would make, s.v. [[{{{cons}}}]], ==Hebrew==/===Noun===/{{infl|he|noun form|sc=Hebr|head={{{conswv}}} parameter from original page, or {{{cons}}} parameter if conswv doesn't exist}}/# {{form of|construct form|[[original form|{{{wv}}} parameter from singular page if it exists]]|lang=he|sc=Hebr}}{{romanization of Hebrew}}. —msh210 20:47, 18 November 2008 (UTC)
Now done. Please review שואת‎ for me. Conrad.Irwin 23:52, 20 November 2008 (UTC)
Beautiful. Thanks so much.—msh210 17:31, 24 November 2008 (UTC)

piped headwords[edit]

תפוח עץ had

{{he-noun|wv=[[תפוח|תַּפּוּחַ]] [[עץ|עֵץ]]|

so the script made (s.v. תפוחי עץ (hist))

{{plural of|[[תפוח עץ|[[תפוח|תַּפּוּחַ]]_[[עץ|עֵץ]]]]|

as it was supposed. This problem should exist for, e.g., en-noun also.—msh210 18:56, 25 November 2008 (UTC)

It only happened because the hebrew stuff needs to override the origin page's display. Should now be fixed. Conrad.Irwin 01:08, 28 November 2008 (UTC)

German nouns[edit]

Hello. Can we add this feature to the German noun inflection templates, e.g. Template:de-noun-f and the others in the Category:German inflection templates? --Volants 11:14, 27 November 2008 (UTC)

I've added it to {{de-noun-f}} -m and -n, not to -adv as that isn't used, and not to the verbs, yet. I can add it to the uncountable ones if you would like - or you can probably see how to do that by taking the stuff from around the genitives of the countable ones. Conrad.Irwin 00:47, 28 November 2008 (UTC)
Yes, please add to the -unc ones too, i tried to do it here, but im afraid i messed up. Could you fix it please? Thanks. Mutante 01:25, 30 November 2008 (UTC)
Fixed, and added to -f-unc and -m-unc. Conrad.Irwin 08:42, 30 November 2008 (UTC)

German adjectives[edit]

Moreover, can the Template:de-adj be added to the code? --Volants 11:32, 27 November 2008 (UTC)

Now done. (I'll get round to the above requests in a bit). Conrad.Irwin 23:30, 27 November 2008 (UTC)

Substing lang templates[edit]

When I tried the accelerated creation with a plural Galician noun, the language name was linked in the L2 language header. Can you set up (at least for Galician) the automatic insertion of the dummy parameter 1= so that the language name won't be linked in the language section header? --EncycloPetey 01:15, 28 November 2008 (UTC)

Yes I can, however I thought we had a convention to link the names of languages not in the top twenty - or is that just in the translation sections? Conrad.Irwin 01:23, 28 November 2008 (UTC)
I've added the parameter for Galician only at the moment, I will add it to all languages if that is more correct. Conrad.Irwin 01:29, 28 November 2008 (UTC)
That issue hasn't been settled that I know of. We do want that kind of linking in the Translations sections, but linking language headers is an unresolved issue. There may be some merit in it, but I think they ought to be linked only for truly obscure languages, and perhaps not even then. --EncycloPetey 20:56, 28 November 2008 (UTC)

Spanish nouns[edit]

Would you be able to get this to work with Spanish nouns? zapatos is the format used. Nadando 19:19, 30 November 2008 (UTC)

I've added it to {{es-noun-m}} and {{es-noun-f}}, but {{es-noun-mf}} needs thinking about - can you give me an example of a word using that with four correct forms I can imitate? Conrad.Irwin 01:02, 1 December 2008 (UTC)
Ok, look at presidente / presidenta- the plurals get the same format. Nadando 00:25, 8 December 2008 (UTC)

Thanks again for making this accelerated. I love it already. Can the format be tweaked a bit?

  1. After the gender on the inflection line, add {{p}}.
  2. Add nocat=1 to the {{plural of}} call so that it won't categorize the entry under Category:Spanish plurals (I've been meaning to clear that category out, and the {{infl}} call will get it in the right one Category:Spanish noun forms).

--Bequw¢τ 05:47, 18 December 2008 (UTC)

Now done, thanks for the pointer from below. Conrad.Irwin 22:10, 18 December 2008 (UTC)

Dutch diminutives[edit]

Are always neuter. Can you make sure that gender is preselected? Or tell me how to make sure it is?

Similarly, it doesn't make sense to mention a gender in the plural in Dutch. How do I make the gender not appear there? H. (talk) 13:08, 4 December 2008 (UTC)

If the class name contains "gender-n" it will be neuter. If it doesn't contain any gender- thing it will not add a gender. I've fixed {{nl-noun}} and {{nl-noun2}}. Conrad.Irwin 13:20, 4 December 2008 (UTC)
Thanks. In addition, the diminutives have a plural themselves, so ideally, you’d have it insert a note for that (see antecedentje), and even better, this plural would be accelerated as well. I think the best thing would be to create {{nl-noun-dim}} and you’d insert that. Better yet, someone else had this idea already. Can you make it use that template? H. (talk) 10:31, 31 July 2009 (UTC)
Done, I think. Also corrected the links in {{nl-noun-dim}} to create a diminutive-plural instead of just a plural. Conrad.Irwin 01:07, 1 August 2009 (UTC)

Anchor to multi-language lemma page[edit]

When the plural form is saved and I click on the lemma link to go back to the lemma entry, it would be nice to go back to the actual language entry on multi-language pages. Is this possible with the plural of template? --Panda10 00:00, 11 December 2008 (UTC)

Yes it is, if people are happy with the rather ugly looking {{plural of|[[word#Hungarian|word]]|lang=hu}}. It would also be possible just using {{plural of|word|lang=hu}}, but then it wouldn't "count". Which is preferred? Conrad.Irwin 01:18, 14 December 2008 (UTC)
I believe the no-wikilink solution is against the standards. About the first option: Is it ok to add it to all plural entries even if it is not needed? Do you see any other issues besides the "ugly looking" format? --Panda10 13:02, 14 December 2008 (UTC)
Ok, should now be done if you clear your cache (ctrl+shift+F5). Conrad.Irwin 13:27, 14 December 2008 (UTC)
Thanks, Conrad. It works great. --Panda10 02:27, 17 December 2008 (UTC)

Portuguese accelerated[edit]

Can you add this to {{pt-adj}} and {{pt-noun}} please. They will have very simple functions, similar to Spanish and Italian. Thanks --Volants 11:18, 16 December 2008 (UTC)

Done. Conrad.Irwin 12:42, 17 December 2008 (UTC)
Thanks. Please, another request for {{pt-noun-f}} and {{pt-noun-m}}. --Volants 12:58, 4 February 2009 (UTC)
Done. Conrad.Irwin 11:56, 14 February 2009 (UTC)

Spanish adjectives[edit]

A request for {{es-adj}} to be accelerated also. It should be simple. --Volants 11:21, 16 December 2008 (UTC)

Well... As with {{es-noun-mf}} it is possible to create the plural forms of masculine and feminine automatically, but creating the other singular form is quite hard - as {{es-adj}} expects to be used on both. I could also write code to make the combined masc&fem plural form point to a combined singular form, but not sure how worth it that is? Conrad.Irwin 13:28, 17 December 2008 (UTC)
I've done this, so there will be one accelerated plural form on the page, but not an accelerated other singular. Conrad.Irwin 20:26, 17 December 2008 (UTC)

Can we also get the {{p}} after the gender for created adjectives? --Bequw¢τ 05:54, 18 December 2008 (UTC)

If you clear your cache (ctrl+shift+F5) it should add plural into the inflection line: {{infl|es|adjective form|g=m|g2=p}}. Conrad.Irwin 10:01, 18 December 2008 (UTC)
Thanks. That's great. I also made a comment above in the Spanish noun section which you might not have seen as I made two comments right after each other in different sections. Are those possible too? --Bequw¢τ 20:28, 18 December 2008 (UTC)

Danish Nouns an Verbs[edit]

It would be a great help if {{da-noun}} and {{da-verb}} could have this functionality. I had a look at the code, but I can't do it myself. – Leo Laursen – (talk · contribs) 22:55, 4 January 2009 (UTC)

Could you please give me a link to an example noun and verb that have all of the forms, so I can imitate the current Danish standard. Conrad.Irwin 17:35, 5 January 2009 (UTC)
The danish templates are not very well-developed as yet, but it would be nice to have the 3 inflections for noun and 4 for verbs. The word blære is both a noun and a verb, and has the inflections that are implemented. Nouns will get 4 genetives, same as Swedish, which simply is a s-postfix in the majority of cases. "Singular indefinite" is the base form for nouns, and infinitive for verbs. – Leo Laursen – (talk · contribs) 19:01, 5 January 2009 (UTC)
Now suddenly I get green links for Danish nouns, but I don't see any related changes that might explain it. Anyway nice :-). Is it possible to change User:Conrad.Irwin/creation.js/basicNoun: "'''{{{pagename-linked}}}'''" to "{{infl|{{{lang}}}|noun form}}", so they get a category? or should we make a new noun-template for that. – Leo Laursen – (talk · contribs) 22:08, 15 January 2009 (UTC)
Thanks, it's great. I took the liberty to add a space in inflNoun, hope that's allright. It is a really great tool. – Leo Laursen – (talk · contribs) 11:05, 16 January 2009 (UTC)
I've now added support for da-verb. I had no idea quite how varied the different langauges were, so the structure I chose isn't as practical as I thought - however it's great that you've managed to understand enough to tweak it how you like. Please please improve it however you like, it's easy to undo things when they break. Conrad.Irwin 00:55, 19 January 2009 (UTC)

Hungarian adverbs[edit]

When time allows, would you please add it to {{hu-adv}}? Thanks. --Panda10 17:29, 10 January 2009 (UTC)

Done. Sorry for the delay. Conrad.Irwin 01:38, 7 February 2009 (UTC)
No problem, but this should create an adverb, not an adjective. Please see how I changed csendesebben. Not sure how to use the comparative template, since it puts the word in the adjective category. --Panda10 12:59, 10 February 2009 (UTC)
clear your cache (ctrl+shift+F5) Conrad.Irwin 13:12, 10 February 2009 (UTC)

Two<insert>Three :p</insert>fold request[edit]

Hi, I was wondering if you could make two improvements to this wonderful tool.

  1. Accelerate French adjective forms and forms of nouns that change according to gender.
  2. Accelerate Dutch plural diminutives. Also there may (or may not) be some other thigs that need acceleration in {{nl-noun}}.

Kind regards,

50 Xylophone Players talk 01:40, 27 January 2009 (UTC)

My bad, I gave no examples; for 1 see blagueur (noun) and hollywoodien (adj) and been for 2. 50 Xylophone Players talk 01:47, 27 January 2009 (UTC)

  1. French adjective forms. Done.
  2. French noun forms. How should the "feminine" form be defined? "feminine of acteur", or "actress" for example - this really should be done by hand. Once the feminine singular form has been created then they should be able to accelerate the feminine plural from there.
  3. What should the definition line be? Can you give me a link to an example which has this form created already so I can copy it?
I should probably be clearer with that instruction ;). Conrad.Irwin 02:26, 7 February 2009 (UTC)
I'm hitting the hay soon so I'll give an example later if I get a chance. Anyway, about the French nouns I'm aware of the acteur-actrice situation, but see blageur above; it means joker but it changes to agree with gender; something that the English joker does not do. 50 Xylophone Players talk 00:46, 8 February 2009 (UTC)
If you mean an example for Dutch diminutive plurals I don't know of any right now but the definition should simply use whatever format the other Dutch noun forms are using in such a way that it renders " may require a new template, specifically for diminutive plurals, as I do not think they have been tackled yet. See User:PalkiaX50/Sandbox for a temporary example of what needs to be accelerated in {{nl-noun}}. 50 Xylophone Players talk 22:48, 8 February 2009 (UTC)
Thanks for doing the adjectives. Sorry about this but I just realised now that {{fr-adj-mf}} also needs acceleration... see ploutocratique for an example. 50 Xylophone Players talk 23:22, 10 February 2009 (UTC)
Done {{fr-adj-mf}}. I'm still of the opinion that "a female joker" would be nicer - but maybe :). Any decision on Dutch diminutives yet? Conrad.Irwin 01:13, 14 February 2009 (UTC)
I have not really been able to get around to asking but what I'm sure there's no problem in doing is adding accelerated links for alternative plurals. 50 Xylophone Players talk 22:53, 22 April 2009 (UTC)

Romanian nouns[edit]

Also, can we have {{ro-noun}} with accelerated too. --Volants 13:04, 4 February 2009 (UTC)

Done. Conrad.Irwin 01:42, 7 February 2009 (UTC)

"Inflected" form[edit]

Hi Conrad, Dutch adjectives have an inflected and non-inflected form, but no genitive or other case. So I'd like to be able to do <span class="form-of inflected-superlative-form-of lang-nl">. Can you add this keyword? Cheers, H. (talk) 09:51, 5 February 2009 (UTC)

See {{nl-adj2}} for what I mean. H. (talk) 09:55, 5 February 2009 (UTC)
Do you have an example with a complete set of forms I can look at? (or at least, some of the new kind, so I know what you want displayed). Conrad.Irwin 01:44, 7 February 2009 (UTC)
A Dutch adjective can have 8 forms altogether. Apart from the basic uninflected form there is: inflected (-e), partitive (-s), comparative (-er), inflected comparative (-ere), partitive comparative (-ers), superlative (-st), inflected superlative (-ste). See the newly created {{nl-decl-adj}} for more information, or duidelijk for an example. Ideally, each of these would have its own entry pointing back to the headword, using the Dutch form-of templates {{nl-adj-infl-of}}, {{nl-adj-part-of}}, {{nl-adj-comp-of}} and {{nl-adj-sup-of}}. Category:Dutch entry templates contains example entry templates for each of the 7 forms. Any way to make that work? --CodeCat 12:21, 1 February 2010 (UTC)
A note for future reference: the templates mentioned above are now obsolete. Use {{nl-adj-form}} instead. —CodeCat 08:48, 29 June 2010 (UTC)

Spanish m / f nouns[edit]

Currently when you click on the accelerated 'f' portion of the {{es-noun-mf| output, the feminine form gets generated with {{infl}} instead of {{es-noun-mf. Could this be modified so that the feminine form gets created with {{es-noun-mf|m=foo}}? Nadando 00:31, 8 February 2009 (UTC)

See bandida for example. Nadando 00:35, 8 February 2009 (UTC)

Able to be used in Safari[edit]

Hi there Conrad.Irwin. Is there any way that you could get this to be able to be used on Safari as well as Internet Explorer? If you can't, then that is fine, but it might help :). Cheers, Razorflame 16:45, 10 February 2009 (UTC)

Never mind..looks like it does work in Safari. Cheers, Razorflame 16:46, 10 February 2009 (UTC)

Glad to hear! Conrad.Irwin 17:21, 10 February 2009 (UTC)

space at the end of theinflection line[edit]

Fyi: I just made text files acceleratedly (plural of text file), and the inflection line had an extra space (or some whitespace character) at its end.—msh210 20:13, 19 February 2009 (UTC)

Hmm, it does this so that the gender would appear spaced away from the inflection line. If this is a massive problem I can fix it; but it would require a lot more time than I'll have for the next week or two. Conrad.Irwin 01:46, 20 February 2009 (UTC)
Not a massive problem at all AFAICT. It doesn't break anything that I know of (but perhaps one of the bot operators will disagree), and doesn't appear to viewers of the entry.—msh210 17:59, 23 February 2009 (UTC)

Help needed once again[edit]

I tried to accelerate {{nl-adj2}}, but it didn’t work: the comparative and superlative were no longer shown at all, see my reverted changes. I think this has something to do with the switch. Can you have a look at it? H. (talk) 13:06, 26 February 2009 (UTC)

Yes, the switch interprets the "=" sign within the HTML tag as being part of the switch syntax (which is a bug in my opinion, but nevermind). What format do you want for the "inflected-comparative" etc. form's pages?


Hey man, when you've got a chance do you think you could make {{ca-adj-mf}} acceleratable? :D avorrit has all its forms added. Then there's {{ca-adj}}, which has jove's form, replet's and caòtic's. I dunno why the hell there are all these templates that do the same thing, but it's whatever. Thanks in advance :) — [ ric ] opiaterein — 02:07, 2 April 2009 (UTC)

{{ca-adj}} and {{ca-adj-mf}} differ in the default forms generated if no parameters are passed. While you can use either to generate what you want, {{ca-adj}} assumes an adjective of one form (i.e. masculine and feminine forms are the same) while {{ca-adj-mf}} assumes a an adjective of two forms. I need to work on those templates some more. They currently use a subtemplate {{ca-sub-pl}} that is also called by the number templates and is intended for eventual use by the noun templates to handle the not too uncommon occurrence of multiple plural forms. So for the moment if you'd hold off on accelerating the adjective templates, I'd appreciate it. — Carolina wren discussió 05:32, 2 April 2009 (UTC)
Sure, being told I don't have to do stuff makes a nice change. If you need a hand accelerating stuff later, let me know. Conrad.Irwin 08:13, 2 April 2009 (UTC)

I doubt if I'll want to use the default acceleration for the Catalan adjective templates, but while playing around with it, I noticed that for Catalan it was trying to place the entries in [[Category:[[Catalan]] adjective forms]] instead of [[Category:Catalan adjective forms]]. You might want to add the l= parameter to wherever it is inserting the language name by substing in the language code template to generate the category name. Certainly would make accelerating templates for which the standard forms are useful easier for those languages where the default is to use a link.— Carolina wren discussió 04:19, 4 April 2009 (UTC)

Simple Lithooo thing[edit]

Template:lt-pusdalyvis can be automated, since all of these end in the same thing (-damas), and there's only three forms of it :D dainuodamas has its forms added. — [ ric ] opiaterein — 11:21, 5 April 2009 (UTC)


Alright, so, can I get Template:bg-noun-f-a1 accelerated?

I added all of the forms for it over at Template:Cyrl, and they look like they should (category stuff as well, as Category:Bulgarian words lacking transliteration is a maintenance category that I'm going to create due to this being accelerated). Template:Cyrl is missing all of the forms, for testing it.

Thank you! --Neskaya kanetsv 20:11, 13 April 2009 (UTC)


I've noticed that when the plural is specified in en-noun via the pl parameter, it isn't accelerated. — Carolina wren discussió 21:42, 14 April 2009 (UTC)

Fixed. Conrad.Irwin 22:19, 14 April 2009 (UTC)

support for Latin[edit]

what would it take to make declension and Category:Latin conjugation templates supported? I was going to make some links blue but it'll be incredibly repetitive without it. -- Pinochio 22:16, 25 April 2009 (UTC)

A reasonable amount of work, for words with a lot of forms like that, it is better to run a bot (like User:SemperBlottoBot, I think User:EncycloPetey has one/was going to try and get one for Latin. Conrad.Irwin 09:17, 1 May 2009 (UTC)

Danish genitives[edit]

With the addition of Danish genitives, it is a problem that part-of-speech are set to 'Verb' for all Danish words. I'm afraid I don't see an obvious solution. – Leo Laursen – (talk · contribs) 21:34, 30 April 2009 (UTC)

Perhaps I should be more specific. The genitive noun forms now are saved as verb forms. By the way; the sequence of genitive-singular/plural-(in)definite is simply a matter of personal preference, feel free to reorder if that simplifies the code. – Leo Laursen – (talk · contribs) 08:15, 1 May 2009 (UTC)
Yuck, sorry about that - I'll have a look and see if I can work out why. Conrad.Irwin 09:14, 1 May 2009 (UTC)
Should be now fixed, I created avocadoens to test it. Conrad.Irwin 09:21, 1 May 2009 (UTC)
Thats great, I'll hunt down remaining mistaken verb forms; its probably my edits anyway. – Leo Laursen – (talk · contribs) 09:46, 1 May 2009 (UTC)

some more French ones[edit]

Hi, could you accelerate {{fr-adj-al}} and {{fr-adj-ne}} when you get a chance? (Despite their potential they are barely used, so much so that I just stumbled upon them a little while ago, even though they were created back in the day of WF.) 50 Xylophone Players talk 22:44, 4 May 2009 (UTC)

Strongly agree, look at this, quite a few of those are -al adjectives that don't yet use the right template. Thank for pointing that out, Palkia. Mglovesfun 22:57, 4 May 2009 (UTC)

Broken Accelerated editing of Spanish adjectives[edit]

It seems that your edit 6510832 on "09:18, 1 May 2009" has broken the accelerated creation of Spanish adjective forms. From this version the adjective forms will be erroneously created with "{{infl|es|noun form..." inflection lines. Also, Spanish plural noun forms the "plural" is missing on the inflection line. Matthias Buchmeier 09:40, 6 May 2009 (UTC)

Sorry, that was silly of me. Conrad.Irwin 12:38, 6 May 2009 (UTC)

{{fr-noun}} (again)[edit]

This works well, but if you specify a feminine form and or feminine plural of the noun (see détenteur, for example) the masc. pl. comes up in green, and the two feminine forms come up in red. Cheers, Mglovesfun 13:35, 15 May 2009 (UTC)

Thanks, only thing is it create gagnante as the plural of gagnant, which it isn't. It's the feminine singular, what's the category for that? I will try and recategorize the ones that need it. Mglovesfun 21:03, 20 May 2009 (UTC)
Sorry, now fixed. Conrad.Irwin 22:28, 20 May 2009 (UTC)
You're closer now, for gagnant you can create gagnants and gagnantes, but not gagnante, which I can do easily by hand with a copy-and-paste template, but in the long run a green link would be better. The exact categorisation needs some thinking about, I suppose, as it's not a "plural". Mglovesfun (talk) 19:12, 13 July 2009 (UTC)

More technical issues[edit]

A few thoughts

  1. Is there a way of finding green links, i.e. articles that can be created with one click?
  2. When the word already exist, with another meaning in another language you can't accel-create. I don't think adding a section to an exist article is that hard, the problem is stopping the link being active when the section already exist (such as two Spanish plurals, or three, or four in the same article.) Am I right? Mglovesfun (talk) 21:31, 16 July 2009 (UTC)
At the moment it finds them by using specific HTML classes which are added to the page manually, I don't think it can be done completely automatically - but if you want to improve this script, then feel free [it's internally very messy] - with the simple english Wiktionary script, it just has an attribute on the table. Adding a section isn't that hard, but checking every single blue link is very expensive (we'd have to make a lot of api hits) - maybe we could ask Hippietrail if he can add support for checking such things to his forward and back link script on the toolserver. Conrad.Irwin 22:21, 16 July 2009 (UTC)

Just a bit of helpful info: this is slightly irrelevant but anyway, if you want to us accelerated creation to create an entry that has 2 or more possible things it can contain (multilingual or not) here's what I do:

  1. Determine what order the things should be arranged in in the entry.
  2. (presuming you are only dealing with two things) click on the accel link for the second sense and copy the content.
  3. Go back and click on the accel link for the first sense and paste in sense number two.

Naturally however, you will need to maintain a couple of tabs to achieve this, not that that should be a problem. 50 Xylophone Players talk 14:01, 5 August 2009 (UTC)

Yes, I am aware of this, but fixing it would require completely rewriting the javascript, which would almost invariably break it in bizarre ways for a while. Maybe, one day, I'll get the determination to do it, but for now I have other things that are taking up too much of my time. (The creation.js on simple wiktionary does allow multiple entries on the same target page - but there the massive advantage is they have only one language) Conrad.Irwin 20:20, 5 August 2009 (UTC)

one more kink to work out for Dutch nouns[edit]

{{nl-noun-dim}} used in diminutive singular entries needs to be fixed the accel links it generates create entries in the form of:

{{diminutive of|plural=1|<diminutive singular>#Dutch|<diminutive singular>|lang=nl}}

instead of:

{{diminutive of|plural=1|<lemma>#Dutch|<lemma>|lang=nl}}

See here for an example. 50 Xylophone Players talk 14:13, 5 August 2009 (UTC)

That is not fixable, sorry. Creation.js can only create links back to the page which it is on (otherwise it would have to scan through all of the entry to try and work out which page it should link to, which is error prone. You can presumably use the dutch dimminutive plural acceleration from the lemma page instead?. Sorry. Conrad.Irwin 20:18, 5 August 2009 (UTC)
Oh well, nothing we can do but disable the crazy links that {{nl-noun-dim}} creates then... At least we still have accelerated creation for diminutive plurals. 50 Xylophone Players talk 15:45, 13 August 2009 (UTC)

Czech adverbs[edit]

Hi Conrad, could you update the script to accelerate the creation of Czech adverb forms, please?

A simple change in function get_preload_template (form, lang, link) is sufficient:

            case 'comparative':
            case 'superlative':
            case 'exaggerated':
-               if (lang == 'hu' && get_part_of_speech(link) == 'Adverb')
+               if ((lang == 'hu' || lang == 'cs') && get_part_of_speech(link) == 'Adverb')
                    return prefix + 'basicAdverb';
                return prefix + 'basicAdjective';

Example entries: plynule, agresivně. Thank you, Karelklic 19:09, 29 August 2009 (UTC)

Should be done now, just clear your cache (ctrl+shift+F5). (I also corrected User:Opiaterein's attempt to add Slovene) Conrad.Irwin 22:57, 29 August 2009 (UTC)
It works well. Thanks again. Karelklic 12:12, 30 August 2009 (UTC)

Incompatible with beta?[edit]

I'm trying out the Wiktionary beta and the green links aren't showing up. I have the two lines of code added to my monobook.js file. CyberSkull 12:46, 5 September 2009 (UTC)

Ah, I found the solution. I need to add the two includes to my vector.js file! CyberSkull 12:48, 5 September 2009 (UTC)
Indeed, why they didn't implement /common.js is a mystery to me. Conrad.Irwin 22:56, 6 September 2009 (UTC)


Could you make Template:es-pp accelerated? It's basically like Template:es-adj, but for past participles used as adjectives. Ultimateria 03:57, 18 Sept ember 2009 (UTC)

What exactly should a created page look like? Conrad.Irwin 18:05, 20 September 2009 (UTC)
See abultado- basically all the pages are the same. Nadando 18:09, 20 September 2009 (UTC)
As above, this is not possible at the moment, as creation.js can only create pages linking back to the current page. Given that that's now two requests for it to function otherwise, I'll see if I can hack around with it some more, but I can't promise anything. Conrad.Irwin 18:15, 20 September 2009 (UTC)

Dutch comparative and superlative adjective forms[edit]

Could you make it so that the inflection line of a Dutch adjective comparative form uses {{nl-adj-comp}} and the superlative form uses {{nl-adj-sup}}? —AugPi 04:11, 18 September 2009 (UTC)

done. Conrad.Irwin 18:03, 20 September 2009 (UTC)


Same things. I'm still doing French feminine forms by hand (see User:Mglovesfun/Templates for what I do) and as for adjective forms, all of which use {{fr-adj}} or {{fr-adj-mf}}, that's totally fine but you can replace adding the category at the bottom by using {{infl|fr|adjective form}} which removes a bit of clutter, especially when merging sections. That is, using ACCEL to create a noun plural and an adjective plural by copying from one window to another. Mglovesfun (talk) 22:48, 21 September 2009 (UTC)

eo-noun and eo-adj[edit]

Could you please make eo-noun and eo-adj accelerated, as in ŝipo and verda?(It doesn't matter whether inflection of or accusative of/accusative plural of is used)--Yair rand 14:28, 14 October 2009 (UTC)

Actually, if you haven't started working on it yet, could you use {{eo-form of}} instead, as is now used in the forms of fido, ŝipo and verda? --Yair rand 15:41, 19 October 2009 (UTC)
This is finally done so just clear your cache (ctrl+shift+F5). Nice form-of template! (It finally gave me the motivation to fix the code so that it doesn't rely on mediawiki templates which makes it flexible enough to use your templates easily). Let me know of anby problems with ĥoro or ĉarma. Conrad.Irwin 00:24, 23 October 2009 (UTC)
This might be only on my computer, but when I click on the green links the edit box is blank even though the URL shows up as though it was working. BTW, ĥoro and ĉarma are formated perfectly, and is this supposed to work with uncountable nouns? I noticed that in the URL for uncountable noun forms there was no mention of |unc=yes. --Yair rand 00:57, 23 October 2009 (UTC)
What browser are you using? There seem to be some problems with the most recent versions of Opera when editing anonymously. I don't currently have an Internet Explorer to test with. (Chrome and latest version of Firefox seem fine). 08:41, 23 October 2009 (UTC)
I'm using Chrome 3. --Yair rand 12:40, 23 October 2009 (UTC)

Quick problem with the eo accelerations. When I go to make a page with them the inflection line ends up showing as:


instead of whatever it should be. --Neskaya contribstalk? 06:13, 23 October 2009 (UTC)

I don't think that's possible as it just uses '{{subst:PAGENAME}}' unless you can point me to a page containing a green link that acts like that in a certain browser?. 08:41, 23 October 2009 (UTC)
I also noticed that the URL includes Conrad.Irwin/creation.js instead of the inflection line even though I'm still trying to get the edit box to work. Flava links to{{subst:eo}}%3D%3D%0A%0A%3D%3D%3DAdjective%3D%3D%3D%0A'''Conrad.Irwin/creation.js'''%0A%0A%23%20{{eo-form%20of|flav|aj}}%0A%0A{{count%20page|[[Wiktionary:Page%20count]]}}&autosummary=Creating%20definite-plural%20form%20of%20[[flava]]%20([[WT:ACCEL|Accelerated]])&autominor=true but it still shows up blank for me. --Yair rand 12:49, 23 October 2009 (UTC)
I just saw the message you sent to the GP. Um, is importing Visviva's preloadText into my monobook.js necessary for this to work? --Yair rand 13:41, 23 October 2009 (UTC)
No, it's at the bottom of creation.js as well (importing it to site js would prevent duplication everywhere). I've fixed the problem - which was that I had upt "{{subst:pagename}}" into the javascript, which MediaWiki helpfully subst:d on my behalf (as I include copies hosted from my computer for testing I didn't notice). If you clear your cache (ctrl+shift+F5), it should now be fixed. Conrad.Irwin 14:25, 23 October 2009 (UTC)
Hmmm... maybe my computer's just gone nuts. I tried using IE8 and it still shows a blank edit box. Still works for all the other accelerated templates, but these two show up blank. The links are green, the URL says all the stuff it should, but no matter what I do the box is blank. --Yair rand 14:53, 23 October 2009 (UTC)
OK, I tried importing Visviva's preloadText into my monobook.js and now it works. I'm not sure whether that's what caused it to work or if my computer is just insane. --Yair rand 15:09, 23 October 2009 (UTC)
Bizarre. It sounds like that might be the problem then. Conrad.Irwin 15:12, 23 October 2009 (UTC)
I just noticed that in some of the forms I did the program didn't add an edit summary or check the minor edit box. Am only I having this problem? --Yair rand 16:37, 23 October 2009 (UTC)
As far as I know, yes. I've tried uploading a version that sets those two in a different way - let me know if things degrade. Conrad.Irwin 18:36, 23 October 2009 (UTC)
I'm having the strangest things happen with this. Now the script sometimes loads everything double: (see{{subst:eo}}%3D%3D%0A%0A%3D%3D%3DAdjective%3D%3D%3D%0A'''{{subst:PAGENAME}}'''%0A%0A%23%20{{eo-form%20of|sa%C4%9D|aj}}%0A%0A{{count%20page|[[Wiktionary:Page%20count]]}}&preloadsummary=Creating%20definite-plural%20form%20of%20[[sa%C4%9Da]]%20([[WT:ACCEL|Accelerated]])&preloadminor=true). --Yair rand 05:11, 25 October 2009 (UTC)
This is because the preload stuff is included twice (it does try to prevent that, but it can't be perfect). You can remove it from your monobook.js, I'll try to get it added to common.js today. Conrad.Irwin 11:27, 25 October 2009 (UTC)

Hungarian nouns[edit]

Hello there. Earlier, I noticed that you now have support for the accusative plural forms of Hungarian nouns, however, it is incorrect. Please see how I changed sisakokot. Could you please fix this?

Secondly, do you think you can include support for the remainder of that declension table? I have the possessives down pat, so those don't need acceleration, but the first declension table is a pain in the ass. Please see how the word magmakamra is formatted (the declensed words for that noun, first table) for an example of how it should be accelerated. Thanks, Razorflame 19:10, 24 October 2009 (UTC)

Hi, I think this should be fixed? (well, I removed support for the accusatives per the previous section). I'm reluctant to accelerate an entire table - it should be much easier to do vast quantities by bot (that way you don't have the problem if the page already exists but the section doesn't, etc.). Conrad.Irwin 11:30, 25 October 2009 (UTC)
I can easily do most of them by hand and as quick as a bot, so I don't mind doing them. Thanks for the help, Razorflame 19:00, 29 October 2009 (UTC)
The advantages of having a bot do them are a) they don't show in recent changes b) a bot is run by someone fluent in the language c) multiple forms with the same spelling are trivial using a bot d) a bot can create sections even when the page already exits (and can do the whole lot in one run more easily than filling in the blanks). I don't hugely mind if people want to implement links for entire tables themselves - but I am very reluctant to do this myself. Conrad.Irwin 20:30, 29 October 2009 (UTC)
Either way, I am fine with it. I wouldn't mind if you would be willing to creationize them, and I also would not mind if you didn't. If you would rather not creationize them, then I am fine doing it the way that I currently do it. Thanks, Razorflame 21:14, 29 October 2009 (UTC)

Turkish noun forms[edit]

Please see melek. The two noun forms that I tried adding were incorrectly added. Please remove acceleration for the entire Turkish noun or try to fix it. Thanks, Razorflame 19:00, 29 October 2009 (UTC)

Incorrect in what way? which forms? Conrad.Irwin 19:04, 29 October 2009 (UTC)
Yikes, that's a huge chart (I thought bots did that sort of thing). I think Razorflame is probably talking about all that are left green which all show "{{{3}}} of melek". The two noun forms that Razorflame added were deleted by Mglovesfun half an hour ago. --Yair rand 19:40, 29 October 2009 (UTC)
Yes. That is what I am talking about. It would need to either be fixed or be completely removed as it is not functioning correctly. Razorflame 19:41, 29 October 2009 (UTC)
[1] - I have no idea what Sinek was trying to do, perhaps one of you could try and work that out. (I managed not to have creation enabled which is why I couldn't see the links the first time, sorry) Conrad.Irwin 20:26, 29 October 2009 (UTC)
I probably am not a good candidate for it as a) I don't speak Turkish, and b)I suck at templating. Furthermore, thanks for fixing the problem. Razorflame 21:13, 29 October 2009 (UTC)

Conrad, please see the forms that I've made for salak so far. I would like that entire table to be accelerated, and I will make all the forms of salak to give you a baseline as to how they should be accelerated. Thanks, Razorflame 19:31, 9 November 2009 (UTC)

I've told you why I will not accelerate entire tables before - by all means do it yourself, or find someone friendly, but, as above, I think these tables are much much better suited to bots (and not just because they are faster, they have the potential to make higher quality edits). Conrad.Irwin 19:50, 9 November 2009 (UTC)
Ok, cheers, Razorflame 20:09, 9 November 2009 (UTC)

eo-proper noun and uncountable eo-nouns[edit]

Could you make {{eo-proper noun}} and {{eo-noun-uncountable}} accelerated, as in the forms of Jupitero, sabato, and fido? ({{eo-noun-uncountable}} is the same as {{eo-noun|unc=yes}}) --Yair rand 03:22, 5 November 2009 (UTC)

I think this should be done now. Conrad.Irwin 19:49, 9 November 2009 (UTC)
No, it still doesn't have the links green. I tried doing a hard refresh and it still doesn't work. --Yair rand 00:13, 11 November 2009 (UTC)
Sorry, I fixed only half of it. Any more luck now (After clearing your cache (ctrl+shift+F5))? Conrad.Irwin 20:58, 14 November 2009 (UTC)
Sorry, I wasn't clear enough what I was asking. As it is in the examples I gave, {{eo-proper noun}} is supposed to make {{eo-form of|(base)|on-proper}} or |on-properpl}}/|oj-properpl}}/|ojn-properpl}} if {{{1}}} equals "j", and {{eo-noun-unc}} is supposed to make {{eo-form of|(base)|on|unc=yes}}. Sorry for the confusion. --Yair rand 02:53, 15 November 2009 (UTC)
When I make forms of proper nouns using {{eo-proper noun}}, it doesn't enter the last section as "on-proper" Ultimateria 05:31, 16 November 2009 (UTC)
Sorry for being slow witted, I have submitted my latest attempt, let me know if it satisfies requirements yet. May I also suggest following the English template conventions for uncountable nouns. (i.e using {{eo-noun|-}} instead of {{eo-noun|unc=yes}} or {{eo-noun-uncountable}}) - it makes things easier on editors if templates work the same way. If you want a hand implementing it, then I can. Conrad.Irwin 13:58, 16 November 2009 (UTC)
If you're slow witted, I don't want to know what I am. Well, those templates would work, but I still want to use {{eo-proper noun}}. I really just need the last parameter of the accelerated form to be "on-proper" as opposed to "on" as it is, so it will be categorized as a proper noun form. Ultimateria 23:23, 16 November 2009 (UTC)
Sorry that I have to keep bugging you about these, but the -oj suffix accelerated link in {{eo-proper noun}} produces {{eo-form of|xxx|oj-proper}} (which shows up blank) instead {{eo-form of|xxx|oj-properpl}}. Other than that everything works great. --Yair rand 05:09, 25 November 2009 (UTC)

French again... :([edit]

Hi I'm not sure if you did this in the first place or not but links for feminine forms of nouns (sg and pl) are broken Template:f-s has no accel link at all and f pl's link just makes it as "plural of xxxx". Can you take a look? 50 Xylophone Players talk 23:27, 10 November 2009 (UTC) PS see développeur for an example.

Does the latest update fix it if you clear your cache (ctrl+shift+F5)? Conrad.Irwin 21:26, 14 November 2009 (UTC)
Yes, but recently (and this has also happened with Esperanto nouns) when I click on a link it makes a double entry...Can you see what's wrong?
You have "importScript('User:Visviva/pretext.js');" in your monobook.js, I have recently had to use this for this project too, and there's no way to stop them conflicting reliably - the best thing to do is to just delete it from your monobook.js, I will try and move it to Common.js at some point and remove it from here. Conrad.Irwin 15:22, 1 December 2009 (UTC)
Re {{fr-noun}}, better edit summaries would be "Creating feminine singular form of" and "Creating feminine plural form of". Other than that, great! Mglovesfun (talk) 15:30, 1 December 2009 (UTC)
Also (minor and of little importance) you can tidy up French feminine and feminine plural nouns by changing {{feminine of|word}} to {{feminine of|[[word]]}} to avoid add count page, for French adjective there's {{fr-adj-form}} to replace the explicit category, although that would have the disadvantage of not linking the individual words of multi-word terms. Mglovesfun (talk) 09:58, 15 January 2010 (UTC)
{{count page}} was created because we explicitly don't want links like that in these templates; though {{feminine of}} doesn't accept lang= so it can't automatically link to the right language section of the page anyway. fr-adj-form seems reasonable; I'll try to work out how this thingy works again. Conrad.Irwin 01:05, 16 January 2010 (UTC)

Ido plural fix[edit]

Hi there. When I use acceleration to make an Ido plural entry, it has a wikilink to Ido in the header of the entry. Can you remove the wikilink from the header when they are accelerated please? Thanks, Razorflame 22:35, 18 November 2009 (UTC)

You'll have to fix Template:io, I think. Conrad.Irwin 17:30, 23 November 2009 (UTC)
I think it's actually supposed to be linked, and Autoformat would probably re-link it if removed. --Yair rand 06:40, 30 November 2009 (UTC)

Multiple-word Esperanto noun forms...[edit]

...keep ending up in Category:Esperanto words needing attention. They can be fixed easily by doing this. Can you get the template to do this automatically? I'm not sure how the parts of speech involved would affect this, because some are an adjective-noun combination (like nana galaksio), but a few are a noun-noun combination (like glacio planto). Ultimateria 20:24, 29 December 2009 (UTC)

Actually, glacio planto should be moved to glacia planto, which I am going to do right now. Razorflame 20:35, 29 December 2009 (UTC) Actually, never mind. I see why I put it as such. Glacia means icy, not ice, so it has to be glacio. Razorflame 20:36, 29 December 2009 (UTC)
It can be done, providing there is a simple algorithm for changing the word endings; it looks like it is always "split before the last letter, and add a j", if so, I can do that. Conrad.Irwin 23:29, 29 December 2009 (UTC)
That's it exactly. Well, either j, n, or jn of course. Thank you! Ultimateria 23:37, 29 December 2009 (UTC)
Finally done. Conrad.Irwin 01:16, 18 March 2010 (UTC)

en-noun starting with a hyphen[edit]

There won't be too many of these, of course, so maybe this is a WONTFIX, but ACCEL makes the inflection line (e.g.) '''[[]]-[[tuples]]''' when the singular starts with a hyphen and uses {{en-noun|s}} or {{en-noun}}.​—msh210 17:27, 28 January 2010 (UTC)

Done. Conrad.Irwin 01:16, 18 March 2010 (UTC)

IE compatibility[edit]

For IE compatibility, I added an indexOf() to Array.prototype in Common.js. I think this is a good way and you can use it instead of array_indexOf() if want. The rub that this introduces is that you can't use the in operator for looping over arrays because prototype methods are enumerable (ref). That's what I just fixed in my recent edit here. --Bequwτ 17:36, 2 March 2010 (UTC)


Hello, can this be modified to allow quick creation for Polish comparative and superlative forms? In Polish, these are relatively regularly formed for short adjectives. Longer adjectives often take bardziej (equivalent to more) and najbardziej (equivalent to most), which I will try to incorporate into the template. --Volants 14:28, 17 March 2010 (UTC)

For English we don't create pages for "more exciting" etc. as they are sum-of-parts. If there are comparatives and superlatives that are formed as single words, then yes, support for them can be added. Conrad.Irwin 01:17, 18 March 2010 (UTC)

Norwegian adjectives[edit]

How could definite singular and plural be implemented in the same entry? See ljos and template:nn-adj-1 for an example. --Harald Khan Ճ 10:27, 3 April 2010 (UTC)

While we're at it: is it possible to split the superlative into indefinite and definite? --Harald Khan Ճ 10:51, 3 April 2010 (UTC)
Yes. What I've typically done is to just "invent" new form-ofs as I come across a need for them, obviously by scanning through the source you can find existing ones (though I apologise for the mess) - at the moment "singular-definite" exists, so there's no reason that "superlative-definite" etc. shouldn't. Are you interested in doing this yourself, or shall I do it? Conrad.Irwin 11:23, 3 April 2010 (UTC)
I know nada about JS, so I don't know too much about how the program flow goes. I'd really appreciate if you could do it ;-) - then we'll see if I am capable of doing some scripting myself in the future. --Harald Khan Ճ 11:31, 3 April 2010 (UTC)
I'm understanding more of the syntax now; but I just realised that I cannot edit the user page. Here's something more important than that above: when the language is either nn or nb, a second argument called something like "lang2-xx" should be callable. In the source code somewhere shoud we should have
return variable ('origin', wgTitle + '#{'+'{subst:' + lang2 + '|l=}}|' + given);
in case the "lang2" argument is used. Essentially the entry is either 'nn' or 'nb' but its origin should be 'no'. --Harald Khan Ճ 19:06, 3 April 2010 (UTC)
I am hoping to migrate all of the mess at the top into the style of fr/en/eo at the bottom. I'll give it a go in the next hour or so. Conrad.Irwin 20:08, 3 April 2010 (UTC)
Sorry. I'm going to give up for now, a combination of tiredness and trying to wade through half a million norwegian inflection templates. I guess you want something like the following: All this function is trying to do is fill in the definition line. If you want to fix it, please do. Otherwise I'll have another wrestle in the future. Conrad.Irwin 22:02, 3 April 2010 (UTC)
// Create a preload function for all brands of norwegian, they are normal entries, using the bolded inflection lines '''{{PAGENAME}}''' {{g}} = get_preload_text.nb = get_preload_text.nn =
    basic_entry( bolded_infl( definition_line( function (form, lang, gender, go, link) {
        // What form of has been requested formof + '-form-of' appears in the class name
        var formof = form.replace(/-/g, ' ');
        var extra = "";

        // Get lang2= if the original entry has a different language from the current one.
        link.className.replace(/lang2-([a-z]+)/, function (m, lng) { lang = lng; return m; });

        // The rest works out what template should appear on the definition line from the form.
        // This is probably inaccurate and not the best way of doing things, but there are too many norwegian templates for me.
        if (formof == 'positive') { // Needed? 
            formof = gender_form (gender)
            if (formof == 'plural') {
                return '{' + '{form of|plural|' + wgTitle + '|lang=' + lang + '}' + '}';
        } else {
            formof = formof.replace('third person', 'third-person');
            formof = formof.replace('simple past and participle', 'past');

        if (formof == "diminutive plural") {
            formof = formof.replace(" plural","");
            extra = "|plural=1";
        } else if (formof == "superlative definite") {
            extra = "|definite=1";
            formof = "superlative";
        } else if (formof == "superlative indefinite") {
            formof = "superlative";
        return '{' + '{' + formof + ' of|' + wgTitle + extra + '|lang=' + lang + '}}';

Once easter's over, I won't have too much time for Wiktionary for a while, so I suppose it has no haste (there aren't too many other active contributors focusing on Norwegian at the moment). Thank you for your efforts thus far (a bit blinded by the source code above, so no immediate comments on it). --Harald Khan Ճ 23:01, 3 April 2010 (UTC)

Sure. I've added some comments, perhaps of dubious value. Conrad.Irwin 23:12, 3 April 2010 (UTC)
I actually thought what I asked for was going to be pretty simple to implement; so I'll create a list to make sure nothing's lost:
  1. Right now it doesn't look like it is possible have a positive definite singular form of adjectives, nor is positive plural form of adjectives possible.
  2. It does not look like having two "definitions" created at the same time is possibel; i.e. I'd like the script to create the following entry for me (perhaps other templates, not sure what's best, but these work), from ljose:
==Norwegian Nynorsk==


# {{definite singular of|[[ljos #Norwegian Nynorsk|ljos]]|lang=nn}}
# {{form of|plural|[[ljos #Norwegian Nynorsk|ljos]]|lang=nn}}

[[Category:Norwegian Nynorsk adjective forms]]

I imagine the -syntax could be something like <span class="form-of positive-plural-form-of positive-singular-definite-form-of2 lang-nn"> where form-of2 allows for a second "definition" (the syntax here might perhaps not be too compatible with the script as it is written, but you get the idea). None of this is possible until 1. is solved, though - neither positive-plural-form-of or positive-singular-definite-form-of work at present.

  1. The superlative stuff: once the syntax <span class="form-of superlative-indefinite-form-of lang-nn"> and <span class="form-of superlative-definite-form-of lang-nn"> work (which you introduced), this point should be solved.
  2. Lastly, the lang2 stuff: I imagined that this part was initiated by an if test - if lang2 is given, we create the entry as normal, apart from what the origin is (as I pointed out earlier).
I don't understand what = get_preload_text.nb etc. is doing in the code, because all of the above points should work with any language, particularly the first three ones. I also thought that all of the stuff could be solved issue by issue (the second issue only depend on the first point with the given example).
Furthermore, I don't think it is necessary to "wade through half a million norwegian inflection templates", template:nn-adj-1 conatains all that's needed. I've also created a test for "lang2" in the template template:no-noun-infl, it may e.g. be testet at smaragd#Norwegian by clicking at "smaragdane". --Harald Khan Ճ 16:46, 4 April 2010 (UTC)

Here's a section from the script where I've implented lang2 in the way I thought it could be. I don't know if the code I've introduced has a coorect syntax.

function set_origin (given, lang) {
    // Check if lang2 has been provided     // CHANGE: a new logical test and a new variable, 'langlink'
    if (lang2)
        var langlink = lang2
        var langlink = lang

    //Remove links from given parameters, and unencode underscores to spaces
    if (given) {
        given = given.replace(/\[\[([^\|\]])*\|?([^\]]+)\]\]/g,"$2").replace(/_/g,' ');
        if (lang && lang != 'en')
            return variable ('origin', wgTitle + '#{'+'{subst:' + langlink + '|l=}}|' + given);  // CHANGE: 'langlink' instead of 'lang'
            return variable ('origin', wgTitle + '|' + given);
    if (lang && lang != 'en')
        return variable('origin', wgTitle + '#{'+'{subst:' + langlink + '|l=}}|' + wgTitle);// CHANGE: 'langlink' instead of 'lang'

        return variable ('origin', wgTitle);

Wouldn't this work? No need to include the Norwegian language codes in the source code. --Harald Khan Ճ 07:28, 9 April 2010 (UTC)

Where you are going to use the "langlink" variable? I do actually want to split the code up into per-language sections, there's much less between-language duplication than I thought, and the current mess leaves much to be desired. Conrad.Irwin 12:41, 9 April 2010 (UTC)
'langlink' is used where the 'origin' variable is defined; see the "// CHANGE:" comments. It just made more sense to me to define a new variable with a new name rather than redifining 'lang', to avoid confusion (if 'lang' is never used later in the script, then I suppose that it wouldn't matter, but I'm still not fond of it). If you feel that you must create a new "section" for Norwegian, could it not look like what I wrote above? It solves the lang2 problem at least, which is what bugs me the most at the moment (despite what the title of this debate reads). --Harald Khan Ճ 12:55, 9 April 2010 (UTC)
Right, I can see you've defined it (though you actually need to extract it from the class attribute of the span, and you shouldn't not define origin at the same time), but where does it fit into the output templates. The "for all languages" code, once it has set the variables, then loads a template from Special:PrefixIndex/User:Conrad.Irwin/creation.js/ and replaces the variables. I just don't see how to make langlink work with those. Conrad.Irwin 13:04, 9 April 2010 (UTC)
Well, you're the JS wiz, extracting lang2 should be a simple process, I reckon :-P. The 'langlink' variable is only used to create the string 'origin', right? How does the name of the variable affect the template - where is the template loaded? --Harald Khan Ճ 13:22, 9 April 2010 (UTC)
Well... It's all a horrible mess. when you do "return variable('lang2', lang2)" (yes extracting it is easy), it actually returns "s/{{{lang2}}}/Norwegian/" - so it never gets to the bit where it sets origin. The template is then loaded by audoedit when the url is clicked on, and all the find-and-replaces are done then. Conrad.Irwin 13:28, 9 April 2010 (UTC)
Oh, all I wanted to was to set the variable 'langlink', not to exit the function. I am actually familiar with the "return" statement from Python, which (apparently) does much of the same job - I just didn't see it. I've changed the source; does it work now? --Harald Khan Ճ 13:46, 9 April 2010 (UTC)
Ok, I've done what I think you meant. Let me know if it's wrong still. Conrad.Irwin 14:03, 9 April 2010 (UTC)
It worked after a "Ctrl-F5". Thanks a million. :-D --Harald Khan Ճ 14:23, 9 April 2010 (UTC)

Catalan (2)[edit]

I seem to have unintentionally made {{ca-adj-mf}} accelerated. However, it seems to be working well without errors, any reason I couldn't add such links to {{oc-adj}} and {{ca-adj}} as well? Mglovesfun (talk) 10:43, 26 April 2010 (UTC)

Do whatever works. It helps if you add {{isAccelerated}} so I can try to keep (at least an approximate) eye on what's happening. Conrad.Irwin 12:14, 26 April 2010 (UTC)

Tunisian Arabic (aeb)[edit]

Is there any way that aeb translations could be subcategorized under ar, just like Greek/Ancient Greek? Mglovesfun (talk) 23:25, 8 May 2010 (UTC)

I think you meant to put this at "editor.js". The short answer is no, the long answer is "yes in the version that i use on my computer, but that is too buggy to let people use and I won't have time to fix it until july". Conrad.Irwin 20:55, 11 May 2010 (UTC)

Template talk:ca-adj[edit]

Probably easy to fix, but I'm not seeing it. Mglovesfun (talk) 20:33, 11 May 2010 (UTC)

I don't see it either, can you link to a page with the problem? Conrad.Irwin 20:59, 11 May 2010 (UTC)
freds (original creation). Maybe something to do with it using mpl=freds, instead of {{ca-adj|freda|freds|fredes}}. Mglovesfun (talk) 21:02, 11 May 2010 (UTC)
The template author neglected to close the spans. Now fixed. Conrad.Irwin 21:14, 11 May 2010 (UTC)
Yeah what an idiot. Anyway, if there is anything to fix it can't be much as we don't have many Catalan adjective forms. Mglovesfun (talk) 21:15, 11 May 2010 (UTC)

Main space only[edit]

Any way that accel links would only work in the main name space? Currently you can create inflected forms of templates, appendices, user talk pages, anything! Mglovesfun (talk) 22:10, 15 May 2010 (UTC)

Fun, isn't it :). Conrad.Irwin 22:23, 15 May 2010 (UTC)
Done. It still works in the sandbox so's I can test it. (you've used it from there before, I noticed :p) Conrad.Irwin 22:37, 15 May 2010 (UTC)


When you specify a feminine form of a noun accelerated links aren't given for the feminine singular and plural. It seems that it previously did this, so I'm wondering did you disable this functionality or did an update to the code break it? It's useful for things like Orcadien at least, IMO. 50 Xylophone Players talk 18:26, 6 June 2010 (UTC)

Sorry, my fault. Should now be fixed if you clear your cache (ctrl+shift+F5). Conrad.Irwin 21:18, 6 June 2010 (UTC)
Thx a lot. :) 50 Xylophone Players talk 11:45, 7 June 2010 (UTC)


Please can Template:pl-adv become accelerated? I have tried with cieplej (comparative of ciepło), but this appears as an adjective, not adverb. --Volants 10:20, 14 June 2010 (UTC)

Fixed, if you clear your cache (ctrl+shift+F5). Conrad.Irwin 14:42, 14 June 2010 (UTC)

more French problems[edit]

Hey again, just now when I was creating some noun plurals I noticed that when it creates the line using {{plural of}} there is no "lang=fr" generated so unless this is added manually the entry ends up in the French and the English plurals categories. Can you fix this please? 50 Xylophone Players talk 21:53, 16 June 2010 (UTC)

Done. Sorry for the delay. Conrad.Irwin 11:37, 30 June 2010 (UTC)


You won't like this much. Mglovesfun (talk) 19:09, 25 June 2010 (UTC)

Dutch form entries[edit]

I noticed that the script is using a few deprecated templates for Dutch adjective and noun entries, and the format for nouns is also not quite correct. For nouns, the format should follow that of the forms of laken and for adjectives it should follow that of wijd. Currently we also have a bot MewBot to create adjective entries, but the ones created by the accelerated script don't quite match. Do you think it might be better to remove acceleration support for adjectives entirely since we have a bot that does it anyway? —CodeCat 08:46, 29 June 2010 (UTC)

Yes, that sounds like a good idea to me. Conrad.Irwin 23:23, 29 June 2010 (UTC)
Ok, I've removed the acceleration from the adjective templates. But for nouns it's still useful because there is no bot that does nouns (yet). So if you could fix up how the acceleration script generates noun form entries, that would be great. —CodeCat 08:45, 30 June 2010 (UTC)
Done. Conrad.Irwin 11:37, 30 June 2010 (UTC)
Hmm, it doesn't seem to work. Auto-creating the entries for toetsenbord still uses the generic templates. Also, do you think maybe it's a better idea to use {{infl|xx}} (with just the language parameter, no POS parameter) for all languages? As far as I know, that's preferred to just bolding the word, because some languages use special formatting and different fonts (especially with different scripts and such). —CodeCat 17:37, 30 June 2010 (UTC)
Edit: Never mind, I just scrolled up and saw I needed to clear my cache for it to work. So now it works, almost. The template is missing an | between the name and the first parameter. —CodeCat 17:47, 30 June 2010 (UTC)
Sorry, I should have noticed that. Conrad.Irwin 08:33, 1 July 2010 (UTC)

Enigmatic message[edit]

When I visit a page with a green link (possibly only French pages with green links, I haven't checked) I get a pop-up message with the message: "The page at says:" (title) and then "mfpl-positive" or some such, depending on the page. See pingre for an example. —Internoob (DiscCont) 02:28, 1 July 2010 (UTC)

Fixed, I left the debugging help in there. Conrad.Irwin 08:34, 1 July 2010 (UTC)


Please can we add ACCEL to Template:pl-decl-noun. At the moment the table has clickable links (neither red nor green) to empty pages. The possible problem is that some Polish noun forms e.g. pianina have more than one meanings. --Volants 11:10, 5 July 2010 (UTC)


Would you mind accelerating this template's {{{f}}}, {{{mp}}}, and {{{fp}}} parameters, please? When he-adj is used in ENTRY, the acceleration would create, for {{{f}}}, an entry [[{{{f}}}]] with:

wv={{{fdw|fwv|if that's defined at ENTRY, otherwise leave wv= out}}}|
fp={{{fp|if that's defined at ENTRY, otherwise leave fp= out}}}|
fpwv={{{fpdwv|fwpwv|if one of those and fp are defined at ENTRY, otherwise leave fpwv= out}}

# {{feminine of|ENTRY|
{{{dwv|wv|if one of those is defined at ENTRY, otherwise leave 2= out}}}|
tr={{{tr|if that's defined at ENTRY, otherwise leave tr= out}}}|

For {{{fp}}}, an entry [[{{{fp}}}]] with:

wv={{{fpdwv|fpwv|if one of those is defined at ENTRY, otherwise leave wv= out}}}|
fs={{{f|if that's defined at ENTRY, otherwise leave fs= out}}}|
fswv={{{fdwv|fwv|if one of those and fs are defined at ENTRY, otherwise leave fswv= out}}

# {{feminine plural of|ENTRY|
{{{dwv|wv|if one of those is defined at ENTRY, otherwise leave 2= out}}}|
tr={{{tr|if that's defined at ENTRY, otherwise leave tr= out}}}|

And for {{{mp}}}, an entry [[{{{mp}}}]] with:

wv={{{fpdwv|fpwv|if one of those is defined at ENTRY, otherwise leave wv= out}}}

# {{plural of|nocat=1|ENTRY|
tr={{{tr|if that's defined at ENTRY, otherwise leave tr= out}}}|
{{{dwv|wv|if one of those is defined at ENTRY, otherwise leave 2= out}}}|

Thanks much.​—msh210 (talk) 17:09, 5 August 2010 (UTC)

Ido plurals[edit]

A very minor thing, but as with English previously, there's an extra space after the head word when the gender template disappears. Mglovesfun (talk) 13:15, 9 September 2010 (UTC)

Linking components when it shouldn't[edit]

diff, autolinked "Bowman's" and "capsule" even though neither were linked from the source page. Nadando 04:25, 3 November 2010 (UTC)


Could you modify this script to include the declensions for this template? It would ease work on creating the new entries. Thanks. TeleComNasSprVen 20:48, 6 November 2010 (UTC)


Could this template be made accelerated-compatible? {{eo-noun}} is, but not the verb version. Shouldn't be difficult as Esperanto is a very regular language. Thanks. Tempodivalse [talk] 20:16, 26 February 2011 (UTC)


Could this template be added too? It's perfectly regular so it should be easy. Thanks, Malafaya 18:31, 9 March 2011 (UTC)


Would you be able to add this template to the list? A lot of plurals are regular with the ending -en, so the template does that by default unless a different plural is specified. An example of a word that's been done is Aarm/Äerm, one that hasn't is Apel/Äppel. Cheers, BigDom (tc) 21:04, 7 September 2011 (UTC)

Done. --Yair rand 21:33, 7 September 2011 (UTC)
Thanks, appreciate it. BigDom (tc) 21:34, 7 September 2011 (UTC)


Should be simple, but too complex for my brain. Basically, I need for the feminine plural in {{sq-part}} to be accelerated, but the format will be a bit more involved than a regular adjective in, say, Spanish.


{{infl|sq|participle form|g=f|g2=p|head=[[të]] {{subst:PAGENAME}}}}

# {{feminine plural of|<source>|lang=sq}}

That's pretty much it, the head= part in the {{infl}} is my main concern. — [Ric Laurent] — 13:02, 10 October 2011 (UTC)

Piped links[edit]

There is now NO reason for these links to be piped. The last one was the {{NUMBEROFARTICLES}} issue, which was solved a few days ago. Mglovesfun (talk) 16:50, 24 November 2011 (UTC)

Not that it really matters[edit]

Can we change all instances of {{infl}} to {{head}}? You all know I'm picky like that. Mglovesfun (talk) 21:37, 30 December 2011 (UTC)

Could all cases of bolded_headword be replaced with {{head}} as well? For all languages? I believe using bolded headwords is deprecated in favour of using headword-line templates, even for form-of entries. —CodeCat 01:02, 5 January 2012 (UTC)


odd happening[Ric Laurent] — 14:32, 24 January 2012 (UTC)

Botched creation[edit]

A couple of things went wrong here. Njardarlogar 12:56, 20 February 2012 (UTC)


Can you please add Template:ast-adj to be accelerated? It is for Asturian adjectives --Cova 19:48, 21 February 2012 (UTC)

More templates[edit]

I don't really understand how this all works, so forgive my ignorance (or, alternatively, explain it if you have the immense willpower necessary to do so). Is it possible to add the following templates, so that they populate like English standard plurals do now (with a single click for each)?

Thanks!--Μετάknowledgediscuss/deeds 04:07, 18 March 2012 (UTC)

Inflectin table templates aren't typically accelerated. You would probably be best off using a bot to generate these forms, instead. --Yair rand (talk) 09:09, 25 March 2012 (UTC)
I considered that and realized that it was so far beyond my technical capabilities that I would end up needing so much help from other users that it would be an insane drag on them. However, is there some bot creation guide out there that I might be able to use? --Μετάknowledgediscuss/deeds 15:16, 25 March 2012 (UTC)
Help:Language inflection bot. --Yair rand (talk) 15:21, 25 March 2012 (UTC)
Thank you. Still seems difficult, though. I will investigate later this week. --Μετάknowledgediscuss/deeds 15:57, 25 March 2012 (UTC)


Can somebody please explain to me what massively idiotic thing I did wrong? (YR: I don't blame you for reverting it :) --Μετάknowledgediscuss/deeds 14:36, 26 August 2012 (UTC)

Adding new languages[edit]

How do I add a new language - Russian or any other? --Anatoli (обсудить/вклад) 01:35, 3 April 2013 (UTC)

Is this a bug in your software?[edit]

If you look at my contributions, you will find a long list of link repair corrections like this one, removing a space. What they all have in common is that they were all generated by something called "Accelerated" which links to this page, and they are all Spanish plurals. Also see the comment on my talk page. There are probably a lot more examples of this problem, and is this software still generating more of them? 02:05, 6 August 2013 (UTC)

Feminine plurals of French entries[edit]

The feminine plural of French entries is created as "plural of (masculine form)". That should be "feminine plural of ...". If I understand the code correctly, in, the variable template does not contain the correct string. — Xavier, 22:36, 29 September 2013 (UTC)

Can you give an example? I don't see any problems with the code here or in {{fr-adj}}. —CodeCat 22:41, 29 September 2013 (UTC)
A way to reproduce this:
  1. edit gentil#French
  2. in {{fr-adj}} change the f parameter to "gentillex"
  3. preview
  4. click on the last green link
=> the definition is "plural of" — Xavier, 22:49, 29 September 2013 (UTC)

Wrong cat for French plural nouns[edit]

French plural nouns are created with the wrong category: Category:French noun forms instead Category:French plurals. This is due to a wrong argument to {{head}}. In, when params.pos is 'noun' and params.form is one of the plurals (ie not 'feminine'), then the second unnamed parameter to {{head}} should be 'plural'. — Xavier, 23:38, 29 September 2013 (UTC)

Can someone take care of this request, please? I can fix this myself if someone is willing to unprotect this script. — Xavier, 22:43, 13 October 2013 (UTC)
I don't know if "plurals" is better than "noun forms". After all there are also adjective plurals. —CodeCat 22:48, 13 October 2013 (UTC)
If you have any doubt, please take the time to read the deletion log of Category:French noun forms and the corresponding RFDO. — Xavier, 23:17, 13 October 2013 (UTC)
That was 4 years ago. —CodeCat 00:11, 14 October 2013 (UTC)
And? If you mean that this RFDO has passed its expiration date and is no longer valid, then undelete the category. Else either fix this script or let me fix it. — Xavier, 00:33, 14 October 2013 (UTC)
You could have created the category too. It isn't locked as far as I know. —CodeCat 00:37, 14 October 2013 (UTC)
That's not what I am asking because I think it had been deleted twice for a reason that is still valid. — Xavier, 01:02, 14 October 2013 (UTC)
And what reason is that? You never told... —CodeCat 01:07, 14 October 2013 (UTC)
Did you bother to take a look at the RFD? — Xavier, 01:19, 14 October 2013 (UTC)
You mean on the talk page? I don't see any reason there. —CodeCat 01:53, 14 October 2013 (UTC)
  • CodeCat, this category failed RFDO; even if you think that decision should be reversed, you obviously shouldn't be telling people to recreate it without discussion. Even if we ultimately reverse the RFDO decision, in the meantime the script is clearly broken. (BTW, the RFD discussion was never archived to the talk-page, because Mglovesfun was going through one of his phases of "archiving" old discussions without actually copying them anywhere; see Wiktionary:Requests_for_deletion/Others?diff=8040442&diffonly=1. I've copied it there now.) —RuakhTALK 05:50, 14 October 2013 (UTC)
  • By the way, I've fixed the script now. Thanks, Xavier; what you described was not quite the correct fix, but even so, it was very helpful. —RuakhTALK 06:00, 14 October 2013 (UTC)
    Thank you a lot Ruakh. — Xavier, 00:17, 15 October 2013 (UTC)

Spanish feminine nouns[edit]

Can someone please add something that makes it possible to acceleratedly create feminine forms of Spanish nouns, for example making a green link from diablito to diablita? This should speed up the creation of feminine forms in Category:Missing Spanish noun forms. Thanks in advance. --Type56op9 (talk) 11:05, 4 February 2015 (UTC)

Asturian nouns[edit]

Hi again. Could someone please ACCEL Template:ast-noun too? Then it'll much quicker to add forms in Category:Missing Asturian plurals. --Type56op9 (talk) 11:08, 4 February 2015 (UTC)


Hello. Can someone please fiddle this to make Template:fr-noun be ACCELerated for feminine forms? I'd be most grateful! --Type56op9 (talk) 09:42, 4 March 2015 (UTC)

@Type56op9 Sometimes it's more complicated than that. --kc_kennylau (talk) 09:58, 4 March 2015 (UTC)

ACCEL for orange links?[edit]

Any way this can be adapted for orange links? For example, Spanish respectivo has an entry, but there's no Spanish entry for the forms respectiva, respectivos and respectivas. --Type56op9 (talk) 11:55, 18 June 2015 (UTC)

Kamba Noun Classes[edit]

Hey Conrad.Irwin! It's me, Khu'hamgaba Kitap, and I have a question to ask of you. You don't have to do this. Though, my coding skills aren't nearly as good as yours are. It would be absolutely great if you maybe could create a template that would create noun classes automatically in Kamba. You were the first person I thought of that I could ask (,but if you aren't up for something like this, please relay this message to someone that you know that would be). Just send me a message if you have any questions about this, just leave me a message on my talk page. In the template, could you include the ability to add tones onto the header for the word (the page for chifuwa is a great example of this). The actual template would have to have similar functionality to the template ny-noun. If you could do this, it would be a great help. Thanks!

- (a guide to the inflections)

Khu'hamgaba Kitap (talk) 11:46, 16 December 2016 (UTC)

RFM discussion: May–August 2017[edit]


The following discussion has been moved from Wiktionary:Requests for moves, mergers and splits (permalink).

This discussion is no longer live and is left here as an archive. Please do not modify this conversation, but feel free to discuss its conclusions.

Assuming that this is a script we still use, it should be moved out of userspace. - -sche (discuss) 17:04, 13 May 2017 (UTC)

Why does it have "Wikt" in front? —CodeCat 17:19, 13 May 2017 (UTC)
Presumably an old naming convention; it's also found on many other gadget pages. We could drop it from them all. - -sche (discuss) 18:08, 13 May 2017 (UTC)
Yeah, I don't see a reason for including it in the name. —CodeCat 19:47, 14 May 2017 (UTC)
Moved. Dixtosa (talk) 20:03, 20 August 2017 (UTC)
"AccForm" suggests "accusative form" to me. I would prefer it be spelled out: "Gadget-AcceleratedFormCreation.js". — Eru·tuon 20:07, 20 August 2017 (UTC)
Erutuon's suggestion is definitely better IMO. —CodeCat 20:20, 20 August 2017 (UTC)
Moved to MediaWiki:Gadget-AcceleratedFormCreation.js Dixtosa (talk) 20:51, 20 August 2017 (UTC)

User:Yair rand/TargetedTranslations.js to MediaWiki:Gadget-TargetedTranslations.js [edit]

As above. - -sche (discuss) 17:04, 13 May 2017 (UTC)

Done. Dixtosa (talk) 18:33, 8 August 2017 (UTC)

User:Connel MacKenzie/mess-with-popups.js to MediaWiki:Gadget-popups.js [edit]

As above. Note that the latter page also imports other, non-Wiktionary-based scripts. - -sche (discuss) 17:18, 13 May 2017 (UTC)

I have removed the invocation of mess with popup because it did not work and was not easy to understand what it did and how to get it working again. Dixtosa (talk) 20:46, 20 August 2017 (UTC)
Whatever it did, it must have been essential, because now the popups look terrible and are impossible to use. — Eru·tuon 21:03, 20 August 2017 (UTC)
Oh, actually, it probably has to do with w:MediaWiki:Gadget-navpop.css not being loaded properly. Sorry. — Eru·tuon 21:05, 20 August 2017 (UTC)

Module error[edit]

It would be a good idea to enclose the script in <nowiki> </nowiki> tags. — Eru·tuon 21:52, 19 November 2017 (UTC)

Ugh. Why is it even trying to parse JavaScript as wikitext? The software is so dumb sometimes. —Rua (mew) 21:57, 19 November 2017 (UTC)
I think they allow it so that people can make substitutable templates that can emit useful JavaScript snippets. — Eru·tuon 21:58, 19 November 2017 (UTC)
@Erutuon, Rua: Did this ever get done? 'Cause there's still a module error... —*i̯óh₁nC[5] 01:16, 23 January 2018 (UTC)
@JohnC5: Undoing this edit will remove the error. — Eru·tuon 01:27, 23 January 2018 (UTC)
@Erutuon: Would it not be safer just to wrap the whole module? —*i̯óh₁nC[5] 01:33, 23 January 2018 (UTC)
@JohnC5: That's my preferred solution. Then the rest of the code doesn't have to be mangled. — Eru·tuon 01:37, 23 January 2018 (UTC)
@Erutuon: Is there another example of this that I could copy? —*i̯óh₁nC[5] 01:47, 23 January 2018 (UTC)
@JohnC5: Well, my latest script for instance, User:Erutuon/scripts/watchlistScriptTagging.js. — Eru·tuon 01:51, 23 January 2018 (UTC)
@Erutuon: That worked a treat. Thanks! —*i̯óh₁nC[5] 02:03, 23 January 2018 (UTC)

"PreloadTextError is undefined"[edit]

When pinyin creation failed, it gave an error message stating that PreloadTextError is undefined. Perhaps it's out of scope because it's defined here in MediaWiki:Gadget-AcceleratedFormCreation.js but used in User:Conrad.Irwin/creationrules.js? (I don't quite understand how scope works in the context of two different scripts on a MediaWiki site.) Then moving PreloadTextError to User:Conrad.Irwin/creationrules.js would fix the problem. — Eru·tuon 23:03, 21 November 2017 (UTC)

I don't know how it works either. But I wonder if that error class is even necessary. —Rua (mew) 23:28, 21 November 2017 (UTC)
Well, whether there's a class or not, the error messages should be able to display rather than being masked by another error message. — Eru·tuon 23:31, 21 November 2017 (UTC)
I agree, but I have no idea how it would actually be fixed. Perhaps if the class were placed at the top of the main script? —Rua (mew) 23:32, 21 November 2017 (UTC)
Well, what I suggested (since it wasn't clear) was moving the creation of the error class from MediaWiki:Gadget-AcceleratedFormCreation.js to User:Conrad.Irwin/creationrules.js so that it's in scope of the functions that actually use it. — Eru·tuon 23:34, 21 November 2017 (UTC)
@Rua: Did you see my message? — Eru·tuon 21:47, 23 November 2017 (UTC)
The creation rules page should be only for actual creation rules. —Rua (mew) 21:49, 23 November 2017 (UTC)
But PreloadTextError is required as the creation rule functions contain it. Either it must be replaced with a generic error, or it must be defined in that script, or in another script that is somehow loaded in the creation rules script. — Eru·tuon 21:57, 23 November 2017 (UTC)
Yes, I suggested loading it before the creation rules. —Rua (mew) 22:17, 23 November 2017 (UTC)
You mean loading MediaWiki:Gadget-AcceleratedFormCreation.js in User:Conrad.Irwin/creationrules.js? — Eru·tuon 22:21, 23 November 2017 (UTC)
No, I misunderstood. You mean declaring the variable higher up. No, that won't change anything. JavaScript has variable hoisting: var and function funcname(){} both result in the variable being defined throughout the whole scope (in this case, the whole of MediaWiki:Gadget-AcceleratedFormCreation.js). — Eru·tuon 22:31, 23 November 2017 (UTC)
My impression is the following, though I might get some terminology wrong. Variables defined in the lowest scope of a script are similar to local variables in Lua (aside from hoisting). They are accessible only to functions defined in that script, not functions defined in other scripts. (That is, they do not add members to window. I don't know how this is implemented: scripts loaded with <script> are able to define variables that are available to other scripts.) Since the function generate_entry and the creation_rules functions are defined in User:Conrad.Irwin/creationrules.js, they do not have access to any of the variables in MediaWiki:Gadget-AcceleratedFormCreation.js except those supplied to the function as arguments. Hence, PreloadTextError is undefined, since it is not present in in User:Conrad.Irwin/creationrules.js, and this caused an error when one of the creation_rules functions attempted to call it. — Eru·tuon 23:03, 23 November 2017 (UTC)
The thing is though, the class used to work, before I made my changes. In the old version, the class was available in the creation rules despite being defined in another script. So something about your script-scope reasoning isn't right. I think it's an order of definition problem. —Rua (mew) 23:08, 23 November 2017 (UTC)
Well, then try the solutions predicted by both of our theories and see which solves the problem. — Eru·tuon 23:34, 23 November 2017 (UTC)

Never mind. I tested my idea and it didn't solve the problem. Now I'm really puzzled. — Eru·tuon 05:35, 24 November 2017 (UTC)

How can I regenerate the error? Dixtosa (talk) 20:25, 24 November 2017 (UTC)
@Dixtosa: I've got an example of a malformed acceleration link in the current revision of User:Erutuon/sandbox1. Install User:Erutuon/scripts/accel.js to turn the link green, and then you can click it and see the error in the console. — Eru·tuon 20:58, 24 November 2017 (UTC)
@Erutuon: this error "No rule for "pinyin-ts" in language "en"? There are no red errors in the console. Dixtosa (talk) 11:30, 26 November 2017 (UTC)
@Dixtosa: I see that error message, but I also see a red error message "ReferenceError: PreloadTextError is not defined" above it. (I got the header of this thread wrong.) Oh, it's because I have the acceleration gadget installed. Duh. Removing the gadget removes the error. So we do have a solution. Sorry for the confusion. — Eru·tuon 19:20, 26 November 2017 (UTC)

@Rua: According to this article, functions can be declared in any order and both their declaration and definition are hoisted to the top of the scope, provided the syntax function functionname() {}, not var functionname = function optionalname() {}, is used. So PreloadTextError can be defined at the bottom of creationrules.js and still be accessible to the creation rule functions above it. I guess the same happens in Lua if you declare a variable at the top of a module and then define it lower down in the module than where it is first used. Not totally sure why that works. — Eru·tuon 19:43, 26 November 2017 (UTC)