Import/export suggestions

markus_petrux - September 9, 2009 - 14:24
Project:Localization server
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

This is something that has been suggested in #566126: new catalan language for localize.drupal.org (comments #11, #12, #15, #16).

However, the translation server for Catalan language only has 187 suggestions pending approval, and it seems easier to just go ahead and validate or discard them than writing such a feature for l10n_server.

But, this might still be of interest for other translation groups. So, I'm opening this f.r. here to see how many of you out there need this, and if it really worths, then see if we can do something about it.

#1

Gábor Hojtsy - September 11, 2009 - 10:51

Given #570648: Add mass moderations screen for suggestions (+ user filtering) in place, I'm not sure teams need suggestions imported, since they can clean up their suggestions and import their translations right away.

BTW the reason we did not implement suggestion export originally is that one string can have many suggestions but *valid* .po files can only contain one translation per string. So there is no straightforward way to generate actually editable .po files (which PoEdit and similar tools can handle) of the suggestions. For pure export/import, theoretically, the l10n_server does not care about this invalidity.

#2

Damien Tournoud - September 16, 2009 - 15:05

Well, we need to attract more contributors. If we don't, people translating a module directly on localize.drupal.org cannot get the resulting .po file until the review team does its job.

I suggest we add a "export suggestion" select box:

* Ignore suggestions
* Export the latest suggestion of non translated strings
* Export the latest suggestion of all strings

A smart default would be "Export the latest suggestion of non translated strings".

#3

Gábor Hojtsy - September 16, 2009 - 16:49

The idea is to limit the import/export facility to translation teams and pregenerate packages of strings for the module releases. Otherwise generating .po files on the file on user request sounds like a non-scalable operation. Killes specifically asked us to not let mass-PHP-generated exports happen in protection of the underlying infrastructure.

#4

Gábor Hojtsy - September 16, 2009 - 16:51

That said, we can always export those .po files with the latest suggestions for untranslated strings posing as translations but marked #fuzzy. That would let the import software on a Drupal site possibly skip the fuzzy strings. Since the CVS procedure did not have a review cycle and we are adding that here, this would be similar to the previous CVS resulting .po files, which did not even had the "under review" strings marked in a standard way.

#5

Gábor Hojtsy - September 23, 2009 - 13:37

Just marked #478664: Need Export suggestions into one large po file from @podarok as a duplicate. Quoting:

I couldn't find possibility for exporting all suggested(unapproved) translation for feature offline reviewing

Editing via online interface not so usable as poedit(or any) for example and will be helpfull to export only suggested with feature import over

The gettext PO format does not allow for what you request. On the l10n_server, one string can have any number of suggestions, so exporting all suggestions would not be possible with gettext PO which only allows one translation per string to be exported (and does not have the notion of suggestions). Do you have any better idea on how to segment the suggestions?

Also, when you import .po files for strings which have existing translations/suggestions, the text you import via the .po file is treated as suggestions, so you'd get even more suggestions after the import is done. Maybe we need to have a refined workflow here.

To be clear, I understand editing and picking the proper suggestions outside the l10n_server might be more convenient for some, but I don't see a way to implement that properly.

#6

podarok - September 25, 2009 - 12:56

In my way i did a small SQL script for getting all the strings from database(csv) and after that reformatted it by hands into po file for importing into cvs.drupal.org
With a small change into script I can get all "suggestions" and put it into csv file
Possibly a good solution will be import-export via csv, not *.po ?

#7

podarok - October 17, 2009 - 12:22

SELECT `value`,`translation`
FROM YOUR_DBNAME.l10n_community_string join YOUR_DBNAME.l10n_community_translation
on YOUR_DBNAME.l10n_community_string.sid = YOUR_DBNAME.l10n_community_translation.sid

Result can be stored as CSV and easy converted to po file that contains all translated and suggested strings.

After importing that file into new location - all translated strings would be marked as duplicates but all suggestions - as suggestions(If You select that option)

 
 

Drupal is a registered trademark of Dries Buytaert.