Commons talk:Translation possible/Learn more

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Location[edit]

This content page is int he template namespace. Shouldn't it be moved to the Commons namespace? Siebrand 10:43, 27 February 2007 (UTC)[reply]

It is a sub-page of the template itself and therefor, I guess it is fine here. Enricopedia 17:47, 27 February 2007 (UTC)[reply]

Online[edit]

Is there any free online tool to edit SVG files ?. --77.210.147.109 14:48, 18 November 2007 (UTC)[reply]

For translations you can use SVG Translate. // Liftarn
The tool isn't available. Does anyone know of an alternative? Tropcho (talk) 15:35, 24 July 2014 (UTC)[reply]

Template for already translated files?[edit]

There should be a template so that already existing, translated images are shown and that no one tries to duplicate effort just because he/she didn't know that a translation was already done. — Preceding unsigned comment added by 79.213.23.155 (talk • contribs) 20:31, 9 December 2007‎ (UTC)[reply]

Lang template[edit]

Hey! The /lang template in the top of the page is wrong, as it refers to the different versions of the template, not the help page. Please, look at it, as I hve not been able to change it. --SMP (talk page) 16:59, 1 September 2008 (UTC)[reply]

I second this request. Gerbilo :< 19:23, 9 September 2008 (UTC)

How to move the text with this[edit]

I had uploaded File:Punjab map pa.svg‎, which was a modification of File:Punjab map.svg‎, I used the tool provided with this template on the image. So how do I move the text a little. For example I translated Chandigarh to ਚੰਡੀਗੜ੍ਹ. on File:Punjab map.svg‎ Chandigarh shows up in correct place, however, on File:Punjab map pa.svg‎ it is way off from the city target. So how do I fix that? thank You. --Gman124 (talk) 14:27, 31 March 2009 (UTC)[reply]

In most programs you can drag text. Consult your programs manual for details. --Nux (talk··dyskusja) 11:57, 11 April 2009 (UTC)[reply]
Ok, I just changed it through the source, from the wordpad. --Gman124 (talk) 23:31, 12 April 2009 (UTC)[reply]

Watch out for font sizes ![edit]

It turns out that something in Commons interprets the svg files, and in particular the texts, with a limited number of fonts. So if you translate a text which is closely encircled by larger words or sentences, and try to solve the problem by using another font, you may run up to some troubles. For example, if you try to solve the problem by using "Arial narrow" in place of "Arial", you will get into trouble, because Commons does not make any difference between these fonts, and will write your text in "Arial", that will be likely to go onto the picture, or other texts, or be clipped out of the border. So use the most common fonts ! Example : see file history of file:Phylogentic_tree_FOXP2_01-fr.svg, which I couldn't fix before several tries.

Trassiorf (talk) 13:54, 6 February 2012 (UTC)[reply]

Do we need an example of <switch /> usage?[edit]

    <switch>
       <text systemLanguage="de">Alterspyramide von Russland (2010)</text>
       <text>Population pyramid of Russia (2010)</text>
       <text systemLanguage="ru">Половозрастная диаграмма России (2010)</text>
    </switch>

I made this one for myself. Ain92 (talk) 12:25, 13 November 2014 (UTC)[reply]

We have a complete example with source code in the file description page as File:systemLanguage.svg which is also linked from the front page. Do you think this is not sufficient? --Patrick87 (talk) 20:45, 13 November 2014 (UTC)[reply]

Should there not be a warning in the text about likely differences in length of translated text?[edit]

I think there should be a warning about that when the automated tool is used or a text editor is used then very frequently the translated text in the new language may occupy bigger or smaller space and therefore not fit in the image like in the original language. Usually this results in having to change the size of the font. Another alternative might imply using a different font. In addition, in both cases this may result in having to do the same changes to similar texts elsewhere in the image. Using a different font requires careful consideration of the rendering of the fonts in mediawiki and in particular looking at the set of fonts suitable (I do not have the link to the library of fonts although I know it is there somewhere. So all in all, i think it might be helpful to change the words

"This SVG file uses embedded text that can be easily translated into your language" by something like: "This SVG file uses embedded text that can be easily translated into other languages. Depending on the similarity of the languages the translated text may occupy different space in the image and therefore affect the resulting image significantly." Regards--Basquetteur (talk) 06:42, 27 March 2015 (UTC)[reply]

You're completely right but
  • Detailed information does not belong into the template. That's exactly what we have this help page for. If you thin kanything is missing from it feel free to expand it accordingly!
  • There is no real solution to the problem, at least with the automated tool. How should someone make use of the information that the resulting image "may be significantly affected" when he/she does not have a possibility to do something about it?
  • Because there is no easy solution, the creator of the SVG has already to bear the problem in mind when designing the graphics. If he/she includes enough space around labels and aligns the text correctly, mistakes during automated translation are much more unlikely.
Patrick87 (talk) 10:25, 27 March 2015 (UTC)[reply]

category of mulltilanguage svg[edit]

Hi. Is there a category for multilanguage ( switch ) svg files ? TIA --Adam majewski (talk) 14:04, 12 July 2015 (UTC)[reply]

Just add the template {{translate|switch=yes}} and it will automatically be categorized into Category:Translation possible - SVG (switch) --Patrick87 (talk) 16:19, 12 July 2015 (UTC)[reply]

Update for project page[edit]

Please update project page as SVG Translate, for example, does not function, and more importantly – it is waaaay complicated for understand (even for someone who edited Wikipedia more than two or three years). I tried to figure out what it says and needed several hours to translate my first .svg file. It should state very simply something like this:

  1. 1st method (files with {{Translation possible}} template and are .svg):
  • Save file as .svg (e.g. for Chrome: Right-click on the file → Save link as → Save). Open saved file in the Notepad or other text editor, and copy the text/code (as it is not possible to edit it directly). Paste it into the Wiki editor and using Ctrl+F search for "systemLanguage"; add translations for your language following other examples and copy-pasting. Paste edited code back to Notepad, save it with ".htm" at the end of the file. Upload it back. Don't mess with others' translations.
  1. 2nd method (files with no {{Translation possible}} template but are .svg):
  • Save file as .svg (e.g. for Chrome: Right-click on the file → Save link as → Save). Open saved file in the installed Inkscape or other .svg editor. Play with the editor to figure out how to edit text (i.e. go to Edit → XML Editor or use Shift+Ctrl+X shortcut); select text to get it highlighted in XML Editor i.e. find it by expanding small squares with + inside; edit text, save the file (don't close Inkscape). Upload it with different name, check results, and fix errors if present.

These are very direct and simple-to-follow instructions that can be written in a better and more correct way, but translation of .svg file still takes a LOT of time. It should get simplified in the future...

PS It should be written somewhere that you have to add |lang=language code when trying to display image in an article on Wikipedias in different languages (e.g. [[File:Example.svg|lang=de]]); otherwise it will display English or "base" version as defined in .htm document. Wikipedia editors should not know HTML in order to edit Wikipedia, and this translation is very useful but a bit complicated and time-consuming process. --Obsuser (talk) 02:41, 21 May 2016 (UTC)[reply]

Hyphenated language codes not working[edit]

Using preferred lang=sr-EC -- displays in English
Using lowercase lang=sr-ec -- displays in Serbian
Using lowercase lang=sr-el -- displays in Cyrl rather than Latn!

I noticed that "sr-EC", "sr-EL", "zh-Hans" etc. are not working properly. Please check File:First Ionization Energy.svg or File:Electron affinity of the elements.svg, for example. --Obsuser (talk) 03:41, 21 May 2016 (UTC)[reply]

This used to work, but something changed to make it fail. My guess is rsvg.
I struggled with this issue back in December, found the problem, but did not come to a resolution. The problem is upper/lower case matching in the IETF language tags.
The preferred capitalization of the IETF language is "zh-Hans" (not "zh-hans") and sr-EC (not "sr-ec"). The files use the preferred language tags in their SVG switch statements. The Commons file page uses the preferred language tags in its interface.
Consider File:First Ionization Energy.svg. Go to its page, and it presents a dropdown list of languages with the preferred language tags.
Now select Simplified Chinese and "Go" or Serbian-EC and "Go" to reload the page with the figure in that language. The resulting page URLs use preferred capitalization and are:
Notice the "lang=zh-Hans" and "lang=sr-EC" arguments. The language tags are the preferred capitalization, but the pages display the figure in English.
If you edit the URLs to lowercase the "zh-Hans" or "sr-EC" you get:
Those URLs display the figure in Chinese or Serbian.
My guess is that rsvg downcases the IETF tags in the file and then compares them to the lang= argument. If the lang= argument has any uppercase characters, then the langs do not match and rsvg displays the default (e.g., English). The application should also downcase the lang= argument or use as case-insensitive comparison.
IETF language matching should ignore case. RFC 4647 (page 3): "Language tags and thus language ranges are to be treated as case-insensitive: there exist conventions for the capitalization of some of the subtags, but these MUST NOT be taken to carry meaning."
The workaround is to use an all lowercase language tag when the file is included.
Glrx (talk) 14:37, 28 May 2016 (UTC)[reply]
Thank you. Why is "sr-el" not working?
(It displays either "sr" or "sr-ec" as they are actually same for First Ionization Energy.svg ["sr" and "sr-ec" are same if "sr" is Cyrillic; if "sr" is Latin, then "sr" = "sr-el"].) --Obsuser (talk) 19:15, 10 June 2016 (UTC)[reply]
Someone? --Obsuser (talk) 21:34, 11 August 2016 (UTC)[reply]
@Obsuser:
This is an order-dependent language-tag matching issue.It is a bug in RSVG; RSVG essentially just matches the first two characters; it notices that "sr-EL" does not match "sr", so it tries matching the first two characters, finds a match, and delivers Cyrillic. In File:First Ionization Energy.svg, the switch statement currently looks like
<switch> ...
          <text systemLanguage="sr">Алкални метал</text>
          <text systemLanguage="sr-EC">Алкални метал</text>
          <text systemLanguage="sr-EL">Alkalni metal</text>
  ... </switch>
Under the language matching rules, the first line's systemLanguage="sr" will match an input tag of "sr". Consequently, lines 2 and 3 never get a chance to match. The matching rules are complicated and do not default well. See Help:Translation tutorial#Using the same file. The lines could be reordered as (but the reordering won't help)
<switch> ...
          <text systemLanguage="sr-EC">Алкални метал</text>
          <text systemLanguage="sr-EL">Alkalni metal</text>
          <text systemLanguage="sr">Алкални метал</text>
  ... </switch>
The proper SVG matching rules should give the following results.
an input language tag of "sr-EC" would match the first line.
an input language tag of "sr-EL" would match the second line.
an input language tag of "sr" would match the the FIRST LINE ("sr-EC" matches "sr" by dropping "-EC").
an input language tag of "sr-SR" would match no line.
an input language tag of "sr-ME" would match no line.
an input language tag of "sr-Cyrl" would match no line.
an input language tag of "sr-Latn" would match no line.
Sadly, RSVG's matching algorithm does not follow the rules; in many cases, it will just match the first two characters.
Glrx (talk) 17:08, 21 August 2016 (UTC) Modified by Glrx (talk) 05:05, 2 January 2017 (UTC)[reply]
Yeah, rSVG handles hyphens in language codes incorrectly and in violation of the spec. We've known about this for a while but we haven't really been able to do anything about it as we have minimal influence over rsvg development. See also phab:T125710. Bawolff (talk) 04:01, 21 October 2016 (UTC)[reply]
Thanks. Glrx (talk) 15:34, 21 October 2016 (UTC)[reply]
Examples

Using lang=en
Using lang=en-BZ, displays first!
Using lang=en-bz, displays first!
Using lang=it, displays default.
Things are more messed up than I thought. Added sr-el to lang selection at top. Looks like value= should be modified and some note about using lowercase only langtags. Glrx (talk) 16:47, 21 October 2016 (UTC)[reply]

Tool seems to have a bug[edit]

When I call https://tools.wmflabs.org/svgtranslate/?svg=100+Years+War+France+1435.svg I get:

testing 100 Years War France 1435.svg on https://commons.wikimedia.org/w/api.php Fatal error: Call to protected method Intuition::getLangNames() from context 'SVGtranslate' in /data/project/svgtranslate/public_html/svgtranslate.php on line 395 Call Stack: 0.0050 669712 1. {main}() /data/project/svgtranslate/public_html/index.php:0 0.1761 3363960 2. SVGtranslate->do_step() /data/project/svgtranslate/public_html/index.php:57 0.1761 3364096 3. SVGtranslate->generate_second_form() /data/project/svgtranslate/public_html/svgtranslate.php:781

--MartinThoma (talk) 05:50, 28 May 2016 (UTC)[reply]

happens to me too. --Mikey641 (talk) 11:35, 3 July 2016 (UTC)[reply]
Why doesn't it work for me??--Mikey641 (talk) 19:46, 20 July 2016 (UTC)[reply]

Wrong precedence[edit]

If as well an English text as a default text are defined in the file, it should display English only when specified.
In Wikimedia Commons, the file shown on the description page should not display the English text - with no language specified it should instead display the default.
Diagrams with several languages may also contain a numbered version; if it is the "default language" it should be displayed by default. sarang사랑 09:00, 30 October 2016 (UTC)[reply]

I don't know what to say.
I think the appropriate default would be the user's language preference. Give SVG 2.0 a chance to work.
By default, WM uses lang="en" for SVG everywhere (even on zh.WP). There is a claim that the SVG default lang used for [[file:...]] will match the WP's language eventually, but I don't know of any timeline.
A more direct route might just serve the SVG file directly rather than the PNG generated by rsvg.
I think displaying the default would be the wrong semantics.
There are much more serious problems with the display of switch-translated SVG on WM. Right now, I'd be ecstatic if things worked like they did when switch-translated SVG was first offered.
Glrx (talk) 17:47, 30 October 2016 (UTC)[reply]

SVG Translate Community wishlist survey project[edit]

Hello all. The Community Tech team in the Wikimedia Foundation is beginning to start their work on the SVG Translate project that was proposed in the 2017 Wishlist survey. If you are interested in being involved in the project, you can watch the project page and join in the discussions on the talk page. If you’d be interested in getting periodic notifications about the project and our team's work, you can also choose to subscribe to our team newsletter. Looking forward to hearing your thoughts and learning from your experiences. Thank you. -- NKohli (WMF) (talk) 22:42, 15 August 2018 (UTC)[reply]

Mockups posted[edit]

Hello again. We have posted a few mockups for the new tool on the project page. You can also see them below:

We're collecting feedback on the proposed solution and the mockups on the talk page. Your feedback will be helpful. Thanks. -- NKohli (WMF) (talk) 23:42, 24 August 2018 (UTC)[reply]

No need to discourage[edit]

I changed

Multilingual SVG files have drawbacks. Most graphics editors probably do not support multilingual files, and those editors that support them may be awkward to use. That means once a file has switch elements added, it may be difficult for other editors to improve the graphics elements. Consequently, multilingual SVG files are feasible for simple SVG files that were created with a text editor or for images that are stable and unlikely to have significant graphics changes. Consequently, some judgment is needed when changing a monolingual file to a multilingual file.

to:

"However, not all graphics editors can edit all the text contained in the switch element, so a text editor would need to be used instead."

because I don't see any reason to discourage the practice, since anyone can edit them with a combination of free graphics editors and text editors. Mikael Häggström (talk) 13:47, 7 February 2020 (UTC)[reply]

And when translated, how to used it?[edit]

I have translated and uploaded File:Biological classification L Pengo vflip.svg the Spanish version.

How can I use it in Spanish in Spanish Wikipedia?. I think a Help here is necessary and urgent about this functions and question.

Also in the link: "Use this file" appears no information. And the file name is the same for the version in English than in Spanish (perhaps File talk:Biological classification L Pengo vflip/es.svg as parameter to see the version in Spanish (really, the file would be the same, only automatically used the Spanish ad Go button)?.

In the help page is said:

w:user:cmglee/extract_lang.py has a Python3 script to extract and write a monolingual SVG file from a multilingual SVG file, to let a language version be previewed in a Web browser during its development. The alternative way to view a non-default language in a multilingual SVG in a Web browser is to install and change the language of the browser and restart it.

To be usefull, there would be a complementary template, module or CSS to say: this image in the Spanish Wikipedia is going to be show in Spanish in this page (or in all Spanish Wikipedia, excepting other thing could be said; for example, it could be in English in Spanish Wiktionary when talking about an entry of an English noun; or in Spanish Wikipedia for historical, cultural, documental reasons --> to show a history poster, but the editor could select the own user can translate using a small button in the caption [Spanish], or try in [Spanish]] or put this image twice, in the original language and translated in Spanish, for any encyclopedic interest. BoldLuis (talk) 08:50, 20 May 2020 (UTC)[reply]

You just insert the file File:Biological classification L Pengo vflip.svg into an article on the es.WP. When the MediaWiki software builds the page again, it will notice that the SVG file has a Spanish translation, so it will automatically select the Spanish translation. You do not add an "es" to the file name.
The automatic selection is a feature. Say an English language only SVG file is used in ten different articles on the Spanish Wikipedia. If a Spanish translation is later added to the SVG file, then all ten articles will eventually use the Spanish translation. It may take a few days for the Spanish WP to rebuild a page, but it will happen eventually. Glrx (talk) 23:51, 20 May 2020 (UTC)[reply]

Page title[edit]

This page started at Template:Translation possible/Learn more, but was moved to Commons:Translation possible/Learn more in 2008. As it is no longer actually a subpage, the title doesn't really make sense. I'd like to migrate this page from manual translation to the translate extension, but it's better to get the title nailed down first. Would Commons:Translation possible or Commons:How to translate an SVG file make more sense as a new title? I'm leaning toward the second as we could get rid of the level 1 heading. Something like Commons:SVG translation might work too. This page might also belong in the Help namespace. AntiCompositeNumber (talk) 20:37, 13 July 2021 (UTC)[reply]

How to upload translated image to a new wiki?[edit]

Hi! Please could you write an explanation how could I place a translated image to a new wiki? For example, I had tried to translate image [1] into Ukrainian, using https://svgtranslate.toolforge.org/File:Pcm-ru.svg, but instead of creating a new file, it created a new version of initial file which was inapropriate. How to solve this? A1 (talk) 08:59, 24 April 2023 (UTC)[reply]

Doesn't work for me[edit]

Hi. I tried this, added a couple of switch statements into File:Moscow metro map multilingual future draft.svg, but it does not work. What do I do wrong? Thank you. IKhitron (talk) 12:04, 21 May 2023 (UTC)[reply]

I found your two switch elements:
	<g id="river_name_group" class="rn st">
		<switch id="Moskva_river_name">
			<text systemLanguage="en" transform="translate(1120,1147)rotate(45)">Москва-река en</text>
			<text transform="translate(1120,1147)rotate(45)">Москва-река ru</text>
		</switch>
		<g id="river_name_group_small">
			<switch id="Moskva_canal_name" class="small">
				<text systemLanguage="en" transform="translate(304,40)rotate(90)">Канал имени Москвы en</text>
				<text transform="translate(304,40)rotate(90)">Канал имени Москвы ru</text>
			</switch>
			<text id="Yauza_river_name" transform="translate(915,193)rotate(40)">река Яуза</text>
		</g>
	</g>
They are correct.
Asking for a large thumbnail in English serves the default URL:
That displays the Russian default rather than the expected English.
Forcing language to en:
That displays English.
I made a bug report at Phab:T337199.
Glrx (talk) 14:50, 21 May 2023 (UTC)[reply]
I see. Thank you. So, after you create smaller example, I believe I can change my file to have explicite languages and no defaults, and it should work? IKhitron (talk) 14:56, 21 May 2023 (UTC)[reply]
@IKhitron:
No. SVG switch elements should always have a default. That is the language that displays when there are no matches.
When the bug is fixed, your version with Russian as the default will work.
Good practice would have an explicit Russian clause as well as a default:
  • 		<switch id="Moskva_river_name" transform="translate(1120,1147) rotate(45)">
    			<text systemLanguage="en">Moscow River</text>
    			<text systemLanguage="ru">Москва-река</text>
    			<text>Москва-река</text>
    		</switch>
    
If you want it to work right now, then make English the default language. I do not like that alternative; English is not better than other languages.
Glrx (talk) 15:40, 21 May 2023 (UTC)[reply]
I see. So, I can't use the svgtranslate tool? It's very bad. IKhitron (talk) 15:42, 21 May 2023 (UTC)[reply]
@IKhitron: You should be able to use the SVG Translate tool. It has problems, but it should work on simple text. Glrx (talk) 15:53, 21 May 2023 (UTC)[reply]
I'm not talking about this. It can translate from default, but not to default, as I an see, and I need to translate from Russian to default English. Unless there is a way and I missed it. IKhitron (talk) 15:58, 21 May 2023 (UTC)[reply]
@IKhitron:
I would translate default to Russian (identity) and default to English.
If the bug is fixed soon, then everything should work.
Glrx (talk) 16:07, 21 May 2023 (UTC)[reply]
You just said for now Russian can't be default. IKhitron (talk) 16:09, 21 May 2023 (UTC)[reply]
@IKhitron:
Russian can be the default language, and Russian is the obvious choice for the default.
The problem right now is WMF is updating its software, and some bugs are showing up. So right now, English does not display. Other languages, such as French, will display. And it is possible that WMF will fix this particular bug in a few days.
I just tried running SVG Translate on the file, but I got the error "This file can not be translated because it contains nested tspan elements in title_text."
That is because the SVG contains text elements such as:
<text x="183" y="597" class="end">Славянский<tspan x="180" dy="13"> бульвар</tspan></text>
SVG Translate does not process text elements when the text is at different levels (a toplevel #text node and a tspan element)‹›. It would process
<text x="183" y="597" class="end"><tspan>Славянский</tspan><tspan x="180" dy="13"> бульвар</tspan></text>
SVG Translate does not allow editing the default language. That is a limitation.
Glrx (talk) 01:24, 22 May 2023 (UTC)[reply]
Yes, I know I should change all these multiline spans, and I plan it soon. I'm going to make this file bilingual. and allow to other wikis, as frwiki and azwiki, that were interested, to translate by their own. So, until the bug is fixed, looks like I can't use the tool. IKhitron (talk) 01:28, 22 May 2023 (UTC)[reply]
Well, @Glrx, hello again. I had some time yesterday, so I've translated the file. To avoid the bug, I used "fr" language code for the English translation. Is there any chance you could estimate the time to fix this bug? If it's a day or two, I'll wait, otherwise I'll need to replace fifty file transclusions on dozens of wikis, using the "fr" code and long commented explanation why I'm doing this, and change them all once again after the bug fix. I tryed to use the "simple" language code, for Simple English, because this one is still right, but it does not work. Thank you. IKhitron (talk) 12:20, 1 June 2023 (UTC)[reply]
@IKhitron:
Do not use fr for English! It is for French.
Just make the SVG be correct and ignore WMF. Have en clauses for English, fr clauses for French, ru clauses for Russian, and let the default clause be Russian. That should work on fr.Wiki and ru.Wiki. It will also be a good result when someone loads the SVG into his browser. When WMF fixes the bug, then it will start displaying English on en.Wiki and other wikis.
Make the file work in browsers and SVG Translate. WMF will catch up.
See also Phab:T337139
Glrx (talk) 17:54, 1 June 2023 (UTC)[reply]
I can't do this, @Glrx, because the file is too big to translate it manually, and the SVG Translation Tool needs until 250MB, when after the current translation I already have 249. So there is no place to double Russian text as default. Pretending that English is French is the only way I can see now. If there was a translation tool for 350MB at least, I could do as you say. Or if the tool was fixed from the bug that adds irrelevant tspan tag on each text tag, but it was published a lot of time ago, and was not fixed so far. Or maybe you can see another solution? And you didn't answer on my question about the time estimation. Thank you. IKhitron (talk) 18:02, 1 June 2023 (UTC)[reply]
@IKhitron:
I do not understand.
The file is not 250MB; it is 250kB. SVG Translate does not have a 250 kB limit; MediaWiki (Commons) has that limit. The limit should not be a problem because there are switch translations within the first 250 kB.
Are you using a text editor that requies files to be less than 250 kB?
The Russian text is currently the default. Leave it that way.
You should be able to use SVG Translate for default language to Russian.
You should be able to use SVG Translate for default language to English.
I did not estimate the time; I do not know enough.
Glrx (talk) 18:55, 1 June 2023 (UTC)[reply]
Sorry. KB, of course, it's a typo. I saw somewhere about the maximum for the tool, not for Commons.
OK, if so, I'll do this three language thing, as you recommend.
But if I understand correctly, @Glrx, this way will not work at all until the bug will be fixed. So I can't upload the translated file until then, even it will take a week or a year. Am I wrong? IKhitron (talk) 19:01, 1 June 2023 (UTC)[reply]
@IKhitron:
You can upload the file today; you do not have to wait for the bug to be fixed. Even if the file does not display English on Commons now, it will display English when people click through to the SVG — something that they would do in order to view the detail. That is what users of File:2022 Russian invasion of Ukraine.svg do today.
Glrx (talk) 20:10, 1 June 2023 (UTC)[reply]
The file is used many times with 970px width, just to see all the details without clicking, on interactive map. Because clicking does something different there. So it's not a solution. IKhitron (talk) 20:18, 1 June 2023 (UTC)[reply]
N3: Made the Russian translation, as you said. It's 325KB now. And it works, at least partially, only the image preview does not work any more. I can live with this. Now just waiting for your decision, either upload it with the temporarly French marks, or wait for the bug fix, or you'll think about some new solution. Thanks again. IKhitron (talk) 21:03, 1 June 2023 (UTC)[reply]
@IKhitron:
I would upload, but I would not use fr. If you are comfortable with text editors, all you need to do is replace systemLanguage="fr" with systemLanguage="en". Any unusual tricks will just confuse others.
Glrx (talk) 21:26, 1 June 2023 (UTC)[reply]
I can do it, of course. And I will need to do this at least after the bug fix. But replacing it and uploading now will create a completely useless image. About confusing - this is why I said that if it will be decided to do it this way, I'll make the edits on all the wikis by myself, and add commented explanation why it's done this way for now. IKhitron (talk) 21:33, 1 June 2023 (UTC)[reply]
Well, I have an idea.
  1. Create Russian copy of default - already done.
  2. Replace all "fr" to be "en".
  3. Use regex on the svg file so that every text tag English text will replace the Russian one in the default switch clause.
  4. Upload the file now.
  5. Use on pages lang=en and lang=ru explicitly, no default calls.
  6. When the phab bug will be fixed, replace default clauses to be Russian ones again.
  7. Remove unnessecary lang=ru.
  8. Check all the file usage across wikis to make sure noone removed lang or made a new usage as default.
This should work. Starting now. IKhitron (talk) 10:59, 2 June 2023 (UTC)[reply]
Well, @Glrx, done. I'm going to check in SVG translate tool, and upload for wikis usage. I believe it's OK with you? Thank you. IKhitron (talk) 13:53, 2 June 2023 (UTC)[reply]
@IKhitron: e/c
Do not make this more complicated than needed;
  1. Create Russian copy of default - already done.
  2. Replace all "fr" to be "en".
  3. Use regex on the svg file so that every text tag English text will replace the Russian one in the default switch clause.
  4. Upload the file now.
  5. Use on pages lang=en and lang=ru explicitly, no default calls.
    Do not do this step. It will frustrate additional translations. Say the map is used on an es.Wiki page with lang=en. Then somebody translates the map to Spanish. The Spanish translations will display on the Commons File: page, but Spanish will not display es.Wiki page.
  6. When the phab bug will be fixed, replace default clauses to be Russian ones again.
  7. Remove unnessecary lang=ru.
    Do not do this step. The Russian clause is necessary. Consider a Russian speaker who can also understand English. He configures his browser to prefer ru but also accept en. When he loads the SVG in his browser, there is no ru clause but there is an en clause, so the browser will display English despite Russian being the default. The browser does not know that the default clause is Russian. That is why there should always be an ru clause. That is also true for other languages. If the default clause is English, there should still be an en clause.
  8. Check all the file usage across wikis to make sure noone removed lang or made a new usage as default.
I would not put effort into a workaround. Upload SVG that should work and let WMF fix the system.
Glrx (talk) 15:10, 2 June 2023 (UTC)[reply]
I agree with everything, besides one step. If I do not do 5, @Glrx, that means that in eswiki I will see the default version, because es code is neither en nor ru nor ce. The default is in English, and it's fine. But after 6 the default version will be in Russian, so Spanish users will suddenly see the Russian text instead of the English one. Better if there will be one day a Spanish translation, the translator or me would go to eswiki and replace en with es. Thanks again. IKhitron (talk) 16:22, 2 June 2023 (UTC)[reply]
@IKhitron: No. After 6, es.Wiki will display English because MediaWiki displays the en clause if it is present. It does not matter whether the default clause is Russian or English, MW sets the system language to en. Glrx (talk) 20:29, 2 June 2023 (UTC)[reply]
Why not Spanish? It's another bug? IKhitron (talk) 20:33, 2 June 2023 (UTC)[reply]
@IKhitron: Because in your hypothetical there is no Spanish. If Spanish has been added, then Spanish will display on es.Wiki if there is no explicit |lang=. Glrx (talk) 21:13, 2 June 2023 (UTC)[reply]
I do not unferstand. If you are on X wiki, and there X clause, it is shown. Otherways, as you say en is shown. So the defaultvclause is never used? IKhitron (talk) 21:49, 2 June 2023 (UTC)[reply]
@IKhitron: You understand. Default clause is shown if there is no X and no en. If there is an en clause, then wikis will never show the default clause. A direct view of the SVG may still show the default clause. For example, a Spanish user may not have English as a preference; if the SVG does not have an es clause, then the default will display. Glrx (talk) 23:54, 2 June 2023 (UTC)[reply]
A) It is weird and IMHO should be fixed, if so. B) But, how does it live with the sentence in the manual, do not remember where, that for the last two years absent lang in svg call sets it to local wiki language? When Russian text was default yesterday, Russian text appeared when there was no lang parameter, I checked. IKhitron (talk) 00:02, 3 June 2023 (UTC)[reply]
@IKhitron: A) is a WMF design decision. B) A local wiki checks if its language is present in the SVG; it only sets lang if its language is present. Otherwise, it does not set lang. When the thumbnailer is not given an explicit lang, then it assumes the lang is en. Over the past month or so, the thumbnailer is broken; that's why there are so many Phabricator issues. The thumbnailer is no longer setting an en default, so the SVG's default clause (e.g., your Russian) is displayed. There are other bugs. Glrx (talk) 00:15, 3 June 2023 (UTC)[reply]
I'm beginning to understand. So, after the fix absent lang on eswiki will set it to en, and absent lang on cewiki will set it to ce. It makes sence now. That means after the fix I should remove the lang=en anywhere? I really don't want to do this now, nevermind if it's correct or not, because it's buggy, and any current bug or partial fix of some bug can break this. So, better safe than sorry, these langs will survive until the fix of all the bugs. Thank you for your explanations. IKhitron (talk) 00:23, 3 June 2023 (UTC)[reply]
Continuing to work. Uploaded at File:Moscow metro map sb.svg. IKhitron (talk) 16:49, 2 June 2023 (UTC)[reply]

