From 5ceafa50055cfe587c87c2410a01422763e04528 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 13 Feb 2017 22:52:03 -0500 Subject: [PATCH] (js) Localize mail, phone, url and address types Fixes #4030 --- NEWS | 1 + UI/Templates/ContactsUI/UIxContactEditorTemplate.wox | 8 ++++---- UI/Templates/ContactsUI/UIxContactViewTemplate.wox | 8 ++++---- UI/WebServerResources/js/Contacts/Card.service.js | 6 ++++++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 24ff77fbb..18056b0c6 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Bug fixes - [web] ignore mouse events in scrollbars of Month view (#3990) - [web] fixed public URL with special characters (#3993) - [web] keep the fab button visible when the center list is hidden + - [web] localized mail, phone, url and address types (#4030) - [eas] improved EAS parameters parsing (#4003) - [eas] properly handle canceled appointments diff --git a/UI/Templates/ContactsUI/UIxContactEditorTemplate.wox b/UI/Templates/ContactsUI/UIxContactEditorTemplate.wox index af79827dc..20a35a0e7 100644 --- a/UI/Templates/ContactsUI/UIxContactEditorTemplate.wox +++ b/UI/Templates/ContactsUI/UIxContactEditorTemplate.wox @@ -141,7 +141,7 @@ - {{ type }} + {{ type.capitalize() | loc }} @@ -219,7 +219,7 @@ - {{ type }} + {{ type.capitalize() | loc }} @@ -250,7 +250,7 @@ - {{ type }} + {{ type.capitalize() | loc }} @@ -282,7 +282,7 @@
- {{ type }} + {{ type.capitalize() | loc }} diff --git a/UI/Templates/ContactsUI/UIxContactViewTemplate.wox b/UI/Templates/ContactsUI/UIxContactViewTemplate.wox index 4653e8a1b..baf79a1c2 100644 --- a/UI/Templates/ContactsUI/UIxContactViewTemplate.wox +++ b/UI/Templates/ContactsUI/UIxContactViewTemplate.wox @@ -104,7 +104,7 @@
- +
@@ -121,7 +121,7 @@
- + @@ -130,7 +130,7 @@
- + @@ -139,7 +139,7 @@
- +
diff --git a/UI/WebServerResources/js/Contacts/Card.service.js b/UI/WebServerResources/js/Contacts/Card.service.js index d46829cb8..0fea2dd97 100644 --- a/UI/WebServerResources/js/Contacts/Card.service.js +++ b/UI/WebServerResources/js/Contacts/Card.service.js @@ -161,6 +161,12 @@ this.notes = _.map(data.notes, function(note) { return { 'value': note }; }); else if (!this.notes || !this.notes.length) this.notes = [ { value: '' } ]; + // Lowercase the type of specific fields + angular.forEach(['addresses', 'phones', 'urls'], function(key) { + angular.forEach(_this[key], function(o) { + if (o.type) o.type = o.type.toLowerCase(); + }); + }); // Instanciate Card objects for list members angular.forEach(this.refs, function(o, i) { if (o.email) o.emails = [{value: o.email}];