This is the talk page for discussing improvements to the Track listing template. |
|
![]() | This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||
|
![]() | Template:Track listing is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
1, 2, 3, 4, 5, 6, 7, 8, 9, 10 |
This page has archives. Sections older than 90 days may be automatically archived by Lowercase sigmabot III when more than 5 sections are present. |
@User:Gonnym: You added a feature 4 years ago, where ids where added. This causes an issue where there is more than one track listing for an album, like when an album is slightly different in different continents (one or more songs added/removed). Those albums now show up at Special:LintErrors/duplicate-ids as unsupported by Parsoid, the new parser. Can this use classes instead, like shown below? line 166:
− | : | + | :attr('class', string.format(cfg.track_id, self.number)) |
Snævar (talk) 16:42, 26 November 2024 (UTC)
I want to know how the " quotes came out automatically.. Camilasdandelions (talk!) 23:26, 22 March 2025 (UTC)
It appears that whenever the "all_writing = " part of the template is used, the sentence that comes out always lacks a period. Liam Gallagher John Squire, for example, lacks the full stop after "All tracks are written by John Squire". Could this issue be properly addressed? Frank(has DemoCracy DeprivaTion) 12:37, 13 April 2025 (UTC)
[Track listing:]
function TrackListing:makeIntro()
if self.all_writing then
return string.format(cfg.tracks_written, self.all_writing)
elseif self.all_lyrics and self.all_music then
return mw.message.newRawMessage(
cfg.lyrics_written_music_composed,
self.all_lyrics,
self.all_music
):plain()
elseif self.all_lyrics then
return string.format(cfg.lyrics_written, self.all_lyrics)
elseif self.all_music then
return string.format(cfg.music_composed, self.all_music)
else
return nil
end
end
[Track listing/configuration:]
tracks_written = 'All tracks are written by %s.',
lyrics_written_music_composed = 'All lyrics are written by $1; all music is composed by $2.',
lyrics_written = 'All lyrics are written by %s.',
music_composed = 'All music is composed by %s.',
::::[Track listing:]
::::function fullstop(a)
:::: local pattern = '%<.*%>'
:::: x, y = a:gsub(pattern,""):gsub('%.*$',''), a:match(pattern)
:::: if not y then
:::: return x .. '.'
:::: else
:::: return x .. '.' .. y
:::: end
::::end
::::function TrackListing:makeIntro()
:::: if self.all_writing then
:::: return string.format(cfg.tracks_written, fullstop(self.all_writing))
:::: elseif self.all_lyrics and self.all_music then
:::: return mw.message.newRawMessage(
:::: cfg.lyrics_written_music_composed,
:::: self.all_lyrics,
:::: self.all_music
:::: ):plain()
:::: elseif self.all_lyrics then
:::: return string.format(cfg.lyrics_written, fullstop(self.all_lyrics))
:::: elseif self.all_music then
:::: return string.format(cfg.music_composed, fullstop(self.all_music))
:::: else
:::: return nil
:::: end
::::end
::::[Track listing/configuration:]
:::: tracks_written = 'All tracks are written by %s',
:::: lyrics_written_music_composed = 'All lyrics are written by $1; all music is composed by $2.',
:::: lyrics_written = 'All lyrics are written by %s',
:::: music_composed = 'All music is composed by %s',
::::
All music is composed by [Composer], except where noted:.Do these changes take colons into account, or just periods? - adamstom97 (talk) 07:59, 9 May 2025 (UTC)
![]() | This edit request to Module:Track listing/configuration has been answered. Set the |answered= parameter to no to reactivate your request. |
Change lines 41-44 from:
tracks_written = 'All tracks are written by %s.',
lyrics_written_music_composed = 'All lyrics are written by $1; all music is composed by $2.',
lyrics_written = 'All lyrics are written by %s.',
music_composed = 'All music is composed by %s.',
to:
tracks_written = 'All tracks are written by %s',
lyrics_written_music_composed = 'All lyrics are written by $1; all music is composed by $2',
lyrics_written = 'All lyrics are written by %s',
music_composed = 'All music is composed by %s',
The ultimate purpose is to both fix and upgrade the punctuation system for the above parameters, which is currently bugged, resulting in sitations where the output text graft periods/full stops to possibly existing punctuation. Some (as of this request) examples:
This edit to the config, along with the intended companion edit to Module:Track listing, would not negatively affect articles where editors have individually corrected the current bug since its implementation, as it mostly serves as a revert. The only catch is that the proposed edits must be done in the correct order (i.e. the config first). Fundgy (talk) 19:42, 9 May 2025 (UTC)
![]() | This edit request to Module:Track listing has been answered. Set the |answered= parameter to no to reactivate your request. |
Description of suggested change:
Change lines 295-311 of Module:Track listing from:
function TrackListing:makeIntro()
if self.all_writing then
return string.format(cfg.tracks_written, self.all_writing)
elseif self.all_lyrics and self.all_music then
return mw.message.newRawMessage(
cfg.lyrics_written_music_composed,
self.all_lyrics,
self.all_music
):plain()
elseif self.all_lyrics then
return string.format(cfg.lyrics_written, self.all_lyrics)
elseif self.all_music then
return string.format(cfg.music_composed, self.all_music)
else
return nil
end
end
to:
--------------------------------------------------------------------------------
-- Function for automatic punctuation for parameters:
-- all_writing, all_lyrics, all_music
-- Punctuation defaults to '.' unless ':' or '.' already exist
-- Automatic punctuation limited to parameter values not containing parser tags
-- i.e. <ref>Text</ref>, <nowiki></nowiki>, etc.
--------------------------------------------------------------------------------
function fullstop(a)
if a ~= mw.text.killMarkers(mw.getCurrentFrame():preprocess(a)) or
a:sub(-1,-1) == ":" or
a:sub(-1,-1) == "." then
return a
else
return a .. '.'
end
end
function TrackListing:makeIntro()
if self.all_writing then
return string.format(cfg.tracks_written, fullstop(self.all_writing))
elseif self.all_lyrics and self.all_music then
return mw.message.newRawMessage(
cfg.lyrics_written_music_composed,
self.all_lyrics,
fullstop(self.all_music)
):plain()
elseif self.all_lyrics then
return string.format(cfg.lyrics_written, fullstop(self.all_lyrics))
elseif self.all_music then
return string.format(cfg.music_composed, fullstop(self.all_music))
else
return nil
end
end
This is the edit to the primary module which required the recently-implemented edit to the config. This upgrades the parameters all_writing, all_lyrics, and all_music to output with automatic punctuation in most cases. The added function, "fullstop", works as such:
The function is then applied to the aforementioned parameters within the already-existing function "TrackListing:makeIntro()". Note: in the case where all_lyrics and all_music are both present, it is important to only apply the function to all_music as shown above.
If implemented, feel free to alter the comments at the top or the function name for clarity if necessary. Fundgy (talk) 14:21, 11 May 2025 (UTC)