Closed Bug 898241 Opened 11 years ago Closed 11 years ago

[Buri][Contacts][Language]"Mobile" can't be translated correctly

Categories

(Firefox OS Graveyard :: Gaia::Contacts, defect, P1)

defect

Tracking

(blocking-b2g:leo+, b2g18 verified, b2g18-v1.0.1 affected, b2g-v1.1hd fixed)

RESOLVED FIXED
blocking-b2g leo+
Tracking Status
b2g18 --- verified
b2g18-v1.0.1 --- affected
b2g-v1.1hd --- fixed

People

(Reporter: sync-1, Assigned: bkelly)

Details

(Whiteboard: [ c= p=1 s=2013.08.09 ])

Attachments

(5 files)

AU_LINUX_GECKO_ICS_STRAWBERRY.01.01.00.019.164
 Firefox os  v1.1
 Mozilla build ID:20130715070218
 
 
 
 
 Created an attachment (id=470246)
 pic
 
 DEFECT DESCRIPTION:
  "Mobile" can't be translated correctly
  REPRODUCING PROCEDURES:
  1.New contact A,with phone numbers(such as:123456),Set language as English
  2.Dial screen->input some numbers(such as:654321)->Add to existing contact->Select Contact A->Update
  3.Change language to Francais->Back to Contacts screen->Edit Contact A->It displayed "Mobile" as usual---->KO
  EXPECTED BEHAVIOUR:
  It should stay the same
  ASSOCIATE SPECIFICATION:
 
  TEST PLAN REFERENCE:
 
  TOOLS AND PLATFORMS USED:
 
  USER IMPACT:
  Mid
  REPRODUCING RATE:
  5/5
  For FT PR, Please list reference mobile's behavior:
blocking-b2g: --- → leo?
Clone from brother
Attached file log
Clone from brother
Attached image pic
Component: Gaia::Calendar → Gaia::Contacts
please update status,thanks.
Isn't 'mobile' also what we want to show when in French?
Flags: needinfo?(felash)
Keywords: qawanted
That's what I'd say but will ask Théo as he does the translation.

BTW the 'expected behavior' seems to be wrong.

Also, does it work for other locales ?
Flags: needinfo?(felash) → needinfo?(theo.chevalier11)
Attached image Bug fr > es
This bug seems not related to French, I updated the contact while in French, then I changed language to Spanish, and as you can see, on three fields, only one has been updated to the current locale.

But, for French we could use "mobile" too, yes. We use both: http://transvision.mozfr.org/?repo=central&sourcelocale=en-US&locale=fr&search_type=strings&recherche=mobile
Flags: needinfo?(theo.chevalier11)
Sounds like comment 8 concludes this probably related to a language change while the contacts app is open is causing certain text fields to not get updated to the new language.
Keywords: qawanted
Another possibility is that the reporter does not use a multilocale build, and therefore gets incomplete locales from Gaia repository.

I don't know enough about this app. Jose, could you take this and see if this should be correctly translated with the current code ?
Flags: needinfo?(jmcf)
I think I see the problem.

The "type" string is being created as "Mobile" instead of "mobile" when the tel field is updated from an activity.  This in turn causes the code to think we are dealing with a custom type entry which should not be translated.

This is in gaia/master and looks like it will effect email addresses updated via activity as well.

I'll have a pull request ready shortly.  I just want to add a test case.
Assignee: nobody → bkelly
Flags: needinfo?(jmcf)
Whiteboard: [ c= p=1 s=2013.08.09 ]
Status: NEW → ASSIGNED
Here is a pull request that fixes the issue.  It uses the field type string instead of the current translation for that type when creating new tel and email fields.

I investigated writing a unit test, but I did not see an easy way to trigger the activity path with our currently infrastructure.  The input I got from #gaia was to wait for the new integration test framework that should be available soon.

I tested both the update activity for both the tel and email fields on my device.
Attachment #782784 - Flags: review?(jmcf)
Attachment #782784 - Attachment mime type: text/plain → text/html
we have unit tests for the SMS activity handler there : https://github.com/mozilla-b2g/gaia/blob/master/apps/sms/test/unit/activity_handler_test.js#L89

