Last modified: 2014-01-03 15:48:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T42341, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40341 - Enable translation import on wikis with Translate extension
Enable translation import on wikis with Translate extension
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Site requests (Other open bugs)
unspecified
All All
: High enhancement (vote)
: ---
Assigned To: Niklas Laxström
: easy, shell
: 41700 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-18 23:36 UTC by Erik Moeller
Modified: 2014-01-03 15:48 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Erik Moeller 2012-09-18 23:36:01 UTC
The import of translations is currently disabled on wikis running the Translate extension; the import feature is disabled in CommonSettings.php with:

unset( $wgSpecialPages['ImportTranslations'] );

This special page allows bulk import of translations in gettext format. 

Provided the extension is secure, I suggest enabling this feature for users in the 'translation administrator' group. The use case here is that some groups in WMF use commercial translation services, and it would be good to have a mechanism for bulk import of translations.

Adding Siebrand. Needs security sign-off, so adding Chris as well.
Comment 1 Niklas Laxström 2012-09-20 06:28:43 UTC
One issue to consider: the export action cannot currently be restricted to only certain user groups – only the import action is restricted. That would mean that translators downloading the files couldn't upload those themselves.
Comment 2 Siebrand Mazeland 2012-10-05 07:05:23 UTC
So who's responsible for getting time allocated for security sign-off? Chris, can you please enlighten us?
Comment 3 Siebrand Mazeland 2012-10-05 07:06:55 UTC
(In reply to comment #1)
> One issue to consider: the export action cannot currently be restricted to only
> certain user groups – only the import action is restricted. That would mean
> that translators downloading the files couldn't upload those themselves.

Let's get it enabled, and see what's needed from there. We tend to overanalyze and then design, develop and implement too complex functionality. Release early, release often, and respond agile is the way to go.
Comment 4 Chris Steipp 2012-10-05 19:58:17 UTC
I took a quick initial look at it, and most things look ok, but there were a few pieces that I would like to look into further. Unfortunately, it hasn't been high on my priority list.

What is your schedule on this rolled out? Is there something that relies on this being in place?
Comment 5 Siebrand Mazeland 2012-10-10 22:33:42 UTC
(In reply to comment #4)
> 
> What is your schedule on this rolled out?

As soon as you approve.

> Is there something that relies on
> this being in place?

Comms want to be able to have paid translations, and to combine that with Wiki pages requires this functionality to get anywhere.

Please give it an appropriate priority for security review. It's the critical path.
Comment 6 Ajraddatz 2012-11-02 15:56:55 UTC
*** Bug 41700 has been marked as a duplicate of this bug. ***
Comment 7 Chris Steipp 2012-12-05 02:30:50 UTC
Sorry for the delay in reviewing this.

In general, I'm not a fan of our servers making http calls to arbitrary urls-- a hostile user could start messing with our backend servers directly, or run attacks against other servers from our cluster, etc.

Would it be possible to add a config of allowed methods, which gets checked, and we allow users to upload, but not url import?
Comment 8 Sam Reed (reedy) 2013-02-02 23:19:08 UTC
(In reply to comment #7)
> Sorry for the delay in reviewing this.
> 
> In general, I'm not a fan of our servers making http calls to arbitrary
> urls--
> a hostile user could start messing with our backend servers directly, or run
> attacks against other servers from our cluster, etc.
> 
> Would it be possible to add a config of allowed methods, which gets checked,
> and we allow users to upload, but not url import?

Effectively what we're currently doing for HTTP sideloading from flickr
Comment 9 Andre Klapper 2013-04-25 17:21:08 UTC
(In reply to comment #7 by Chris Steipp)
> I'm not a fan of our servers making http calls to arbitrary urls--
> Would it be possible to add a config of allowed methods, which gets checked,
> and we allow users to upload, but not url import?

Siebrand?
Comment 10 Gerrit Notification Bot 2013-04-26 11:41:12 UTC
Related URL: https://gerrit.wikimedia.org/r/60983 (Gerrit Change I01057787abcf9cbcf9796cac7750134858ebff7b)
Comment 11 Siebrand Mazeland 2013-04-26 11:43:04 UTC
I submitted Gerrit change #60983. Once merged, this should satisfy the request from comment 4, and the import feature for Translate could be enabled on Wikimedia wikis.
Comment 12 Siebrand Mazeland 2013-04-29 10:25:13 UTC
Gerrit change #60983 is being merged and this will go live on Wikimedia in 1.22wmf3 from today on. A patch set can now be prepared to re-enable Special:ImportTranslations, as it's disabled with "unset( $wgSpecialPages['ImportTranslations'] );" in http://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php.

Marking "easy" now.
Comment 13 Gerrit Notification Bot 2013-05-14 17:15:18 UTC
Related URL: https://gerrit.wikimedia.org/r/63684 (Gerrit Change I4fd12988bb21f5132c718aeec05a2dc112640566)
Comment 14 Niklas Laxström 2013-05-15 14:51:29 UTC
1) Nobody has the right to import translations
2) Exporting to gettext is still disabled
Comment 15 Sam Reed (reedy) 2013-05-16 21:09:51 UTC
(In reply to comment #14)
> 1) Nobody has the right to import translations
> 2) Exporting to gettext is still disabled

The bug title doesn't request export. And no one asked for any rights to import translations, just enable translation import ;)
Comment 16 Nemo 2013-05-16 21:15:59 UTC
(In reply to comment #15)
> The bug title doesn't request export. 

True, it's not the use case comment 0 asked; however, the usual workflow is export -> translate -> import, so having only import makes little sense in general and may well be a requirement also for the services comment 0 had in mind.

> And no one asked for any rights to
> import
> translations, just enable translation import ;)

Comment 0 asked the right (translate-import) to be added to translation admin group.
Comment 17 Gerrit Notification Bot 2013-05-22 11:48:03 UTC
Related URL: https://gerrit.wikimedia.org/r/64919 (Gerrit Change I9f6b620c69b559214aa87d8fc96a19436a5687ee)
Comment 18 Tilman Bayer 2013-05-22 19:17:36 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > 
> > What is your schedule on this rolled out?
> 
> As soon as you approve.
> 
> > Is there something that relies on
> > this being in place?
> 
> Comms want to be able to have paid translations, and to combine that with
> Wiki
> pages requires this functionality to get anywhere.
To mention a current example, we (WMF Communications team) will receive a batch of such commercial translations on May 28 and plan to import them to Meta for community review right after that. I earlier did this by bot (https://meta.wikimedia.org/wiki/User:HaeBot ) racking up thousands of edits (one for each imported translation unit), but needless to say, a working gettext import functionality would greatly facilitate this task for me, and make it possible in the first place for other translation admins who do not want to install and operate a bot. 

The gettext import option should also be useful for converting translated wiki pages on Meta from the old translation system to the new format using the Translate extension (https://bugzilla.wikimedia.org/show_bug.cgi?id=46645 ). 
 
> 
> Please give it an appropriate priority for security review. It's the critical
> path.
Comment 19 Gerrit Notification Bot 2013-05-24 12:37:16 UTC
https://gerrit.wikimedia.org/r/64919 (Gerrit Change I9f6b620c69b559214aa87d8fc96a19436a5687ee) | change APPROVED and MERGED [by jenkins-bot]
Comment 20 Nemo 2013-10-26 11:08:37 UTC
(In reply to comment #19)
> https://gerrit.wikimedia.org/r/64919 (Gerrit Change
> I9f6b620c69b559214aa87d8fc96a19436a5687ee) | change APPROVED and MERGED [by
> jenkins-bot]

Tilman, [[m:Special:ImportTranslations]] is available since then (May), have you ever tried it?
Comment 21 Tilman Bayer 2013-12-04 08:42:07 UTC
(In reply to comment #20)
> (In reply to comment #19)
> > https://gerrit.wikimedia.org/r/64919 (Gerrit Change
> > I9f6b620c69b559214aa87d8fc96a19436a5687ee) | change APPROVED and MERGED [by
> > jenkins-bot]
> 
> Tilman, [[m:Special:ImportTranslations]] is available since then (May), have
> you ever tried it?

Hi Nemo, yes, I had noticed a while ago that Special:ImportTranslations is now available. However, I backed off after noticing that a) this bug had not been closed yet and b) that the export function, while recommended in the documentation for offline translation and linked in the translation interface on Meta, gave a "not supported" error. (In the meantime, I have again resorted to importing translations by bot instead.)


I have now looked into it again and tried to import .po files on Meta and on testwiki. After figuring out the file format (which would be much easier if the export function were available), and manually adding a missing interface message (https://meta.wikimedia.org/wiki/MediaWiki:Translate-manage-import-done ), I reached the point where the software indicates that the import is complete ("All done"). However, no translations are actually imported - according to the recent translation changes page and the logs, nothing happened at all. 

Before I spend even more time on this and file a separate bug for this problem, it would be great if someone from the language engineering team could do a quick verification that the import function is actually working at all on Meta-wiki, i.e. that is has imported at least one file successfully. At that point we could probably close this bug. If it's necessary to open a separate bug for the missing export function, then so be it.
Comment 22 Siebrand Mazeland 2013-12-04 10:21:11 UTC
I think $wgTranslateTasks may need to have this added:

'export-as-po' => 'ExportasPoMessagesTask'

Will look into it once I complete what I was working on when I read this reply...
Comment 23 Gerrit Notification Bot 2013-12-04 11:21:20 UTC
Change 99070 had a related patch set uploaded by Siebrand:
Allow exporting files as gettext in Translate

https://gerrit.wikimedia.org/r/99070
Comment 24 Gerrit Notification Bot 2013-12-04 13:15:35 UTC
Change 99070 merged by jenkins-bot:
Allow exporting files as gettext in Translate

https://gerrit.wikimedia.org/r/99070
Comment 25 Siebrand Mazeland 2013-12-04 13:32:49 UTC
Thanks to hashar/Antoine, the configuration change was made active. I've made a successful roundtrip as can be observed at https://meta.wikimedia.org/w/index.php?title=Special%3AContributions&contribs=user&target=Siebrand&namespace=1198&limit=5.

I've found an issue with a missing message, that I'll be adding soon. It may take a week or so before that hits Wikimedia wikis, so no need to report a bug when you see "<translate-manage-import-ok>" on Special:ImportTranslations. That patch set will show up here once I submit it.
Comment 26 Gerrit Notification Bot 2013-12-04 13:44:23 UTC
Change 99083 had a related patch set uploaded by Siebrand:
Add missing string 'translate-manage-import-ok'

https://gerrit.wikimedia.org/r/99083
Comment 27 Gerrit Notification Bot 2013-12-04 13:59:40 UTC
Change 99083 merged by jenkins-bot:
Add missing strings

https://gerrit.wikimedia.org/r/99083
Comment 28 Siebrand Mazeland 2013-12-04 14:40:14 UTC
For some reason Gerrit change #99083 wasn't auto-notified as having been merged.
Comment 29 Tilman Bayer 2013-12-05 03:00:53 UTC
This is great, thanks! With export working, I was able to adapt my file and get the import to work.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links