Further issues[edit]

@Glrx, seems there is a problem. I've published the new map in the Metro Project, and people complain. If you click on a map, russian, or english, you get both times English svg file. Is this another bug? Thank you. IKhitron (talk) 09:46, 3 June 2023 (UTC)[reply]
@IKhitron: I presume we are now talking about File:Moscow metro map sb.svg.
It does not matter whether one clicks through the English or Russian version. Clicking through displays the multilingual SVG in the browser. The browser will display the preferred language from the browser preferences. If Russian is a higher preference than English, then Russian will display. Otherwise, English will display either because English is a browser preference or because the SVG default is English.
MediaWiki Thumbnailer produces
Glrx (talk) 15:11, 3 June 2023 (UTC)[reply]
I see. Thank you for the explanation. IKhitron (talk) 15:18, 3 June 2023 (UTC)[reply]
One more problem, @Glrx. I even don't understand if it's MediaWiki problem, my mistake, or svg language issue. Given current File:Moscow metro map multilingual future draft.svg. If I render it as en, or as ru, or as default, and then click on 1,330 × 1,730 pixels, I get expected result every time. But if I just click on thumbnail on the top of the file page, I get some mix in pure svg. See here in the right bottom corner. I deleted the browser cache. Thank you. IKhitron (talk) 13:29, 5 June 2023 (UTC)[reply]
@IKhitron:
I do not see that problem when I click through. For en, I cannot find the strings Электрозаводская or МЦД4.
However, ru should show this SVG as MCD4 because ru translates to MCD4 instead of МЦД4.
<switch>
  <text x="65" y="160" id="trsvg1165-ru" systemLanguage="ru"><tspan id="trsvg1142-ru">MCD4</tspan></text>
  <text x="65" y="160" id="trsvg1165-en" systemLanguage="en"><tspan id="trsvg1142-en">MCD4</tspan></text>
  <text x="65" y="160" id="trsvg1165"><tspan id="trsvg1142">MCD4</tspan></text>
