Page MenuHomePhabricator

SVG Parsing I - Language dropdowns in SVG Translate tool
Closed, ResolvedPublic5 Estimated Story Points

Description

This ticket directly follows up on T206712: Create the Translate view .

  • In the From language dropdown, show a list of languages that the SVG is available in - like the prototype. Note that the language names will be in the language itself and not internationalized.
  • In the To language dropdown. show the ULS with the Preferred languages on top in a section - these are the languages that the user has picked in the language settings dialog (T204849: SVG Translate tool: Language settings dialog).

Event Timeline

Niharika triaged this task as Medium priority.Oct 22 2018, 9:50 PM
Niharika created this task.
Niharika renamed this task from Language dropdowns in SVG Translate tool to SVG Parsing I - Language dropdowns in SVG Translate tool.Oct 22 2018, 9:56 PM
Niharika set the point value for this task to 5.Oct 23 2018, 11:23 PM
Niharika moved this task from Needs Discussion to Up Next (June 3-21) on the Community-Tech board.

The systemLanguage attribute is allowed to contain multiple language codes, such as in Agua_Caliente_Solar_Project_Electricity_Generation-2017.svg:

<text systemLanguage="zh, ja"><tspan font-size="20" >1月</tspan></text>

How should we display this in the source language dropdown? e.g. zh,ja could be a single entry of δΈ­ζ–‡, ζ—₯本θͺž (or something... I guess the separator could be an issue).

And how about when there's a list as the target language? Do we list all? Does the ULS need to permit the selection of multiple?

@Samwilson That's interesting. I'm thinking about whether specifying multiple languages for the same piece of text is a behavior we want to encourage or discourage. I think allowing for this makes things much more challenging on the technical side. Please correct me if that's not the case.
For now, how about we don't bother with permitting selection of multiple languages in the ULS (on the right) and on the left, we show every language separately, even if they are together and we show the same text no matter which of those is picked?

I don't think this means that we need to show two languages as the source language, they can still be shown as separate. If you select Chinese you get all Chinese translations, including the ones that are shared by Japanese (and the same goes if you select Japanese). And while saving if the value doesn't change we can let it be the way it is, and if it does we can split up the <text>:

<text systemLanguage="zh"><tspan font-size="20" >δΈ€ζœ‰</tspan></text>
<text systemLanguage=" ja"><tspan font-size="20" >1月</tspan></text>

I am guessing shared translations would often be the case with numbers in languages that share scripts. What we're seeing just an optimised way of storing something that would otherwise take up multiple lines:

<text systemLanguage="en, de, fr, it, es"><tspan font-size="20" >42</tspan></text>

Note, I don't know if what I am saying is correct, just sharing my understanding.

I agree with both of you. Although, @Prtksxna did you mean to have different strings inside the zh and ja examples?

My understanding is that they'd be identical and that there's no functional different other than some file-size saving to adding them as separate elements.

I also think the work to translate to and from the multi-language format belongs in the SvgFile class, and shouldn't be done as part of this ticket. It seems like what we can do here is just display the language in the source dropdown iff Intuition can give us a language name (i.e. for the case of zh, ja we'd get nothing, and therefore display no entry). That would mean we could still translate everything else, but the items with multiple languages would be ignored (and not be translated).

This seems to be what happens in core's SvgHandler as well.

I agree with both of you. Although, @Prtksxna did you mean to have different strings inside the zh and ja examples?

Yes, I meant that we split up the <text> if someone changes a common translation.

@Samwilson Testing on the staging site with this file: 2014 West Africa Ebola Epidemic - New Cases per Week.svg, I only see "English" in the From dropdown. It should give me all languages the file has translations in (about 30).

Interesting. It does make me wonder if we should message the user about partial translations existing. Had we decided previously that we wouldn't let users choose partial languages from which to translate? It makes sense because if there's no text then the translator doesn't know what to write.

@Samwilson @aezell I think showing all languages, including partially translated in the left dropdown makes sense. It might be that the labels left untranslated do not need translations (numbers or scientific terms, for instance). If a translation has a missing label, saying Untranslated. Original: <default/english label value>
in greyed-out italics is a good way to indicate that.
I'll split that out into a new task because I think I it's a tad bit late to include this detail in T207709: SVG Parsing II - Fetching labels and ability to switch languages.

@Samwilson Can we show all languages (including partial translations) in the From dropdown? Do you prefer if that's a separate ticket and not part of this?

That's T210872, and I think it's big enough to stand on its own.

Niharika moved this task from QA to Q2 2018-19 on the Community-Tech-Sprint board.

Oh right. I forgot I made that. Closing this one!