Skip to content

Conversation

@DiFronzo
Copy link
Member

@DiFronzo DiFronzo commented May 21, 2025

Description

This PR fixes a bug that caused red interlanguage links to appear for other Wikipedia language versions.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore
  • ⏩ Revert

Related Tickets & Documents

Fixes #65

Tested?

Added to documentation?

  • 📜 README.md
  • 📖 own file under the docs folder
  • 🙅 no documentation needed

[optional] Are there any pre- or post-deployment tasks we need to perform?

Needs to run make all for the bot.

@DiFronzo DiFronzo requested a review from Copilot May 21, 2025 12:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where red interlanguage links were incorrectly shown by enhancing the description logic for UserContribution templates.

  • Added logic to check if a template’s language code differs from the revision article’s language, and conditionally append it.
  • Updated the description format in templateremoval.py to include the language code when relevant.

- Updated POT-Creation-Date in locale files for fi_FI, gl_ES, nb_NO.
- Adjusted line numbers for various messages in localization files to reflect code changes.
- Corrected translations for several messages in Finnish, Galician, and Norwegian Bokmål.
- Fixed the template removal rule to correctly handle language codes in the description.
@DiFronzo DiFronzo marked this pull request as ready for review May 21, 2025 21:15
@jhsoby
Copy link
Member

jhsoby commented May 28, 2025

Thanks for this! I would prefer to base it on the changes in #55 though, because that one does things a bit differently – including removing the {{mal}} or {{tl}} template altogether (to improve scalability and reduce the need to add config for this; the template works differently in different languages, and the ability to add a language code is specific to the Norwegian versions of the template). Does that make sense?

@DiFronzo
Copy link
Member Author

Thanks for this! I would prefer to base it on the changes in #55 though, because that one does things a bit differently – including removing the {{mal}} or {{tl}} template altogether (to improve scalability and reduce the need to add config for this; the template works differently in different languages, and the ability to add a language code is specific to the Norwegian versions of the template). Does that make sense?

That should not be a problem. I will look into this issue again when #55 is merged.

#, python-format
msgid "removal of {{tl|%(template)s}}"
msgstr "{{tx|%(template)s}} txantiloia kentzea"
msgid "removal of {{tl|%(template)s%(lang)s}}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't be correct without a |. Also, unfortunately, the {{tl}} template works differently in different languages – the feature of linking to other languages seems to be Norwegian-specific. I think it's better to use [[Template:%(template)s]].

(This goes for all uses of {{tl}}, of course, not just this specific one.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duh, never mind the first part – %(lang)s includes the |.

DiFronzo and others added 2 commits November 21, 2025 19:55
Co-authored-by: Jon Harald Søby <jhsoby@gmail.com>
Co-authored-by: Jon Harald Søby <jhsoby@gmail.com>
@DiFronzo DiFronzo requested a review from jhsoby November 21, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Links to templates on other Wiki projects is red

3 participants