]> source.dussan.org Git - nextcloud-server.git/commitdiff
Contacts: l11n for geo autocomplete. Not sure if it works though.
authorThomas Tanghus <thomas@tanghus.net>
Tue, 3 Apr 2012 06:13:10 +0000 (08:13 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Tue, 3 Apr 2012 06:13:10 +0000 (08:13 +0200)
apps/contacts/js/contacts.js
apps/contacts/templates/index.php

index b72f3c9a6785d8bdfb5932561b548103f9c1693c..cc4da5837e0483567aa5ac4ee64a324a42464728 100644 (file)
@@ -919,6 +919,7 @@ Contacts={
                                                                                                        featureClass: "P",
                                                                                                        style: "full",
                                                                                                        maxRows: 12,
+                                                                                                       lang: lang,
                                                                                                        name_startsWith: request.term
                                                                                                },
                                                                                                success: function( data ) {
@@ -937,7 +938,7 @@ Contacts={
                                                                                },
                                                                                minLength: 2,
                                                                                select: function( event, ui ) {
-                                                                                       if(ui.item) {
+                                                                                       if(ui.item && $('#adr_country').val().trim().length == 0) {
                                                                                                $('#adr_country').val(ui.item.country);
                                                                                        }
                                                                                        /*log( ui.item ?
@@ -961,6 +962,7 @@ Contacts={
                                                                                                        featureCode: "PCLI",
                                                                                                        /*countryBias: "true",*/
                                                                                                        /*style: "full",*/
+                                                                                                       lang: lang,
                                                                                                        maxRows: 12,
                                                                                                        name_startsWith: request.term
                                                                                                },
index af159ce9c602ac1c39dda9fb6af42764a524845f..d68dd68f60529cb100b65342c4291a3873aa2f47 100644 (file)
@@ -1,6 +1,7 @@
 <script type='text/javascript'>
        var totalurl = '<?php echo OC_Helper::linkToAbsolute('contacts', 'carddav.php'); ?>/addressbooks';
        var categories = <?php sort($_['categories']); echo json_encode($_['categories']); ?>;
+       var lang = '<?php echo OC_Preferences::getValue(OC_User::getUser(), 'core', 'lang', 'en'); ?>';
 </script>
 <div id="controls">
        <form>