Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaxMind's localizations based on config #244

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nikrovir
Copy link

Currently, the result of obtaining a location only works with one language, despite the fact that it is possible to specify several languages in the configuration file. My changes allow to add several localizations for MaxMind (unfortunately I can’t implement it for other services, because I don’t have the keys) to the returned result, when specifying several languages: 'locales' => ['en', 'ru', 'pl']. The returned result will be:

[
  "ip" => "37.212.55.000"
  "iso_code" => "BY"
  "country" => "Belarus"
  "city" => "Vertelishki"
  "state" => "HR"
  "state_name" => "Grodnenskaya"
  "postal_code" => "231751"
  "lat" => 53.7041
  "lon" => 24.0152
  "timezone" => "Europe/Minsk"
  "continent" => "EU"
  "localizations" => [
    "en" => [
      "country" => "Belarus"
      "state_name" => "Grodnenskaya"
      "city" => "Vertelishki"
    ]
    "ru" => [
      "country" => "Беларусь"
      "state_name" => "Гродненская Область"
      "city" => "Вертелишки"
    ]
    "pl" => [
      "country" => null
      "state_name" => null
      "city" => null
    ]
  ]
  "currency" => "BYN"
  "default" => false
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant