No announcement yet.

Issue with autocomplete lists for address field

  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue with autocomplete lists for address field

    Hello guys,
    Few weeks ago i've discover autocomplete lists which you can all find in Administration -> Settings.
    I'm not sure if that is correct approach to let users create their own lists(because for example list of country is pretty static).

    But okay, i accepted that. I've decided to try that. I installed new instance of EspoCRM and i added few countries. But of course then i remembered that my users are multilanguage so i need to create these countries in autocomplete list in english and in polish languages.

    So in admin section i added country codes and after that i tried to translate them to full names depending on user language(english/polish).
    But i couldn't find it in translate section. I checked files in custom directory(after also in application) and i couldn't find these strings.

    Any ideas how can i translate that for many languages?
    Maybe yuri could help?

  • #2
    Hello Emilod
    it s in config.php
    so how translate ..I don’t know


    • #3
      Just a thought, if you change the default language of your PC then type in the Polish words then change back, does it stick in EspoCRM?


      • #4
        item shiiiiit, you're right man. I don't know what other users are thinking but i think it should be translateble.


        • #5
          Hello Emillod,

          i know, when some "persoon" have asked this feature, Yuri have make it quickly .. for me we need to move this to language file .. but certainly not easy to develop.. maybe "@telecastg"

          But really complicate with translation, in belgium we have 4 language .. so it's for me crazy :s

          One anectdote : in brussels, we have a "route arround brussels" .. but the route (for car +- 50km) .. pass trough 2 language .. so you see "Bergen"="Mons" ... "Luik"="Liege" .. "Antwerpen"="Anvers".. so i have in my life help many car driver loose because he will go to "Mons" .. but see always "Bergen" .. so the guy make 50km for nothing ... a "loop arround brussels"
          of course, now we have gps

          Last edited by item; 09-28-2020, 07:32 PM.


          • #6
            I'm not sure how it's working but here in Poland we have one main language + dialects. And i can add one name for main polish language + other for dialects(something like english UK, english US etc.). So i think you should check is there a possibility to add another language in translation.

            I think it shouldn't be a big issue.

            Back to issue - i understand that most of settings from that section are in config.php file, but it would be great if we could manage this field like other multi-enum..


            • #7
              shot in the dark for windows?

              wondering how much needs to be translated and would any be automated, anyway might help with the text format when translating

              Click image for larger version

