Commons talk:Translation possible/Learn more

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


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

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


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

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)

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 (talk • contribs) 20:31, 9 December 2007‎ (UTC)

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)

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)

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

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)

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

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

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

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)
  • Comment. The example by Ain92 is faulty: the systemLanguage="ru" case will never be seen. The unqualified text tag must come after all the qualified versions. Glrx (talk) 05:32, 14 November 2014 (UTC)
  • Thank you. Please change the page so to clearly indicate both the presence of exemplary code in this file and the required order of language versions. Ain92 (talk) 19:13, 16 November 2014 (UTC)

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)

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)

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)

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)

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)

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)

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)
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)
Someone? --Obsuser (talk) 21:34, 11 August 2016 (UTC)
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)
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)
Thanks. Glrx (talk) 15:34, 21 October 2016 (UTC)

System language attribute bug demo.svg Using lang=en
System language attribute bug demo.svg Using lang=en-BZ, displays first!
System language attribute bug demo.svg Using lang=en-bz, displays first!
System language attribute bug demo.svg 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)

Tool seems to have a bug[edit]

When I call I get:

testing 100 Years War France 1435.svg on 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)

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

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)

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)