</switch>
Glrx (talk) 14:18, 5 June 2023 (UTC)[reply]
Thank you for your answer.
> I do not see that problem when I click through.
In this case, it can be a browser problem. I'll try something later with regexes, maybe it will help.
> For en, I cannot find the strings Электрозаводская or МЦД4.
I can all three МЦД4 as MCD4, and both Электрозаводская as Elektrozavodskaya, which ones can't you see?
> However, ru should show this SVG as MCD4 because ru translates to MCD4 instead of МЦД4.
It's my typo, thanks a lot, I'll fix. IKhitron (talk) 17:35, 5 June 2023 (UTC)[reply]
@IKhitron:
I load https://upload.wikimedia.org/wikipedia/commons/e/e8/Moscow_metro_map_multilingual_future_draft.svg into my browser. My browser preferences include en but not ru. I am only looking at the SVG for en.
Then I do a control-F search for "Электрозаводская". The search does not find anything. Same for "МЦД4".
When I checked the SVG above, those strings were part of en/ru/default switches, so they should behave correctly in Chrome, Firefox, and Edge.
Glrx (talk) 18:42, 5 June 2023 (UTC)[reply]
I see. Thank you. Indeed:
> I do not see that problem when I click through.
>> In this case, it can be a browser problem. I'll try something later with regexes, maybe it will help.
Well, I was right. Somehow, my (usually incredibly good) Chrome-based browser shows multilanguage svg with first label in order, does not matter what language it is. So, I've reordered the file, so that all the language triplets text tags will be in the same order. IKhitron (talk) 18:45, 5 June 2023 (UTC)[reply]
@IKhitron:
Older browsers (say Chrome and Firefox of 2 years ago) would choose the first clause that matches rather than the best match. First match was the original rule for SVG 1.0 and 1.1. SVG 2.0 uses best match (aka, allowReorder). So a recent Chrome browser should work correctly.
There is a possibility that your browser is configured to prefer both ru and en equally; that might result in an apparent first clause that matches. For example, my browser language preferences result in an HTTP Request Header that includes
Accept-Language:en-US,en;q=0.9
If your browser preferences result in a Request Header that only has
Accept-Language:ru,en
Then you would accept either ru or en equally. (Alternatively, if both en and ru have the same q-value, they would be accepted equally.) Browsers usually do not let average users set languages to the same preference value, but sometimes browsers get language information from other places.
Click this link
Then check Information / Request Headers
.see https://www.w3.org/International/questions/qa-lang-priorities
Glrx (talk) 19:22, 5 June 2023 (UTC)[reply]
> So a recent Chrome browser should work correctly.
Well, it's the last version, and it's my favorite browser, but it doesn't.
> Then you would accept either ru or en equally.
Well, the validator you linked gives me four unweighted languages, two of them English and zero Russian. And there is no way to change it.
But anyhow, I prefer that all the people see that right, even with such browsers, not just me, so sorting I've made fixed the problem IMO. Thank you. IKhitron (talk) 20:08, 5 June 2023 (UTC)[reply]