Name:	windows 10 add a language.png
Views:	522
Size:	59.9 KB
ID:	63024
              windows 10, uwp, globalization, localizability, localization


              • #8
                Hi guys,

                Luckily I don't have to deal with multi-language (yet) but I can understand your suffering. I had a quick look and it seem to be Translatable using the Label manager.

                Am I thinking about it wrong and this isn't the solution?

                Please check: /#Admin/labelManager/scope=Account
                then Options.

                The problem here is the "Address", I'm not sure where is being hidden at the moment. But any field which I use the Options (auto-complete popup) feature it is available to be translated in another language.

                Initially I was thinking, maybe you can use Conditional Formatting/Display, but Option isn't available to use that feature.
                Last edited by espcrm; 09-29-2020, 06:24 AM.


                • #9
                  espcrm thanks for good wishes, but i think in this specific case only yuri could help


                  • #10
                    Hello guys,
                    i've created extension which will add enum list with countries instead of varchar for country field
                    Hello guys, we've published new extension which will allow you new type of field address. There is one difference, you don't have to enter country in varchar field, we've prepared enum list with all countries. We've prepared 29 translations, all languages which EspoCRM use are covered. This extension is a response to few


                  • #11

                    I'm thinking about creating similar field for states/regions. I've already received one request. One user requested a field which will contain enum list of states in USA.
                    I want to create that in some universal way, like i did with countries. I think there are ~250 countries in 29 languages. I believe that states/regions would be like 5-10 x more.
                    It'll take a lot of time to add that(i coudn't even find a list )..

                    Any ideas?
                    User which requested that propose to create something like condition, if addressCountry = USA, then field addressState = enum with states. If country =/= USA, then type of field will be Varchar.
                    I don't think it's a good idea..


                    • item
                      item commented
                      Editing a comment
                      Hello emillod,
                      your sample is i thing wrong way. (and google translate)
                      why don't use "googlemap / openstreetmap /" api or another api free ?

                      your extension is i think very hard to maintain .. don't rewrite what other do perfecly and opensource

                      my 2 cents idea.


                  • #12
                    item i'm not sure if that's a good idea. Sure, we could create some kind of field which will allow users to search for an address in external database like google maps, but as far as i remember, Google Maps is taking money for using google maps api, like with google translate api.

                    If i'm correct, i don't want to give users something which will cause some problems.


                    • espcrm
                      espcrm commented
                      Editing a comment
                      Agree, the extension should not need to rely on an external services to retrieve data.

                  • #13
                    Hello emillod ,

                    I agree with item that having an enum field for states linked to every country would be a lot of work even for just one language, let alone translating it to all languages included in Espo.

                    One suggestion would be to develop a "dynamic enum" field (kind of a mix between enum and array) where the user starts typing to have autocomplete helping find the correct option or if not, the user can add a new item on the fly and this will build a new set of options for such field.

                    This way, a user would start with no pre-defined States but eventually would have a complete list in her or his preferred language(s) and this list would be stored as an array in the database instead of as a very very long metadata json object.

                    I am planning to do something similar to develop a way to create new records using "autocomplete" to pre-fill fields, similar to the way that Quicken allows you to choose a payer for new transaction and then the system pre-fills all the transaction fields based on the payers most recent transaction. My idea is very green but I will gladly share with you any progress


                    • #14
                      telecastg sure, if you have any idea how to do that in other way(like google maps, but without requirement of adding credit card to google for that) i'll be more than happy to collaborate.
                      For now there is only possibility for using AddressField with Countries enum

                      Now i'll work on other extensions, i have to finish paypal integration, because i can't see the end of that.. I'm only extending list of features right now..
                      I've started with only processing orders, right now extension support modules: orders, subscriptions, webhooks + i'm already working on invoices. And i think that i'll finish on refunds, payouts


                      • item
                        item commented
                        Editing a comment
                        Hello emillod,
               is free for 800call/month... and no credit card.
                        i use it for geolocalise Account.. "onCreate" only (so only one call) and fill field .. very simple .. i have put this in formula

                        $opts = [
                        'http' => [
                        'header'=>"User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) \r\n"
                        $street = str_replace (' ', '+',$this->evaluate($item->value[0]));
                        $postalCode = str_replace (' ', '+',$this->evaluate($item->value[1]));
                        $city = str_replace (' ', '+',$this->evaluate($item->value[2]));
                        $state = str_replace (' ', '+',$this->evaluate($item->value[3]));
                        $address = $street .'+' .$postalCode .'+' .$city .'+' .$state;
                        $url = "".urlencode("app_id=APID&app_code=APC ODE&searchtext={$address}");
                        $context = stream_context_create($opts);
                        $jsonfile = file_get_contents($url, false, $context);
                        $result = json_decode($jsonfile, true);
                        return $result['Response']['View'][0]['Result'][0]['Location']['DisplayPosition']['Latitude'] ;

                    • #15
                      item, thank you very much for your snippet. I have one question. If i prepare field which will suggest address based on value of field, is that mean that every single character = different request?

                      So for example word "Poland" = six requests?


                      • item
                        item commented
                        Editing a comment
                        Hello Emillod,
                        no .. "Poland" is not 6 request.. is just one request !
                        sample :
                        i have formula for Latitude/Longitude .. on createRecord is New..
                        so my formule is one for latitude, one for longitude .. so it's 2 request.
                        I have do so because i know i never 800 request.

                        You just need to adapt the request to your requirment..
                        response is json so .. perfect for espoCRM ..