New merge tool needed

New merge tool needed

av Vadim Dvorovenko -
Antall svar: 15

Hello, David. Recent work on Russian translation showed me one great problem.

Now we have diffrerncies in russian in more than 1000 string between 2.0 and 2.1 on strings that are equal in english. This is because we made a lot of changes to 2.0 version after creation of 2.1 branch. The problem beacomes harder with appearance of 2.2 branch, because we have to think of it too.

Standart merge tool does not helps, because strings was alredy translated, and merge tool searches only for new strings.

Branch compare tool does not helps, because it only shows difference, and i need to manually copy 1000 strings from 2.0 branch to 2.1 (and then 1000 times from 2.1 to 2.2).

The tool we need should take strings, that are equal in english, but different in e.g. Russian. For each string needs to take branch with more recent translation and apply this translation to another branch.

I hope you can help us

Som svar til Vadim Dvorovenko

Re: New merge tool needed

av Vadim Dvorovenko -

On the other hand, maybe it's better just to modify current merge tool, to take modified strings into account. In that case new strings should be staged only if english strings have not been changed.

Som svar til Vadim Dvorovenko

Re: New merge tool needed

av David Mudrák -
Bilde av Language pack maintainers

I agree this is the usability problem and it makes translators' work significantly harder. I was facing this recently while working on the Czech lang pack, too.

The easiest way for me would probably be to add a new option into the "Compare strings at two branches" stage tool. It would look like this:

If a difference is detected:
a) Stage both versions
b) Stage the more recent string into the other branch

Using the b) option, the translator could perform the following operation:

  • translate on, let us say, 2.1 branch - adding new strings and modifying the current ones
  • the stage is committed
  • use the "Merge strings from another branch" tool to merge new translations to 2.2 branch
  • the stage now contains merge result and must be committed again
  • use the "Compare strings at two branches" tool (with the new option set to b) to detect differences between 2.1 and 2.2. The recent modifications in 2.1 would be detected. But instead of staging both versions (as it does now), it would just stage the more recent version (which will probably be the change on 2.1) to the other branch (which would be 2.2 in this case).
  • the stage now contains the updates and the third commit makes the branches synced

Although it still requires more steps to do manually, it would help.

Additionally, there might be a button at the stage screen called "Propagate changes to other branches" (with versions selector next to it). using it, all currently staged modifications would be applied to all selected branches. This would be handy when the translators accepts someone's contribution and wants it to be applied to all branches, not just the one suggested by the contributor. Such a button would actually prevent many differences between branches to even appear as the change would be applied to all selected branches. The workflow would be like:

  • translate on, let us say, 2.1 branch - adding new strings and modifying the current ones
  • on the stage screen, before the stage is committed, the versions 2.0, 2.1 and 2.2 are selected and the replication button is pressed (hey - the "replicator" is a cool name for this feature rekker tunge)
  • the stage screen would be reloaded and it now contains the changes applied to all three branches
  • the single commit would store the changes persistently

I like this. What others think?

Som svar til David Mudrák

Re: New merge tool needed

av Andrea Bicciolo -
Bilde av Language pack maintainers

Hi David, if I correctly understand your suggestions, that would definitely reduce the curernt workload to propagate changes on other branches, especially when rewording strings or better translations are committed.

However, there is a case where that could not apply in mass , and it is when  branches have different translations for the same string. Very rare, but it occurs.

Som svar til Andrea Bicciolo

Re: New merge tool needed

av David Mudrák -
Bilde av Language pack maintainers
Ah, you are right. The "Propagate change" button should do its job only when both the English and the translated strings were the same on both branches. Only in that case we can expect that the translator wants the change to be applied, too.

Thanks Andrea!
Som svar til Vadim Dvorovenko

Re: New merge tool needed

av David Mudrák -
Bilde av Language pack maintainers

