When recording a suggestion, Localization Server should check if it isn't duplicated.

Sometimes different contributors translate twice the same string. If the string is short, like, say, "themes", both contributors will translate them as the same, thus creating duplicated suggestions.

Duplicated suggestions make the approval process a little harder, so they should be avoided.

Comments

gábor hojtsy’s picture

Agreed. Will work on this later.

hass’s picture

Subscribe. I estimate we have ~60% duplicated suggestions on the German translation server, too.

dami’s picture

Subscribe. From out experience, most of duplicate translations come from import. An alternative is to have a separate permission control on who can import new translations. We have had different ppl imported same setup po files multiple times... Maybe I should open a new feature request for this?

meba’s picture

I think I have a patch for this. Let me find it :)

meba’s picture

Status: Active » Needs review
StatusFileSize
new2.07 KB

Here we go...

gábor hojtsy’s picture

Status: Needs review » Needs work

- I'd say duplicates are strings which are is_active (visible on the user interface) and either suggestions or active translations. The first one is not included in the query.
- You use the "unusual" join notation which is not seen in Drupal much. Drupal mostly uses table aliases instead of repeating long table names, and uses LEFT JOIN, INNER JOIN and friends when needed to specifically mark the type of join.
- I am not entirely sure we should report when a duplicate is found, we just should not save it, or maybe just report a summary number as the other changes are also reported as a summary.

meba’s picture

Status: Needs work » Needs review
StatusFileSize
new4.26 KB

Rerolling, thanks for the suggestions.

dami’s picture

Status: Needs review » Needs work

Patch no longer valid against latest dev. But by looking at codes, I think there might be a problem: When checking duplicates, we need to look at both source and translated strings. There are cases where different source strings would have same translation. A submission is duplicate only when both source and translation strings are identical to existing ones, otherwise we are blocking valid translations.

meba’s picture

Status: Needs work » Needs review
StatusFileSize
new4.28 KB

Updated to HEAD and fixed a bug mentioned in #8

meba’s picture

StatusFileSize
new4.24 KB

Rerolling against DRUPAL-5 because UI changes were committed.

gábor hojtsy’s picture

Status: Needs review » Needs work

Just did a quick review, did not try the patch yet.

- There are whitespace problems from/around "Check for duplicate translation or suggestion.".
- '%d' in single quotes does not look nice in the patch.

gábor hojtsy’s picture

Status: Needs work » Fixed
StatusFileSize
new4.46 KB

I've taken on fixing the cosmetics of this patch mentioned above and even more (eg. bad function naming). Committed this new functionality to Drupal 6.x-dev. Thanks for your help!

Ps. This does not deal with duplicates in any way on import, although above several people mentioned they get duplicates from import in high quantities. Now we have a distinct permission to import stuff, but still, it might make sense to also tap this into the import flow.

hass’s picture

@Gabor: Just for information... is D5 version dead or going to die before it becomes final?

gábor hojtsy’s picture

hass: I was pushed in this module's public issue queue by several people to migrate development from Drupal 5 to Drupal 6 and even convert to Views 2. Drupal 6 has quite lots of changes, and maintaining two different sets of modules is a big no-go. I don't plan any new features to be added to the Drupal 5 version. The target for Drupal.org deployment is Drupal 6, so I am putting on considerable work there.

hass’s picture

That's fine - no problem to upgrade, but could you add this info to the project home, please. :-)

gábor hojtsy’s picture

Ok, marked the 5.x release unsupported and added a piece on 5.x support discontinuation to the project page.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.