Translation done, addition to an article done... but then, for a simple reader, what?[edit]

We've had a long discussion between users in the Catalan Wikipedia to figure out the process. Not only how to add a translated image from Wikidata into the infobox (which is worrying regarding other languages) but also on what happens for a simple Internet user that would like to download in HQ the picture in a specific language from the original file.

Once File:Map athenian empire 431 BC-en.svg was translated into Catalan several months ago by a user, anything in the file could relate that it was in fact available in our language. Then, without knowing his previous work, I translated it again via SVG Translate Tool. As a result, since that moment, nothing automatically tells that the picture encodes now the Catalan version. Browsing more, I added in Template:Other versions/Map athenian empire 431 B (this template subpage is absolutely not straightforward to find) the line Map athenian empire 431 BC-en.svg|lang=ca|{{#language:ca}}. The result is just a thumbnail that if you zoom in x200, you may appreciate some words in Catalan. However, as soon as you click on it, it displays the original English version; still no way to visualize nor download the desired language version. The last solution you may come across is "ok, I will just download the SVG file and upload it again in Commons with the file extension name File:Map athenian empire 431 BC-ca.svg You cannot, the interface warns you that it already exists. Please, consider that I am just following all rationale from an average-advanced Wikipedian. Any newbie would have just quit since publishing the SVG and not finding where all his work ended up.

I see a thread in this same page that already referred somehow to this: Commons talk:Translation possible/Learn more#Template for already translated files?. It's from 2007 and, one decade and a half later, it seems we are kinda stranded in the same problem. Concerning for non-techie wikipedians and for all kind of readers. We externalize very nice tools outside the Mediawiki environment, but then the results get somehow lost within our technological debt. Hopefully someone can thoroughly tackle it. Best, Xavier D. (Messages) 10:51, 31 July 2023 (UTC)[reply]

@Xavier Dengra:
My sympathies. You have been hit with a number of known issues.
After using SVG Translate to add Catalan translations to a file, the File: page normally shows a "Render this image in (language dropdown box)". The dropdown box should show all the available translations (including the added Catalan). In addition, if the file were transcluded in the Catalan wiki, then those inclusions should now display the Catalan version of the SVG.
You have added the Catalan translations. Here is a link that shows the Catalan version
However, the dropdown box does not display, and the ca.Wiki transclusions continue to show English rather than Catalan.
The problem is MediaWiki only looks at the first 256 kB of the SVG file to determine what translations are available. The map is 3.3 MB, and all the translations are near the end of the file (i.e., beyond 256 kB). Therefore, MediaWiki believes there are no translations. Consequently, MediaWiki does not display the dropdown box, and MW does not update the transclusions. This is a common problem when translating detailed maps; they are often over 256 kB.
Even an explicit request to use Catalan on the File: page is ignored:
However, a file transclusion that explicitly demands lang=ca will work because it bypasses the language check:
  • [[File:Map_athenian_empire_431_BC-en.svg|600px|lang=ca]]
The workaround is to add a translation in the first 256 kB of the SVG file. That is difficult for most users to do.
SVG Translate should add such a translation, but it does not.
Glrx (talk) 15:13, 31 July 2023 (UTC)[reply]
@Xavier Dengra:
I added a dummy translation to the defs section, so Catalan should work on Wikipedia now.
Glrx (talk) 05:46, 3 August 2023 (UTC)[reply]
Thank you so much, @Glrx! With extremely a lot of instructions (because it is not an easy process at all), I opened a new Catalan Wikipedia challenge in 20 dies to reach 500 new translations of already existing .svg files via the SVG Translate. Check it out here :) Xavier D. (Messages) 10:02, 14 September 2023 (UTC)[reply]
@Xavier Dengra:
Thanks for running the Catalan translation challenge.
I would try to keep the challenge simple: just focus on the translations.
In general, the Catalan Wikipedia will supply the |lang=ca parameter automatically. Explicitly setting that parameter is a workaround for files that are larger than 256 kB. I would replace that step with a different one: If the Commons file is larger than 256 kB, then add a fixup template to the Commons file page. We could make something like {{SVG Translate bug}}. That template can add the file to a Category of tiles that need to be fixed up later.
I would focus on just getting the files translated, so I am leery of adding Other versions/* templates. If a file already has such a template, then adding to the template is appropriate. The template is primarily used when there are many Commons files that will use it; a single use of a template just adds complications. In many situations, the "Render this image in (language)" dropdown box will alert to other languages.
If you want to show available images, just set |other versions= parameter of {{Information}} to use {{Svg lang}}:
  • |other versions= {{svg lang||ca|en}}
That will produce something like
Map athenian empire 431 BC-en.svg|lang=ca (Catalan)
Map athenian empire 431 BC-en.svg|lang=en (English)
Perhaps even simpler would have the participants add a category to the Commons page: something like Category:Catalan Translation Challenge 2023. That would allow you to see all the translation results. That category could also be used for fixing up |other versions= and even scoring the contest....
I can give you some help.
Glrx (talk) 16:47, 14 September 2023 (UTC)[reply]