Merge lp:~adiroiban/launchpad/bug-97293 into lp:launchpad

Proposed by Adi Roiban
Status: Merged
Approved by: Henning Eggers
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~adiroiban/launchpad/bug-97293
Merge into: lp:launchpad
Diff against target: 12 lines (+2/-0)
1 file modified
lib/canonical/launchpad/javascript/lp/lp.js (+2/-0)
To merge this branch: bzr merge lp:~adiroiban/launchpad/bug-97293
Reviewer Review Type Date Requested Status
Henning Eggers (community) code Approve
Review via email: mp+15391@code.launchpad.net

Commit message

Copying plural values will also enable the required radio buttons.

To post a comment you must log in.
Revision history for this message
Adi Roiban (adiroiban) wrote :

= Bug 97293 =
== Proposed fix ==
When you click the Copy text icon for plural form, beside filling the required fields, the corresponding radiobuttons are also selected

== Implementation details ==

In the same JS function that copies the plural data, the corresponding radiobuttons state is changed.

== Demo and Q/A ==

Log in as admin (so that you will have edit rights) and go to evolution translations in Ubuntu

https://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/ro/16/+translate

Click Copy text icon after "English plural:" .

The english plural value should be copied in all Romanian plural fields and they should be also selected.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/canonical/launchpad/javascript/lp/lp.js

== JSLint notices ==
No handlers could be found for logger "bzr"
jslint: Lint found in '/home/adi/launchpad/lp-branches/bug-97293/lib/canonical/launchpad/javascript/lp/lp.js':
Line 529 character 18: Be careful when making functions within a loop. Consider putting the function in a closure.
                });

jslint: 1 file to lint.

Revision history for this message
Henning Eggers (henninge) wrote :

Thank you for this little fix that will make the life of translators easier!

As discussed on IRC, it would be better to use Y.get instead of document.getElementById, but since this file has not really been updated to use YUI yet, the change is consistent with the rest of the code.

I filed bug 490398 about updating the file.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/javascript/lp/lp.js'
2--- lib/canonical/launchpad/javascript/lp/lp.js 2009-11-24 09:30:01 +0000
3+++ lib/canonical/launchpad/javascript/lp/lp.js 2009-12-07 08:08:14 +0000
4@@ -643,7 +643,9 @@
5 // skip when x is 0, as that is the singular
6 for (var x = 1; x < nplurals; x++) {
7 var to_id = to_id_pattern + x + "_new";
8+ var to_select = to_id_pattern + x + "_new_select";
9 copyInnerHTMLById(from_id, to_id);
10+ document.getElementById(to_select).checked = true;
11 }
12 }
13