emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ebdb 26d632b 05/17: Finish ebdb-internationalize-addres


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 26d632b 05/17: Finish ebdb-internationalize-addresses
Date: Tue, 26 Sep 2017 17:15:33 -0400 (EDT)

branch: externals/ebdb
commit 26d632b00ba4b11e38698b11f06478e7791c11ba
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Finish ebdb-internationalize-addresses
    
    * ebdb-i18n.el (ebdb-internationalize-addresses): This function wasn't
      actually written before.
---
 ebdb-i18n.el | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/ebdb-i18n.el b/ebdb-i18n.el
index b94e9cd..ec54dc1 100644
--- a/ebdb-i18n.el
+++ b/ebdb-i18n.el
@@ -662,7 +662,19 @@ This method should return a new instance of CLASS.")
   address fields.
 
 Essentially this just means swapping out the string country names
-for their symbol representations.")
+for their symbol representations."
+  (let ((count 0))
+    (dolist (rec (ebdb-records))
+      (dolist (adr (ebdb-record-address rec))
+       (when (stringp (slot-value adr 'country))
+         (ignore-errors
+          (ebdb-record-change-field
+           rec adr
+           (clone adr :country
+                  (cdr (assoc-string (slot-value adr 'country)
+                                     (ebdb-i18n-countries)))))
+          (cl-incf count)))))
+    (message "Internationalized %d addresses" count)))
 
 (cl-defmethod ebdb-read :extra "i18n" ((class (subclass ebdb-field-address))
                                       &optional slots obj)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]