The new "Propagate translations" tool was just deployed to the production. It allows language pack maintainers to propagate staged modifications so they do not need to do it using the Merge tool later.

Simply said, the new tool iterates over the list of staged modifications and tries to apply them to each of the selected target branches.

Maintainers are supposed to run propagation before they commit their stage.

In combination with users' contributions, it is better to

  • review the submitted translation first and fix corrections first
  • then propagate the final version to all 2.x branches
  • then commit all the stage at once

This will hopefully minimise the need to merge branches using separate commits.

Please note that MDLSITE-1502 is still in progress as I am going to add the new mode into the Compare tool yet.

Som svar til David Mudrák

Re: New merge tool needed

av Mikael Kurula -

David,

Thanks for the propagate tool, it's great! I'm an official language pack maintainer and I now have a question about the tool.

A contributor sent a few strings for Moodle 2.2. The contribution is fine, but when I click Propagate I only get the following message: "There are 4 staged strings, 4 of them can be committed. No translations propagated".

What is the reason for this?

Friendly greetings,

Mikael

Som svar til Mikael Kurula

Re: New merge tool needed

av David Mudrák -
Bilde av Language pack maintainers

Hi Mikael. Glad to see you found the tool useful.

WRT your question, please check manually how those staged strings look at other branches. Do they even exist there? E.g. new strings for 2.3 can't be propagated because they simply do not exist in previous versions. If they do, did their English wording and the translation match across versions? Note that the propagator is pretty picky. It refuses to apply (propagate) the translation if there is a chance that the string has changed between two versions (in both English or your language).

Som svar til David Mudrák

Re: New merge tool needed

av Mikael Kurula -

Thanks! I was just wondering if it was something along these lines, but I didn't want to mislead you with speculations. It could also have been because of copyright issues etc. that the maintainer can only propagate strings translated by him/herself.

Yes, the strings exist and are the same in all versions. They were not translated previously in any version, see e.g.  [pluginname,block_blog_menu] in the language Finland Swedish.

A small feature request: If the propagator is picky, would it be difficult to display an informative error message to the user about what went wrong?

I've been propagating my own translations quite a lot, mostly (incorrectly) before submitting them to the maintainers for review, but this is the first time I run into problems.

Som svar til Mikael Kurula

Re: New merge tool needed

av David Mudrák -
Bilde av Language pack maintainers

Weird. I just tried it myself and it seems to work for me as expected.

  1. I used the filter settings http://lang.moodle.org/local/amos/view.php?t=1339808989&v=2300%2C2200%2C2100%2C2000&l=sv_fi&c=block_blog_menu&s=&d=pluginname to see that string on all 2.x branches
  2. I modified the 2.2 translation to get it staged
  3. I went to the Stage page
  4. Clicked "Propagate" (all versions checked)
  5. The stage now contains 4 strings, 3 of them were added by the propagator

Can you please try these steps yourself?

p.s. Thanks to this discussion, I realized that the Propagate tool was available for contributors, too. I just fixed that. The propagator is purely intended for lang pack maintainers as it is supposed to be used just prior the commit. If the contributor submits a string change already propagated, and the reviewer want to amend it slightly, they have to fix it at all branches. The expected workflow is that contributors submit their translation for a single version only and the maintainer takes care of the rest.

Som svar til David Mudrák

Re: New merge tool needed

av Mikael Kurula -

Thanks for your interest in this issue!

I now tried the steps you described for all four strings in the contribution, and they worked as they should for all the individual strings. However, the propagator fails for me on trying to propagate [pluginname,block_blog_menu] and [pluginname,block_blog_tags] at the same time.

About workflow: It's also nicer and easier to review contributions that don't have four copies of every string.

Som svar til Mikael Kurula

Re: New merge tool needed

av David Mudrák -
Bilde av Language pack maintainers

Mikael, thanks for spotting this bug in the propagate tool and reporting it!. I just fixed AMOS code and deployed it to this site so it should work as expected now.