This mocks the setMessageHandler function so that we can programmatically trigger an activity. Works quite well :)
(In reply to Ben Kelly [:bkelly] from comment #11)
> I think I see the problem.
> 
> The "type" string is being created as "Mobile" instead of "mobile" when the
> tel field is updated from an activity.  This in turn causes the code to
> think we are dealing with a custom type entry which should not be translated.
> 
> This is in gaia/master and looks like it will effect email addresses updated
> via activity as well.
> 
> I'll have a pull request ready shortly.  I just want to add a test case.

we change the "Mobile" to "mobile" with function "toLowercase", but it still can't be translated.
(In reply to buri.blff from comment #14)
> (In reply to Ben Kelly [:bkelly] from comment #11)
> > I think I see the problem.
> > 
> > The "type" string is being created as "Mobile" instead of "mobile" when the
> > tel field is updated from an activity.  This in turn causes the code to
> > think we are dealing with a custom type entry which should not be translated.
> > 
> > This is in gaia/master and looks like it will effect email addresses updated
> > via activity as well.
> > 
> > I'll have a pull request ready shortly.  I just want to add a test case.
> 
> we change the "Mobile" to "mobile" with function "toLowercase", but it still
> can't be translated.

If you mean you changed "Mobile" to "mobile" by editing the contact in the app, then this is inadequate.  It requires code changes.  See the pull request in comment 13.
Sorry, I meant the pull request in comment 12.  Also, I apologize if my earlier comment was unclear.  Thanks for trying to resolve on your end.
(In reply to Julien Wajsberg [:julienw] (PTO 15th -> 28th July) from comment #13)
> we have unit tests for the SMS activity handler there :
> https://github.com/mozilla-b2g/gaia/blob/master/apps/sms/test/unit/
> activity_handler_test.js#L89
> 
> This mocks the setMessageHandler function so that we can programmatically
> trigger an activity. Works quite well :)

Thanks.  I'll check it out, time permitting.  (I'm supposed to be working other perf related bugs...)
Comment on attachment 782784 [details]
Pull request at https://github.com/mozilla-b2g/gaia/pull/11233

review positive, but I believe we should open a follow-up bug to report that (as Jason said in another comment) if the language changes and you are on the contact details page, the labels for email or telephone are not translated.

thanks, Ben
Attachment #782784 - Flags: review?(jmcf) → review+
Thanks Jose.  I believe bug 898992 probably already captures the failure to update when the language is changed while the app is running.
Merged:

  https://github.com/mozilla-b2g/gaia/commit/9a802a4b2e6737b914bcab73376f097761875081

By the way, I should also probably note that this fix will only correct the translation for new phone numbers added via the activity update.  If you have a phone number that was added with the previous, broken code it will remain mis-translated.  To test the new, fixed code you need to delete the phone number from the contact and re-add it from the dialer app.  Sorry for the inconvenience.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
IS this a regression ? Adding qawanted to see what the behaviour is in 1.0.1.
Keywords: qawanted
agreed with comment 22, same behavior on v1.0.1

retested on Unagi 7/29 v1.0.1 build, tested with "Deutsch" - "Mobile" is untranslated

Build ID: 20130729070220
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1/rev/9c62297d11b0
Gaia: 054cdc27404e2daca91d3065d9783681032b2151
Platform Version: 18.0
Keywords: qawanted
Blocking since it seems low risk and reduces confusion, let's uplift to v1.1
blocking-b2g: leo? → leo+
Uplifted 9a802a4b2e6737b914bcab73376f097761875081 to:
v1-train: feed8ab34e5fea20ac8f2f33af883123797f7278
(In reply to John Ford [:jhford] -- please use 'needinfo?' instead of a CC from comment #25)
> Uplifted 9a802a4b2e6737b914bcab73376f097761875081 to:
> v1-train: feed8ab34e5fea20ac8f2f33af883123797f7278

Dear John Ford:
   As the commit 20 say, the patch can't resolve this pr completely.
   is the merged patch diffrent from commit 20?
(In reply to buri.blff from comment #26)
> (In reply to John Ford [:jhford] -- please use 'needinfo?' instead of a CC
> from comment #25)
> > Uplifted 9a802a4b2e6737b914bcab73376f097761875081 to:
> > v1-train: feed8ab34e5fea20ac8f2f33af883123797f7278
> 
> Dear John Ford:
>    As the commit 20 say, the patch can't resolve this pr completely.
>    is the merged patch diffrent from commit 20?

Answering for John since he just took care of the uplift.

Are you asking for additional changes to avoid the need to delete and re-add phone numbers?  It was not clear this was needed.  Writing something to detect and correct the condition could be problematic as the user can legitimately add any text for a custom field.  Also, it raises the issue of when is the correction done and how long do we need to maintain the fixup heuristic.  Is it possible to simply have a support FAQ providing the steps to correct the condition for affected contacts?

Or are you asking about the additional work I bug 898992?
The uplifted patch is quite never different than the master patch.

As Ben, I think it's not worth the work correcting the problem after the fact. Even if there is a bug the user will get used to this, and we can't change it automatically, it may disturb him. I really think a manual action is preferable here.

Ben, we can probably ask UX though, and file a new bug if necessary ?
(In reply to Julien Wajsberg [:julienw] from comment #28)
> The uplifted patch is quite never different than the master patch.

I had difficulty parsing this sentence.  :-)  I did go back and verify the uplift is the same as the original master commit.  I also tested on v1-train to verify that the fix does indeed work there.

> Ben, we can probably ask UX though, and file a new bug if necessary ?

I agree.  If manually correcting the data in the contacts DB is not acceptable, please open a new bug to indicate we need a data cleanup procedure.

Thank you.
v1.1.0hd: feed8ab34e5fea20ac8f2f33af883123797f7278
The issue does not reproduce in Buri v1.1. But reproduces on leo device for v1.1.
Please see screenshot attached. 

Buri Build ID: 20130809041203
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18/rev/45480132106b
Gaia: c9d0901564cf6f50e375ab48e4124b8378a2e246
Platform Version: 18.1

Leo Build ID: 20130809041203
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18/rev/45480132106b
Gaia: c9d0901564cf6f50e375ab48e4124b8378a2e246
Platform Version: 18.1
Attached image screenshot - 8/9/2013
Deepa: we don't do any migration in this patch. Therefore you need to test with adding contacts _after_ the patch is applied. Is it what you did on the leo device ?
Hello Julien, 

Today, I tested both on leo and buri. Manually creating the contact and edit them. The string "Mobile" is translated in French as "Portable". 

Leo Build ID: 20130812041203
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18/rev/36bbc5943448
Gaia: c60e3507d9df160e006d2e25967d26df2dc543cb
Platform Version: 18.1

Other notes:
This is what I did the other day with leo device. When importing contacts from the SIM, the user sees the string "Mobile" untranslated. LEt me know if you want me to report a separate bug for this issue.
(In reply to Deepa Subramanian from comment #34)
> Other notes:
> This is what I did the other day with leo device. When importing contacts
> from the SIM, the user sees the string "Mobile" untranslated. LEt me know if
> you want me to report a separate bug for this issue.

I think that is worth writing a separate bug.  It looks like when we import a contact we simply copy whatever the vcard type is over into the contact.  If the vcard type is "Mobile", then it will not get translated as the magic l10n type is "mobile".
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: