Closed Bug 1172768 Opened 7 years ago Closed 7 years ago

Tip for import contact(s) for loop is not correctly shown

Categories

(Hello (Loop) :: Client, defect, P2)

defect
Points:
1

Tracking

(firefox41 verified)

VERIFIED FIXED
mozilla41
Iteration:
41.3 - Jun 29
Tracking Status
firefox41 --- verified

People

(Reporter: leichixian, Assigned: standard8)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:41.0) Gecko/20100101 Firefox/41.0
Build ID: 20150608030201

Steps to reproduce:

1. Click loop button
2. Click import form google and wait for import


Actual results:

The tip "{{total}} contact was successfully imported.;{{total}} contacts were successfully imported." Here total is the number, which in my case is zero.


Expected results:

Should only show "0 contact was successfully imported." without ";0 contacts were successfully imported."
Severity: normal → minor
Component: Untriaged → Client
Product: Firefox → Loop
Simple falsey value bug. I knew we'd fixed some of this before, but we obviously didn't handle/test the num=0 case.
Attachment #8617192 - Flags: review?(mdeboer)
And do you mind improve import function to sync? In order to report this bug I tested with a contact "test",but now I can't remove it...
Comment on attachment 8617192 [details] [diff] [review]
Loop's desktop plural form handling doesn't handle zeros very well.

Review of attachment 8617192 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/loop/content/libs/l10n.js
@@ +38,5 @@
>  
>    // translate a string
>    function translateString(key, args, fallback) {
> +    var num;
> +    if (args) {

Alternative: `if (args && ("num" in args)) {`
Attachment #8617192 - Flags: review?(mdeboer) → review+
Assignee: nobody → standard8
Status: UNCONFIRMED → ASSIGNED
Iteration: --- → 41.3 - Jun 29
Points: --- → 1
Ever confirmed: true
Flags: qe-verify+
Flags: firefox-backlog+
Priority: -- → P2
https://hg.mozilla.org/mozilla-central/rev/04d1294656a1
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Reproduced the initial issue using old Nightly from 2015-06-09, verified that the issue is fixed using Firefox 41 beta 3 on Windows 7 64-bit, Windows 10 32-bit and Mac OS X 10.10.4. Was unable to verify this on Ubuntu because of bug 1106854.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.