Code Monkey home page Code Monkey logo

Comments (7)

willdurand avatar willdurand commented on May 29, 2024

Well, not sure about that.

from geocoder.

willdurand avatar willdurand commented on May 29, 2024

Ping @havvg, still needed?

from geocoder.

havvg avatar havvg commented on May 29, 2024

Would be appreciated, yes!
I currently worked around it by replacing the provider by a custom one, which is hack-ish imho.

This at least solved the current use-case, but you cannot alter the locale of the provider :(

<?php

use Symfony\Component\DependencyInjection\ContainerInterface;

use Geocoder\HttpAdapter\HttpAdapterInterface;
use Geocoder\Provider\GoogleMapsProvider as BaseProvider;

class GoogleMapsProvider extends BaseProvider
{
    public function __construct(ContainerInterface $container, HttpAdapterInterface $adapter, $locale = null)
    {
        if ($container->isScopeActive('request') && $container->has('request')) {
            $locale = $container->get('request')->getLocale();
        }

        parent::__construct($adapter, $locale);
    }
}

from geocoder.

willdurand avatar willdurand commented on May 29, 2024

@havvg wanna write a PR?

from geocoder.

havvg avatar havvg commented on May 29, 2024

Yeah, will do!

from geocoder.

havvg avatar havvg commented on May 29, 2024

I'm currently writing the patch, but the test suite is failing (without changes): https://travis-ci.org/havvg/Geocoder/jobs/3280917

Does it make sense to actually issue requests to the providers backends?
Imho it's not actually testing the unit under test and allows glitches just like the current one to appear, although nothing might actually be broken within the library.

from geocoder.

willdurand avatar willdurand commented on May 29, 2024

@havvg don't worry.

from geocoder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.