Closed Bug 1027480 Opened 10 years ago Closed 10 years ago

[contacts] Custom tag placeholder is not localized

Categories

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

x86_64
Linux
defect
Not set
normal

Tracking

(blocking-b2g:2.0+, b2g-v2.0 fixed, b2g-v2.1 fixed)

RESOLVED FIXED
2.0 S4 (20june)
blocking-b2g 2.0+
Tracking Status
b2g-v2.0 --- fixed
b2g-v2.1 --- fixed

People

(Reporter: theo, Assigned: zbraniecki)

Details

(Keywords: l12y, late-l10n)

Attachments

(2 files)

Attached image Flame
Go to contacts, create a new contact, tap on a tag list for phone, e-mail...
"Custom tag" is not localized.

I don't understand why, because we already have "custom" and "custom.placeholder" strings in contact.properties, and it's using none of them.

You can notice that "Custom Tag" != "Custom tag", the former is the one in the HTML, the latter is in the l10n file.

When I flash gaia myself on top of the pvt build, I can read "Custom tag" instead of "Custom Tag", but it's still not localized.

Tested on both 2.0 and 2.1, Flame and Peak.

Flod, can you reproduce?
I can definitely confirm on Master, trying to figure out the code behind it.
Keywords: l12y
The code is here
https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/contacts/elements/tag.html#L16

In the .properties file we have both "custom" and "custom.placeholder".

If I remove the "custom" label, the placeholder gets correctly localized.

Stas, any clue why this is happening?
Flags: needinfo?(stas)
I remember Gandalf came across something like this in bug 992473 comment 58.  Is this bug a dupe of bug 1023608?
Flags: needinfo?(stas)
So, what happens here is that we have two l10n entities for two separate nodes with the same id "custom".

One is here: https://github.com/mozilla-b2g/gaia/blob/b0f74767bfb7e62c9cafca4b12b593b4912591ed/apps/communications/contacts/locales/contacts.en-US.properties#L47

Another is here: https://github.com/mozilla-b2g/gaia/blob/b0f74767bfb7e62c9cafca4b12b593b4912591ed/apps/communications/contacts/locales/contacts.en-US.properties#L80

How did it work before and how does it work right now, I have to say is beyond my understanding, but what I know is that if I change the latter to:

customTag.placeholder = Custom tag

and in https://github.com/mozilla-b2g/gaia/blob/b0f74767bfb7e62c9cafca4b12b593b4912591ed/apps/communications/contacts/elements/tag.html#L16

switch data-l10n-id to "customTag", then it fixes this bug.

Overall, the whole code around those cards nad customTag seems to be complex and prone to bugs (see bug 1023608 and bug 1023606), and I believe it needs some cleanup.
Note that if we need to update entities, we need to get that landed on 2.0 by *tomorrow*
Yup, we need this by tomorrow.
blocking-b2g: --- → 2.0?
Keywords: late-l10n
Assignee: nobody → gandalf
Attached file patch
NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
[Bug caused by] (feature/regressing bug #):
[User impact] if declined:
[Testing completed]:
[Risk to taking this patch] (and alternatives if risky):
[String changes made]:

Quick hack until we get the whole thing really clean is to just fix the entity ID duplication.
Attachment #8443277 - Flags: review?(etienne)
Attachment #8443277 - Flags: approval-gaia-v2.0?
Ouch, I'm too fast!

[Approval Request Comment]
[Bug exposed by] : bug 914414
[User impact] if declined: untranslated string
[Risk to taking this patch] : none?
[String changes made]: duplicated custom -> custom.placeholder
Status: NEW → ASSIGNED
Comment on attachment 8443277 [details] [review]
patch

Redirecting to a contact peer :)
Attachment #8443277 - Flags: review?(etienne) → review?(francisco)
Comment on attachment 8443277 [details] [review]
patch

Thanks for the contribution.
Attachment #8443277 - Flags: review?(francisco) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Why are we removing "custom" instead of renaming "custom.placeholder" to "customTag.placeholder"? 
Is "custom" not used anymore?
Attachment #8443277 - Flags: approval-gaia-v2.0? → approval-gaia-v2.0+
blocking-b2g: 2.0? → 2.0+
Need a checkin to 2.0
Keywords: checkin-needed
[v2.0 7516172] Merge pull request #20780 from zbraniecki/1027480-new-entity-for-contacts-custom-tag
Target Milestone: --- → 2.0 S4 (20june)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: