[Google Maps] Add output language support

Open
#940 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
40/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
api

Research direction

Start in vendor/geocoder-php/google-maps-provider/GoogleMaps.php at reverseQuery(ReverseQuery $query), then inspect how locale and URL parameters are handled for Google Maps requests. Done means reverse queries honor the requested output language, including a defined behavior when no locale is provided, with the resulting request behavior verified.

Written by the indexing model from the issue text.

Description

provider

The following was submitted in the GeocoderLaravel repo by @xSoulRootx (https://github.com/geocoder-php/GeocoderLaravel/issues/144), but probably belongs here:

============

General Information

GeocoderLaravel Version: ^4.0
Laravel Version: 5.7.*
PHP Version: 7.2
Operating System and Version: Ubuntu

Issue Description

Output language in reverse query don't work

Resolve

vendor\geocoder-php\google-maps-provider\GoogleMaps.php

in

public function reverseQuery(ReverseQuery $query): Collection

before

return $this->fetchUrl($url, $query->getLocale(), $query->getLimit(), $query->getData('region', $this->region));

add

        if (null !== $query->getLocale()) {
            $url .= '&result_type='.urlencode($resultType);
        } else {
            $url .= '&language='.env('GOOGLE_MAPS_LOCALE', 'en-US');
        }

or something like this

Dominant language
PHP
Stars
4k
Forks
525
Avg merge
8m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from geocoder-php/Geocoder

All issues in geocoder-php/Geocoder

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.