Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 976663 - Contact merge: number and email tags are not localized in details of suggested duplicated contact #16686

Merged
merged 1 commit into from Feb 28, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/communications/contacts/js/contacts_matching_ui.js
Expand Up @@ -355,7 +355,10 @@ if (!contacts.MatchingUI) {
if (isMatch(matchings, aField, fieldValue)) {
item.classList.add('selected');
}
item.textContent = fieldValue.type + ', ' + fieldValue.value;
navigator.mozL10n.localize(item, 'itemWithLabel', {
label: _(fieldValue.type),
item: fieldValue.value
});
matchingDetailList.appendChild(item);
break;
case 'adr':
Expand Down
Expand Up @@ -70,6 +70,11 @@ other = Other
custom = Custom tag
# Note: For localizers. This tag indicates the current address
current = Current
# LOCALIZATION NOTE(itemWithLabel): Parameters in this string will be replaced
# at run-time: {{label}} is the label associated to phone number or email,
# item is the number/email itself. Examples for English: "Home, +123456789" or
# "Work, foo@example.com".
itemWithLabel = {{label}}, {{item}}

# Hidden information, for screen readers
exit = Exit
Expand Down
10 changes: 7 additions & 3 deletions apps/communications/contacts/test/unit/mock_l10n.js
Expand Up @@ -9,9 +9,13 @@ var MockMozL10n = window.navigator.mozL10n = {
var out = key;

if (params) {
Object.keys(params).forEach(function(id) {
out += params[id];
});
if (key == 'itemWithLabel') {
out = params.label + ', ' + params.item;
} else {
Object.keys(params).forEach(function(id) {
out += params[id];
});
}
}

return out;
Expand Down