Cannabis Ruderalis

Content deleted Content added
Line 61: Line 61:
[[Kazi Zafar Ahmed]] is displaying "Lua error in Module:IPAc-en at line 13: attempt to index local 's' (a nil value)". That appears to be a result of recent edits to this template, although possibly the error is old wikitext in the article. Would someone please work out what is going on. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 06:09, 25 July 2017 (UTC)
[[Kazi Zafar Ahmed]] is displaying "Lua error in Module:IPAc-en at line 13: attempt to index local 's' (a nil value)". That appears to be a result of recent edits to this template, although possibly the error is old wikitext in the article. Would someone please work out what is going on. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 06:09, 25 July 2017 (UTC)
:{{fixed}} The IPA template was used to link to an audio but didn't include a notation, which obviously isn't the intended use of the template. [[User:Nardog|Nardog]] ([[User talk:Nardog|talk]]) 09:28, 25 July 2017 (UTC)
:{{fixed}} The IPA template was used to link to an audio but didn't include a notation, which obviously isn't the intended use of the template. [[User:Nardog|Nardog]] ([[User talk:Nardog|talk]]) 09:28, 25 July 2017 (UTC)
:: [[Module:IPAc-en]] should be modified to prevent this happening in future. Lines 180 and 182 should contain <source lang="lua" inline>if args[1] and string.lower ...</source> to check if the parameter in question exists before trying to use string functions on it. — [[User:Erutuon|Eru]]·[[User talk:Erutuon|tuon]] 16:14, 25 July 2017 (UTC)

Revision as of 16:14, 25 July 2017

WikiProject iconWikipedia Help Template‑class
WikiProject iconThis template is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
TemplateThis template does not require a rating on the project's quality scale.
WikiProject iconLinguistics: Phonetics Template‑class
WikiProject iconThis template is within the scope of WikiProject Linguistics, a collaborative effort to improve the coverage of linguistics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
TemplateThis template does not require a rating on Wikipedia's content assessment scale.
Taskforce icon
This template is supported by Phonetics Task Force.

Render g as ɡ

Hi Wikipedians, Would it be possible to render a /g/ as a /ɡ/ (the correct one) in the template for convenience?? Anyone who listens is the best!!😃 Thanks. —Awesomemeeos (talk) 06:37, 7 July 2016 (UTC)[reply]

@Awesomemeeos: At the moment, that would be somewhat clunky to do replacements ({{replace}}) would have to be used), but the module I'm working on (Module:IPA) could easily do that (as well as converting from X-SAMPA to IPA). — Eru·tuon 01:51, 17 October 2016 (UTC)[reply]
@Awesomemeeos: {{IPA/sandbox}} now replaces the regular g with the IPA (script) g, using Module:IPA:
  • {{IPA|[g]}}[g]
  • {{IPA/sandbox|[g]}}[ɡ]
Unfortunately, it can't change the text that's supplied to the template; it just makes sure the correct g is displayed. — Eru·tuon 23:52, 17 October 2016 (UTC)[reply]

I've created this module. It behaves the same way as this template when only one parameter is used, but if a language code is added to the first parameter, it creates a link to that language's help page – for instance, {{IPA/sandbox|fr|/ɛɡ.zɑ̃pl/}} becomes /ɛɡ.zɑ̃pl/. The list of help pages in the module isn't complete, but once it is, I think this module could be used to give this template a bit more functionality. — Eru·tuon 02:11, 17 October 2016 (UTC)[reply]

Finished the list. All ISO 639-1 and ISO 639-3 language codes for the languages that have IPA keys are included. — Eru·tuon 04:24, 17 October 2016 (UTC)[reply]

Template-protected edit request on 19 June 2017

The IPA-tagging function in Module:IPA is ready to be deployed widely. It creates the exact same content as the existing template, but also changes regular g to IPA ɡ. Please replace the content of the template with the following:

