Steps to Reproduce:
Take any SVG file with the first <switch> tag appearing after $wgSVGMetadataCutoff (256kB).
Actual Results:
no translations dropdown to choose
Expected Results:
translations dropdown to choose
Steps to Reproduce:
Take any SVG file with the first <switch> tag appearing after $wgSVGMetadataCutoff (256kB).
Actual Results:
no translations dropdown to choose
Expected Results:
translations dropdown to choose
Due to performance reasons it might be the expected result to not check large SVGs till the end for <switch-tags.
Two proposals: increase the number of bytes read or shift multilingual testing to upload time (when the file is read anyway).
In T40010, Ponor looked at 30 SVG files and stated the mean file size was 700 kB. JoKalliauer stated that only about 500 SVG files are being uploaded every day. Johannes also says that SVGs are 2.8 percent of uploads.
SVG illustrations will be placing text on top of a drawing, so most text elements will be at the end of the file.
At one point, SVG uploads were limited to 10 MB. I do not know if that limit is still in effect.
I do not know how long it takes for MW to parse an XML file.
When I've run into this problem, I've used two workarounds.
One is to add a hidden switch near the top of the file:
<switch visibility="hidden"> <text systemLanguage="en">English</text> <text systemLanguage="de">Deutsch</text> <text>English</text> </switch>
The second is to add a similar switch to the defs element:
<defs> <g id="legend"> <switch> <text systemLanguage="en">English</text> <text systemLanguage="de">Deutsch</text> <text>English</text> </switch> </g> </defs>
SVG Translate offers to translate the text, and the users if the users add a translation, then it will show up on the File page.
SVG Translate could always add such an element near the front of the file. A trick would be to set the id to an SVG Translate GUID. Then SVG translate could always add the language without offering it to the user.