AprilSylph / XKit-Rewritten

🧰 The enhancement suite for Tumblr's new web interface
GNU General Public License v3.0
274 stars 44 forks source link

AccessKit Visible Alt Text: Fix "imagen" appearing in Spanish #1424

Closed marcustyphoon closed 2 months ago

marcustyphoon commented 3 months ago

Description

Fun fact: At time of posting, the default alt text of an image added to the editor when the UI language is set to Spanish is lowercase. window.tumblr.languageData doesn't have this variation, as the same key ("Image") corresponds to both case variations ("Imagen" / "imagen") and of course a javascript key-value object can only have one of them.

This means that the "only show image descriptions" alt text mode doesn't work in Spanish (and in general that we're relying on whoever does Tumblr's translations not to put different values in any case where multiple values correspond to a single key). This PR fixes this in the case of visible alt text and specifically cases differing.

Testing steps