Commons:SVG Translate tool

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
This page is a translated version of a page Commons:SVG Translate tool and the translation is 50% complete. Changes to the translation template, respectively the source language can be submitted through Commons:SVG Translate tool and have to be approved by a translation administrator.

Эта страница предназначена для документации, касающейся инструмента перевода SVG (SVG Translate) на Toolforge.

SVG Translate - экран перевода (аннотированный)

Назначение

SVGTranslate tool is built for the purpose of easy translation of SVG files. The tool allows users to translate any SVG file on Commons that has machine-readable text labels. The translations are added to the same image file using switch-translations. By doing this, translations are preserved over time even if the image gets modified. You can read more about it here.

История

This tool is a successor to the older SVGTranslate tool which was maintained by User:Jarry1250. After that tool was no longer maintained, it was proposed as a project in the 2017 Wishlist survey. The project ranked #9 on the wishlist results list. In late August 2018, meta:Community Tech began working on this project. A lot of community members were consulted during the design and development process of the tool.

Использование

Picking a file to translate

Страница поиска файлов
Поиск файлов

This is the landing page for the svg-translate tool. On this page, you can use the file search capabilities to search for any SVG on Commons. Keep in mind that you will only be able to translate SVGs which have machine-readable text labels. For other SVGs you will need to use an image-editing software like Inkscape.

Выбор языка перевода

SVG Translate - экран перевода

After selecting an image, you will see the translate view. In this view, on the left you see the image labels and blank inputs for adding translations. On the right, you see the image. Before adding label translations, you need to select the language you want to translate the file into. To do this, click on the Select a language dropdown above the input boxes. Then you can use ULS to select your language.

Средство выбора языка для инструмента перевода SVG

Adding translations for image labels

Предварительный просмотр перевода для инструмента перевода SVG

Once you have selected a language you want to translate your file into, you will be able to add translations for the labels. As you complete translation for each label, the tool will generate a new image with the added translation in the image. As you can see in the image on the left, the two translated labels have been added to the image.
Note that it may take a little while for the preview to be generated and rendered. It takes longer for complex images with more text labels.

Uploading translations to Commons

After all the labels have been translated, you can upload the image to Commons by clicking the Upload to Commons button above the image. Please note that in order to upload, you need to login first. You can do this using the login button on top right.

Использование переведённого файла в вики

Переключение переведённого файла — выбор языка
Переключение переведённого файла на иврит

Добавив перевод к файлу, вы можете перейти на его страницу на Складе и выбрать язык через выпадающее меню "Показать это изображение на языке" под изображением. Пример можно видеть на картинке слева.

Сменив язык, вы сможете увидеть добавленный перевод. Чтобы вставить этот файл на своей вики, вы можете добавить его в текст как любой другой. По умолчанию, файл будет отображён на языке вики, если существует соответствующий перевод. Если перевода на этот язык нет, то файл будет показан на английском.

Например, если вы добавили перевод на русский для File:Fire triangle 2.svg, и хотите вставить его в Русской Википедии, то вы можете просто использовать код [[Файл:Fire triangle 2.svg]] в нужной статье и файл будет отображен на русском языке, если такой перевод есть. Если перевод на русский не будет найден, то подписи в файле будут на английском. Если вы хотите отобразить надписи на русском в другой Википедии, то её в статьях надо будет вставить следующий код: [[File:Fire triangle 2.svg|lang=ru]].

ЧЗВ

Q: Why do I see the message This file does not have any labels available for translation?

A: There are many reasons for this message to appear:

  • A file may have drawn text, but the tool can only find text that is in a machine-readable format (the text must be in a text element). For example, File:Nuvola apps edu miscellaneous H2O.svg has drawn text labels that the tool does not recognize.
  • The tool may be accessing an outdated version of the SVG file. When the tool accesses an SVG file from Commons, it puts it in its own cache. The tool will never check Commons for a more recent version of a cached file, so the user must wait until the file ages out of the cache (in 5 hours or more). There is not a way to purge the cache. In particular, doing &action=purge on Commons does not purge the tool's cache. phab:T213126, phab:T216207
  • The tool expects the switch elements that are used in multilingual files to have a particular, simple, structure. The immediate children should be text elements that are the translations. The tool does not expect, for example, a (anchor/hyperlink) or g (group) elements. The tool requires a default translation (a text element child without a systemLanguage attribute). The tool expects all the translations to have the same number of tspan elements as the default translation. For example, if the default translation text element has no tspan child elements, but an existing German translation has all its text within a tspan, then the tool will not display any German text. phab:T230357, https://svgtranslate.toolforge.org/File:T230357.svg
  • The tool is confused by CSS ID selectors in the style element, e.g. ‎<style type="text/css">#middleMarker { fill: red; }; #Person { stroke: black; }‎</style>. phab:T231143
  • If the tool fails on one element it fails on all. phab:T248252
  • The tool does not support nested ‎<tspan>. phab:T250607

Q: Why is the Upload to Commons button disabled?

A: Files cannot be uploaded to Commons unless you are logged in. You may login using the Login button on top-right of the page. You will be presented with the OAuth permission screen. You will need to click Accept to allow the tool to upload the file to Commons on your behalf.

Q: What does the Default language in the language dropdown on the left in translate view mean?

A: When the SVG image does not indicate the language it is in, the system assumes that it is in Default language. The tool does not know if it is English or Spanish or some other language.

Q: Why do I see the message The file you requested could not be found?

A: This message is displayed when the image name requested does not exist on Commons. Please check for spelling errors in the file name and double-check on Commons. Note that only images present on Commons can be translated using this tool. You can upload your SVG file to Commons in order to use this tool to translate it.

Q: The order of labels is wrong for my language. How can I fix this?

A: The easy way is to add the translations in the correct order (that is, insert the right translation for the wrong label). The preview feature will help you see if it appears correctly in the image. This is not a good solution and we are trying to find a way to fix this problem in the long term but we cannot guarantee a solution because SVGs can be very complex.

Q: Why do I see the message Only SVG files are supported?

A:

  • It is not possible to translate any file formats other than SVG (i.e. with a file extension of .svg). The SVG Translate tool is linked from a template on Commons, and so it's possible that this template is used on non-SVG files and in these cases you might end up seeing this error. There may be an SVG version of the image you're trying to translate (check for the {{Vector version available}} template on the file's page).
  • phab:T251702 missing XML-information might confuse the converter


См. также