Page MenuHomePhabricator

Image preview is not updating when translations are changed
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
Feb 23 2024, 1:46 AM
Referenced Files
F42654583: T358305_SVG Error.webm
Mar 15 2024, 9:36 PM
F42630503: T358305_SVG_EnglishError.webm
Mar 14 2024, 11:39 PM
F42630707: 2024-03-14_16-30-48.png
Mar 14 2024, 11:39 PM
F42630738: 2024-03-14_16-26-25.png
Mar 14 2024, 11:39 PM
F42630590: 2024-03-14_16-24-33.png
Mar 14 2024, 11:39 PM
F42630492: 2024-03-14_13-44-08.png
Mar 14 2024, 11:39 PM
F42630483: 2024-03-14_12-45-37.png
Mar 14 2024, 11:39 PM
F42630458: T358305_SVG_Languages.webm
Mar 14 2024, 11:39 PM


@Manlleus on Commons reports an issue:

Since some weeks I've experienced that the preview image next to the text boxes is unable to take the new text and renew the image, not an issue for me as I typically use the upper "download" button so I can check the image for errors or corrections instantly before finally upload the file. Maybe the preview feature comes from a different source of the rest of SVG Translate sets. Maybe is only me, I don't know.

It looks like it is perhaps not working depending on what interface language is selected and what target language, and the order in which these are set.

QA Results - SVG Translator PROD

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Although I'm not 100% sure of the scenarios in which this bug is happening, it seems to be because of a difference in the environment variables are considered: LANGUAGE, LC_ALL, LC_MESSAGES, and LANG are all used, but we were only setting the last when calling rsvg-convert. Instead of this, it seems more robust and correct to use the --accept-language option.

PR that changes to this is ready for review:

Note that Beta Commons is apparently down (T357809), so I don't think this can be QA'd using

@Samwilson I'm not sure how I can test this since Beta Common images are down as seen in T357809: [beta-commons] Images are not displayed - 500 error

Status: ❓NMI
Environment: Beta Commons
OS: macOS Sonoma 14.2.1
Browser: Chrome 122
Skins. n/a
Device: MBA M2
Emulated Device:: n/a
Test Links:


Beta Commons down

2024-02-28_12-29-13.png (781×2 px, 122 KB)
2024-02-28_11-40-27.png (1×3 px, 373 KB)

I've deployed the above change in 1.2.5, and it's throwing the following error:

The command "rsvg-convert "$SVG" --accept-language=en-ca > "$PNG"" failed. Exit Code: 1(General error) Working directory: /data/project/svgtranslate/tool/public Output: ================ Error Output: ================ Unknown option --accept-language=en-ca

So that's no good! I've rolled back to 1.2.4, and will fix things.

The new --accept-language option was added in rsvg-convert 2.52.0, but the php7.4 image on Toolforge has version 2.50.3. The php8.2 image on the other hand has 2.54.7 so I think if I carry on with T357844 we can upgrade everything at once and things will work.

The PHP upgrade is done now, and the preview issue should be fixed now.

QA notes: there are various combinations of being logged in or not, and interface language matching (or not) the target language for SVG translations — it might be worth checking these interactions. Thanks!

@Samwilson Logged in and out have the same results except for uploading of course. I did come across a couple of potential issues if you don't mind checking below, thanks!

Status: ❓Pending Potential Issues
Environment: SVG Tool-PROD
OS: macOS Sonoma 14.4
Browser: Chrome 122, Firefox 123, Safari 17.3
Skins. n/a
Device: MBA M2
Emulated Device:: n/a
Test Links:


Language MatchLog Out-ChromeLog InRTL-HeFireFox
2024-03-14_12-45-37.png (1×3 px, 329 KB)
2024-03-14_13-44-08.png (1×3 px, 372 KB)
2024-03-14_16-24-33.png (1×3 px, 410 KB)
2024-03-14_16-26-25.png (1×1 px, 392 KB)

❓Potential Issue- When switching to English, Serbian language pops up as seen in the video

Safari Issue- Error just pops up randomly after 15 seconds after selecting a language and typing

2024-03-14_16-30-48.png (1×3 px, 541 KB)

When selecting English, it populates Serbian as seen in the video on

❓Potential Issue- When switching to English, Serbian language pops up as seen in the video

That looks like an issue with specifically File:100_Years_War_France_1435-sr.svg which contains Serbian marked as English, e.g.:

<text sodipodi:linespacing="100%" id="Océan Atlantique-en" y="534.43744" x="124.28795" xml:space="preserve" systemLanguage="en">
    <tspan y="534.43744" x="124.28795" sodipodi:role="line" id="tspan14681-en">АТЛАНТСКИ</tspan>
    <tspan id="tspan4885-en" y="570.43744" x="124.28795" sodipodi:role="line">ОКЕАН</tspan>

I've uploaded a new version of that file with systemlanguage="en" replaced with systemlanguage="sr" (although thanks to T250012 it's still showing the error on the tool).

Safari Issue- Error just pops up randomly after 15 seconds after selecting a language and typing

This may have just been an intermittent thing. Does it happen every time you select a new target language in Safari?

@Samwilson Yeah I tried it again and got the error as seen in the video but I can't repeat it now. It's weird.

I think that language-switch bug is separate from this, so we can move this along — and if you see that bug again or figure out how to repeat it could you please open a new task? Thanks!