geocoder-php / geocoder-php/Geocoder

[Google Maps] Add output language support

未关闭
#940 5 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

provider
主要语言
PHP
星标
4k
派生
525
平均合并
8 分钟
30 天内合并 PR
1

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 vendor/geocoder-php/google-maps-provider/GoogleMaps.php 中的 reverseQuery(ReverseQuery $query) 开始,然后检查 Google Maps 请求如何处理 locale 和 URL 参数。完成的标准是反向查询遵循请求的输出语言,包括未提供 locale 时的明确定义行为,并且已验证由此产生的请求行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
php
领域
api
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
40/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。