Page MenuHomePhabricator

tux does not prevent translations of source language when language is changed through language selector
Closed, ResolvedPublic

Description

In a wiki with English as default langiage, I am trying to define specific source pages in another language. The Translate extensionb gets confused, ether mixing the source langiage of a page or believing that a single page has two source languages.

Steps:

  • Create a new test page in a wiki with English as source language. "Text4" in this example.
  • Go to Special:PageLanguage and select the page, "Select language", and then Catalan. Submit. You end up in the test page.
  • Add <translate> tags. Save page.
  • Click "Mark this page for translation", keep the defaults, also "Allow translation of page title" clicked. Click "Mark this page for translation"
  • I land in Special:PageTranslation where a section that I never had seen before appears:

Broken pages
An old version of this page is marked for translation, but the latest version cannot be marked for translation.
Test4 (remove from translation)

  • If I load that page again (not reload with the submit info, just visiting the page again with the browser) then that section is gone, and Test4 appears in "Pages in translation" just like the rest.
  • Now I go to Test4 and click "Translate this page". By default I am presented the option to translate it to English. No translation UI is ioffered because

Translations to this language in this group have been disabled. Reason:
English is the source language.

  • If I select to translate to Catalan, then I don't get the translate UI either because

Translations to this language in this group have been disabled. Reason:
Catalan is the source language of this page.

  • If I select Spanish, then I get the translate UI finally. The page says "Translation of the wiki page Test4 from català (ca).
  • If NOW I go to English again, the translate UI appears: "Translation of the wiki page Test4 from català (ca). "
  • ... and if (without translating anything) I select Catalan again... I also get the translate UI: "Translation of the wiki page Test4 from català (ca). In other words, I could now translate from Catalan to Catalan. :)

Conclusion: the source language seems to be defined correctly (Catalan in this case) but the Translate extension is having difficulties dealing with this properly, showing an error message that then disappears, being initially confused about source language English/Catalan until I try to translate in a third language, and then allowing translations in the same language than the source.

Event Timeline

Broken pages
An old version of this page is marked for translation, but the latest version cannot be marked for translation.
Test4 (remove from translation)

Probably because the job which updates it hasn't completed when Special:PageTranslation is rendered.

Translations to this language in this group have been disabled. Reason:
English is the source language.

"English is the source language" is not the actual message shown by Translate when a user tries to view translate interface in the source language of the page. Compare it with "Catalan is the source language 'of this page'." which should be the actual message shown by Translate for these cases. I guess that your wiki has a configuration that disables translations for English through $wgTranslateBlacklist similar to what is done on Wikimedia wikis currently.

If NOW I go to English again, the translate UI appears: "Translation of the wiki page Test4 from català (ca). "

This makes my above guess stronger because there is a bug which makes it not work properly when a user changes the language through the language selector. See T51898: [TUX] Blacklisted languages are not shown as blacklisted when language was selected using the language selector.

... and if (without translating anything) I select Catalan again... I also get the translate UI: "Translation of the wiki page Test4 from català (ca). In other words, I could now translate from Catalan to Catalan. :)

This looks like a valid bug that hasn't yet been reported (or I haven't seen one yet). It's probably because the JS code doesn't check for source language similar to the above bug.

Glaisher renamed this task from Translate extension gets confused about Special:PageLanguage to tux does not prevent translations of source language when language is changed through language selector.Aug 12 2016, 5:00 PM

Change 306959 had a related patch set uploaded (by Glaisher):
tux: Change URL when the language is changed through language selector

https://gerrit.wikimedia.org/r/306959

For the record, Wikimedia wikis recently removed English for all groups from TranslateBlacklist in https://gerrit.wikimedia.org/r/306015. That configuration should not be needed as Translate should do that check on it's own; it shouldn't need to depend on configuration).

Change 306959 merged by jenkins-bot:
tux: Change URL when the language is changed through language selector

https://gerrit.wikimedia.org/r/306959

Glaisher claimed this task.

T51898 and this is now fixed on Translate side. You would need to remove the English $wgTranslateBlacklist entry on your wiki for it to work properly.