{{#invoke:IPA|tag}}

Eru·tuon 22:01, 19 June 2017 (UTC)[reply]

@Nardog: You might want to see about implementing this one. --Izno (talk) 18:52, 21 June 2017 (UTC)[reply]
@Erutuon: Are there test cases showing the difference in behavior does not exist? --Izno (talk) 18:53, 21 June 2017 (UTC)[reply]
@Izno: I created testcases at Module talk:IPA/testcases. It compares the output of {{IPA}} to the output of {{IPA/sandbox}}, which currently uses {{#invoke:IPA|tag}}. The first example differs only because it changes the g to ɡ. — Eru·tuon 20:55, 21 June 2017 (UTC)[reply]
FYI, module test cases are usually designed to test the Lua functions while template test cases show the changes in the final output of the templates. You might consider jiggering those pages. If no-one comes along to review the nill difference in a day or three, turn |answered= back to n. --Izno (talk) 21:39, 21 June 2017 (UTC)[reply]
I don't know what you mean by "template test cases". I'm not aware of any way to compare the results besides using Lua. I suppose I could replace the template {{IPA/sandbox}} with the actual Lua function in the module, to prevent it changing if someone decides to use the sandbox template for something else. — Eru·tuon
Oh, I suppose you mean this. — Eru·tuon 22:20, 21 June 2017 (UTC)[reply]

See the template test cases at Template:IPA/testcases. Output of the sandbox template {{IPA/sandbox}} is identical to the output of {{IPA}}, except that the non-IPA symbol g is changed to ɡ. — Eru·tuon 21:28, 22 June 2017 (UTC)[reply]

 Done. Nardog (talk) 21:41, 22 June 2017 (UTC)[reply]

Nota bene* I have reverted the change because an error was reported at {{IPA-hu}}. It looks like the "g" in the link to Help:IPA for Hungarian was transformed to "ɡ" (the IPA symbol) as a result of the change. We should fix it. Nardog (talk) 22:40, 22 June 2017 (UTC)[reply]

@Nardog: Oops. I hadn't thought about links. I'm working on the module now. — Eru·tuon 22:58, 22 June 2017 (UTC)[reply]
The module now finds links and only does replacements in the displayed part of the link. — Eru·tuon 23:21, 22 June 2017 (UTC)[reply]
Now it also ignores the contents of HTML tags. It should be reliable now. — Eru·tuon 23:39, 22 June 2017 (UTC)[reply]
@Nardog: Could you change the template back to using the module again? — Eru·tuon 16:52, 23 June 2017 (UTC)[reply]
@Erutuon: The input could include any kind of string that includes "g" that shouldn't be replaced, such as other templates and unpiped links. You still could escape those by adding more codes, but now I'm thinking... Is this worth the effort? Isn't this something, say, a bot should be taking care of? As much as I do think we need a meta template to cover IPA templates for all languages, the substitution of "g" might just not be within the scope of such a template. Nardog (talk) 17:21, 23 June 2017 (UTC)[reply]
Well, I could add a tracking category for un-IPA g that is not inside HTML tags or templates or targets of piped links, instead of replacing it. Should I do that? — Eru·tuon 17:33, 23 June 2017 (UTC)[reply]
@Erutuon: Sure, that is a much safer approach. I haven't looked deep into the code, but I think what we should do is first preproccess the input and then avoid links and HTML tags. That way you can distinguish g's inside {{...}} that are supposed to appear in the outcome and ones that are not. Sorry if I'm preaching to the choir. Nardog (talk) 17:45, 23 June 2017 (UTC)[reply]
@Nardog: Preprocessing shouldn't be necessary, and in fact it could mess things up, as template parameters are already preprocessed. (I did a test at wikt:Module:User:Erutuon/sandbox.) — Eru·tuon 17:56, 23 June 2017 (UTC)[reply]
I've implemented tracking. Not sure if the tracking category is in keeping with whatever template-tracking categories already exist. — Eru·tuon 18:07, 23 June 2017 (UTC)[reply]
{{IPA/sandbox|[[g]]}} adds the category, but {{IPA/sandbox|g}} doesn't. I don't think it's ready. Nardog (talk) 18:17, 23 June 2017 (UTC)[reply]
Oops. That was due to an unnecessary if-statement. Fixed. — Eru·tuon 18:22, 23 June 2017 (UTC)[reply]

Kazi Zafar Ahmed

Kazi Zafar Ahmed is displaying "Lua error in Module:IPAc-en at line 13: attempt to index local 's' (a nil value)". That appears to be a result of recent edits to this template, although possibly the error is old wikitext in the article. Would someone please work out what is going on. Johnuniq (talk) 06:09, 25 July 2017 (UTC)[reply]

 Fixed The IPA template was used to link to an audio but didn't include a notation, which obviously isn't the intended use of the template. Nardog (talk) 09:28, 25 July 2017 (UTC)[reply]
Module:IPAc-en should be modified to prevent this happening in future. Lines 180 and 182 should contain if args[1] and string.lower ... to check if the parameter in question exists before trying to use string functions on it. — Eru·tuon 16:14, 25 July 2017 (UTC)[reply]

Leave a Reply