Skip to content

Conversation

@aplaice
Copy link
Collaborator

@aplaice aplaice commented Oct 23, 2025

It's rudimentary and doesn't do anything beyond updating the flags — it doesn't carry out any actual comparisons and it doesn't prepare a log of changes from the Wikimedia page. IMO the former (comparison) wouldn't actually be useful, since the user can easily use whatever tool they prefer, but the latter (either preparing a digest or maybe just opening the relevant Wikimedia description page in a browser), might. OTOH I'm not sure what's the best way to do the latter, especially when there are many changed flags, so I'm leaving this for now.

The script might end up needing tweaks once I go through the ton of flags apparently needing updates, in case there are any ways to avoid false positives. Some are not easily unavoidable, likely caused by changes to svgo (e.g. the flag of Abkhazia now has the semantically-equivalent 27.97 114 instead of 27.97L114 in one place, almost certainly due to svgo (the current version on Wikimedia has L, there, so it's not due to tweaks on Wikimedia)).

As discussed in the linked issue, it might turn out necessary to pin the svgo version (installing it with npm/yarn etc.), but this won't help much for the now since different svgo versions might have been used for different files, in the past. (I'm also hesitant adding another package manager to our repo, (contributors having to install both python/pipenv and nodejs) though if it's only for this one use-case maybe it's not a major problem.) OTOH if we don't resolve this now (switching to a single svgo version) it'll continue to annoy us in the future, especially if we want an automated/semi-automated workflow. OTOTOH I think we're currently in the exploratory phase (whether the script is actually useful at all), so overcomplicating is probably unwise.

Fix #706.


Edit: Running the script in full, now that its design has been finalised (especially regarding rounding of widths) — I didn't want to hammer Wikimedia unnecessarily — it appears that there are 210 flags to update 😱, and looking at the first several it appears that most are legit (at least to the extent that upstream (Wikimedia) has indeed changed (in one case (Australia) I have doubts about the soundness of the changes)); one (Abkhazia) is due to svgo and one (Argentina) is due to previous minor conversion issues.

This makes scripting slightly simpler.
It's rudimentary and doesn't do anything beyond updating the flags —
it doesn't carry out any actual comparisons and it doesn't prepare a
log of changes on the Wikimedia page.  IMO the former (comparison)
wouldn't actually be useful, since the user can easily use whatever
tool they prefer, but the latter (either preparing a digest or maybe
just opening the relevant Wikimedia description page), might.

Fix anki-geo#706.
@axelboc
Copy link
Collaborator

axelboc commented Oct 23, 2025

Feel free to go wild with this, I think it's going to be hugely beneficial 💯 — looking forward to seeing all the flag changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Create a script for checking for updates to flags on Wikimedia

2 participants