Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 14 additions & 20 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,33 +272,27 @@ jobs:
exit 1
fi

# The two ends of the sequence get one link rather than two, which the old shape could not
# spell: a lone argument was the next step, so the last page had no way to say it had none.
#
# Matched on the div rather than the class name. TemplateStyles inlines prevnext/styles.css
# into every page that has a row, so both class names appear in the page's own stylesheet
# whether or not either link was rendered -- which is what the first draft of this check
# tripped over.
if grep -q 'class="wikven-prevnext-prev"' dist/Why_wikitext.html; then
echo "::error::Why wikitext heads the sequence and should have no previous link"
exit 1
fi
if grep -q 'class="wikven-prevnext-next"' dist/Licenses.html; then
echo "::error::Licenses ends the sequence and should have no next link"
exit 1
fi

# A prevnext link is labelled with the target page's own title, so on a translated page it
# must carry the translated one. The label is not in the calling page's source: the call
# sits outside the translate tags and passes a page name, and the template reads the
# title from the target's own title unit, which is the whole point -- a label restated in
# the caller would be a second copy of a string that is already translated once.
# Searching/ko is the fixture, and the expectation is read from the source rather than
# written here: any Korean at all would pass a string pinned in this file.
# written here: any Korean at all would pass a string pinned in this file. Which page
# follows Searching is read from the sidebar for the same reason the row itself is --
# naming it here would make this a check of a particular order rather than of the label.
following=$(sed -n 's@^\*\* *Special:MyLanguage/\([^|]*\).*@\1@p' 'docs/MediaWiki:Sidebar.wikitext' \
| awk '/^Searching$/ { if ((getline) > 0) print; exit }')
# Checked before the file is read: awk on docs//ko.wikitext would abort the step with its
# own error, which says nothing about the sidebar being what went wrong.
if [ -z "$following" ]; then
echo "::error::MediaWiki:Sidebar names no page after Searching, so this check has no pair to make"
exit 1
fi
want=$(awk '/^<!--T:title[ -]/ { found = 1; next } found && NF { print; exit }' \
docs/Translating/ko.wikitext)
"docs/$following/ko.wikitext")
if [ -z "$want" ]; then
echo "::error::docs/Translating/ko.wikitext has no translated title to expect"
echo "::error::docs/$following/ko.wikitext has no translated title to expect"
exit 1
fi
# Newlines are flattened before the block is read: the template writes its markup over
Expand All @@ -310,7 +304,7 @@ jobs:
case "$shown" in
*"$want"*) ;;
*)
echo "::error::Searching/ko's prevnext does not show Translating's Korean title ($want)"
echo "::error::Searching/ko's prevnext does not show $following's Korean title ($want)"
echo "$shown"
exit 1
;;
Expand Down
8 changes: 4 additions & 4 deletions docs/MediaWiki:Sidebar.wikitext
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
offers its own Home besides -- fillMinervaMenu.php drops an entry leading there for that
reason, so this section only ever reached the two skins that show the logo anyway. -->
* sidebar-docs
** Special:MyLanguage/Why wikitext|sidebar-why-wikitext
** Special:MyLanguage/Installation|sidebar-installation
** Special:MyLanguage/Getting Started|sidebar-getting-started
** Special:MyLanguage/Pages|sidebar-pages
** Special:MyLanguage/Editing sidebar|sidebar-editing-sidebar
** Special:MyLanguage/Images|sidebar-images
** Special:MyLanguage/Skins|sidebar-skins
** Special:MyLanguage/Searching|sidebar-searching
** Special:MyLanguage/Extensions|sidebar-extensions
** Special:MyLanguage/Lua modules|sidebar-lua-modules
** Special:MyLanguage/JavaScript|sidebar-javascript
** Special:MyLanguage/Searching|sidebar-searching
** Special:MyLanguage/Translating|sidebar-translating
** Special:MyLanguage/Editing sidebar|sidebar-editing-sidebar
** Special:MyLanguage/Deploying|sidebar-deploying
** Special:MyLanguage/Troubleshooting|sidebar-troubleshooting
* sidebar-references
** Special:MyLanguage/Limitations|sidebar-limitations
** Special:MyLanguage/Why wikitext|sidebar-why-wikitext
** Special:MyLanguage/Configuration|sidebar-configuration
** Special:MyLanguage/Standalone binary|sidebar-standalone-binary
** Special:MyLanguage/Commands|sidebar-commands
** Special:MyLanguage/Development|sidebar-development
** Special:MyLanguage/Writing an extension|sidebar-writing-an-extension
** Special:MyLanguage/Development|sidebar-development
** Special:MyLanguage/Licenses|sidebar-licenses
Loading