maxmind / MaxMind-DB

Spec and test data for the MaxMind DB file format
https://maxmind.github.io/MaxMind-DB/
Apache License 2.0
275 stars 64 forks source link

Add localization for Country names #132

Closed HarryLyu closed 5 months ago

HarryLyu commented 5 months ago

Hello!

When I request country data from GeoLite2-Country.mmdb from, for instance, PHP, I receive localized name of a country

87.116.132.149
GeoIp2\Model\Country Object
(
    [raw:protected] => Array
        (
            [continent] => Array
                (
                    [code] => EU
                    [geoname_id] => 6255148
                    [names] => Array
                        (
                            [de] => Europa
                            [en] => Europe
                            [es] => Europa
                            [fr] => Europe
                            [ja] => ヨーロッパ
                            [pt-BR] => Europa
                            [ru] => Европа
                            [zh-CN] => 欧洲
                        )

                )

            [country] => Array
                (
                    [geoname_id] => 6290252
                    [iso_code] => RS
                    [names] => Array
                        (
                            [de] => Serbien
                            [en] => Serbia
                            [es] => Serbia
                            [fr] => Serbie
                            [ja] => セルビア
                            [pt-BR] => Sérvia
                            [ru] => Сербия
                            [zh-CN] => 塞尔维亚
                        )

                )

The country/continent names are localized into just few languages. Particularly, no translation into Serbian language.

I found information that you are using GeoNames as source data, and it does have translation into all languages - https://www.geonames.org/RS/other-names-for-serbia.html

Is it possible to add more translations for countries? At least into languages, native to this country.

Thanks!

oschwald commented 5 months ago

This repo is for the MMDB format specification and some example databases using that specification. Feature requests on the content of the databases would be better directed at support@maxmind.com.

That said, the general recommendation would be to use the geoname_id present in the database to look up additional localized names in the data GeoNames provides. We are limited in the number of names we provide both due to space and performance considerations.

oschwald commented 5 months ago

You can also add your own data to an MMDB using mmdbwriter or a third-party tool based on this. See our blog post on enriching MMDB files.