Page MenuHomePhabricator

Export mediawiki-extensions group via CLI
Closed, ResolvedPublic

Description

Hello,
I want to export translations of mediawiki-extensions group for Serbian language, so I can check/make new translations and make Cyrillic and Latin to be "in sync".

As this message group is big, and I can't do export/import via my nor bot account, can you please do it via CLI using this script?

After it, when you provide me .po files, and I'm done, you will need to import it via this script.

Event Timeline

Can you clarify which language codes? Both sr-ec and sr-el?

Can you clarify which language codes? Both sr-ec and sr-el?

Yes, right. @Nikerabbit

twn:~$ php /srv/mediawiki/workdir/extensions/Translate/scripts/export.php --group=ext-0-all --offline-gettext-format="%GROUPID%_%CODE%.po" --lang=sr-ec,sr-el --target=. 
Skipping meta message group ext-0-all.
EE1: No valid message groups identified.

The script needs updating to allow it.

twn:~$ php /srv/mediawiki/workdir/extensions/Translate/scripts/export.php --group=ext-0-all --offline-gettext-format="%GROUPID%_%CODE%.po" --lang=sr-ec,sr-el --target=. 
Skipping meta message group ext-0-all.
EE1: No valid message groups identified.

The script needs updating to allow it.

It basically means removing lines 148-152 https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/refs/heads/master/scripts/export.php#146 or something else? :)

It should be skipped for offline-gettext mode. Otherwise normal exports would error on the second condition.

It should be skipped for offline-gettext mode. Otherwise normal exports would error on the second condition.

Okay, thanks. I'm adding project tag for extension so it can be done.

Still the same error: Skipping meta message group ext-0-all.

Still the same error: Skipping meta message group ext-0-all.

What about mediawiki?

Change 755356 had a related patch set uploaded (by Nikerabbit; author: Nikerabbit):

[mediawiki/extensions/Translate@master] Allow exporting AggregateMessageGroups in offline format via CLI

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

Change 755356 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Allow exporting AggregateMessageGroups in offline format via CLI

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

@Kizule This should now be possible. Are you still interested in the export?

Please re-open if still interested.

@Nikerabbit I'm unsure how I've missed this one. I'm interested, of course.

But firstly we should figure out how to transfer them from the twn server to me, and after, from me to the twn server.

SCP sounds like the first option for me.

Files can be generated with:

twn:/www/translatewiki.net/docroot/static/temp$ sudo php /srv/mediawiki/workdir/extensions/Translate/scripts/export.php --lang=sr-ec,sr-el --target=. --offline-gettext-format=%GROUPID%_%CODE%.po --group ext-0-all

This is slow and takes a few minutes to run.

And then downloaded from:

Import of this large files has not been tested.

Files can be generated with:

twn:/www/translatewiki.net/docroot/static/temp$ sudo php /srv/mediawiki/workdir/extensions/Translate/scripts/export.php --lang=sr-ec,sr-el --target=. --offline-gettext-format=%GROUPID%_%CODE%.po --group ext-0-all

This is slow and takes a few minutes to run.

And then downloaded from:

Import of this large files has not been tested.

Great, thanks for doing this.
I did conversion.

sr-el file can be downloaded from https://kizule.ga/ext-0-all_sr-el.po

Be free to import it when you have free time. User account which you can use is KizuleBot. :)

Can you check if https://translatewiki.net/static/temp/dryrun.txt looks okay? I will fix the username before actual import.

Can you check if https://translatewiki.net/static/temp/dryrun.txt looks okay? I will fix the username before actual import.

Looks totally fine! Thank you!

Thank you so much, looks fine now!

Hello @Nikerabbit, can you please do same thing again, but for whole MediaWiki group? :)

Also you can delete sr-*.po files from /static/temp. :)

Done: mediawiki_sr-ec.po and mediawiki_sr-el.po in the same dir.

Thanks @Nikerabbit, I'll let you know when I'm done.

Done. You can import https://kizule.ga/mediawiki_sr-el.po and use KizuleBot again for a contributor.