Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localize image insert wikitext #4849

Merged
merged 16 commits into from
May 14, 2024
Merged

Localize image insert wikitext #4849

merged 16 commits into from
May 14, 2024

Conversation

tonisevener
Copy link
Collaborator

@tonisevener tonisevener commented May 8, 2024

Phabricator: https://phabricator.wikimedia.org/T364408

Notes

This PR adds in the magic words logic (related spike) into our image insert flow. This change is applied in both image recommendations and the editor. It also removes some incorrect parameters.

Similar to what we were already doing with namespace names, I am bundling these magic words into the project. To do this I updated the Update Languages script to fetch from the siteinfo API and added the json files into the wikipedia-magicwords directory.

Test Steps

The easiest way to test this is through the editor, without publishing.

Stripping default size:

  1. Go to editor on EN Wikipedia.
  2. Tap insert image button
  3. Tap image, leave advanced settings as default, and tap through to insert image.
  4. Confirm wikitext inserted into editor does not contain size.

Stripping "basic"

  1. Go to editor on EN Wikipedia.
  2. Tap insert image button
  3. Tap image, go to advanced settings and select "basic", and tap through to insert image.
  4. Confirm wikitext inserted into editor does not contain word "basic".

Localizing wikitext to use magic words

  1. Go to editor on DE Wikipedia.
  2. Tap insert image button
  3. Tap image, leave advanced settings as default, add alt text and caption, and tap through to insert image.
  4. Confirm wikitext inserted into editor uses localized template parameters and namespace:

[[Datei:Biblioteca Nacional - Busto de German Arciniegas.jpg | mini | rechts | alternativtext=Alt Text | Caption]]

Copy link
Collaborator

@mazevedofs mazevedofs left a comment

Choose a reason for hiding this comment

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

Looking good!

@mazevedofs mazevedofs merged commit 6296486 into main May 14, 2024
4 checks passed
@mazevedofs mazevedofs deleted the T364408 branch May 14, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants