{"id":22045236,"url":"https://github.com/nigelhorne/locale-places","last_synced_at":"2026-04-01T23:36:46.400Z","repository":{"id":50370056,"uuid":"322635242","full_name":"nigelhorne/Locale-Places","owner":"nigelhorne","description":"Translate places using http://download.geonames.org/","archived":false,"fork":false,"pushed_at":"2025-04-28T15:26:39.000Z","size":3417,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-08T07:49:24.197Z","etag":null,"topics":["cities","cpan","cpan-module","perl","perl-module","translation"],"latest_commit_sha":null,"homepage":"http://download.geonames.org/","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nigelhorne.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-12-18T15:38:48.000Z","updated_at":"2025-04-28T15:26:43.000Z","dependencies_parsed_at":"2024-02-14T20:08:41.566Z","dependency_job_id":"859e3dcf-0aef-450d-97d1-0f26ec345b1e","html_url":"https://github.com/nigelhorne/Locale-Places","commit_stats":{"total_commits":135,"total_committers":4,"mean_commits":33.75,"dds":0.437037037037037,"last_synced_commit":"a8900b0c837d2361f33ad1a9c5fd3bca40c14333"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2FLocale-Places","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2FLocale-Places/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2FLocale-Places/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2FLocale-Places/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nigelhorne","download_url":"https://codeload.github.com/nigelhorne/Locale-Places/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253025335,"owners_count":21842409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cities","cpan","cpan-module","perl","perl-module","translation"],"created_at":"2024-11-30T13:12:21.385Z","updated_at":"2026-04-01T23:36:46.388Z","avatar_url":"https://github.com/nigelhorne.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nLocale::Places - Translate places between different languages using http://download.geonames.org/\n\n# VERSION\n\nVersion 0.16\n\n# SYNOPSIS\n\nProvides the functionality for translating place names between different languages using data from GeoNames.\nIt currently supports places in Great Britain (GB) and the United States (US) and relies on localized databases.\nFor example, London is Londres in French.\n\n# METHODS\n\n## new\n\nCreate a Locale::Places object.\n\nArguments:\n\nTakes different argument formats (hash or positional)\n\n- `cache`\n\n    Place to store results.\n    If none is given, the results will be stored in a temporary internal cache.\n\n- `config_file`\n\n    Points to a configuration file which contains the parameters to `new()`.\n    The file can be in any common format,\n    including `YAML`, `XML`, and `INI`.\n    This allows the parameters to be set at run time.\n\n- `directory`\n\n    Tells the object where to find a directory called 'data' containing GB.sql and US.sql\n    If that parameter isn't given,\n    the module will attempt to find the databases,\n    but that can't be guaranteed.\n\nAny other options are passed to the underlying database driver.\n\n## translate\n\nTranslate a city into a different language.\n\nParameters:\n\\- place (mandatory): The name of the place to translate.\n\\- from: The source language (optional; defaults to environment language).\n\\- to: The target language (mandatory).\n\\- country: The country where the place is located (optional; defaults to 'GB').\n\nReturns:\n\\- Translated name if found, or undef if no translation exists.\n\nExample:\n    use Locale::Places;\n\n    # Prints \"Douvres\"\n    print Locale::Places-\u003enew()-\u003etranslate({ place =\u003e 'Dover', country =\u003e 'GB', from =\u003e 'en', to =\u003e 'fr' });\n\n### Translation Resolution Order\n\n- 1. Preferred names\n- 2. Non-preferred names\n- 3. Short names\n- 4. Non-short names\n- 5. Single-translation disambiguation\n- 6. Identity fallback\n\n### API SPECIFICATION\n\n#### INPUT\n\n    {\n      'place' =\u003e { 'type' =\u003e 'string', 'min' =\u003e 2, 'max' =\u003e 64 },\n      'from' =\u003e { 'type' =\u003e 'string', 'min' =\u003e 2, 'max' =\u003e 64, optional =\u003e 1 },\n      'to' =\u003e { 'type' =\u003e 'string', 'min' =\u003e 2, 'max' =\u003e 64, optional =\u003e 1 },\n      'country' =\u003e { 'type' =\u003e 'string', 'min' =\u003e 2, 'max' =\u003e 64, optional =\u003e 1 }\n    }\n\n#### OUTPUT\n\nArgument error: croak\nNo matches found: undef\n\n    {\n      'type' =\u003e 'string',\n      'min' =\u003e 1\n    }\n\n## AUTOLOAD\n\nTranslate to the given language, where the routine's name will be the target language.\n\n    # Prints 'Virginie', since that's Virginia in French\n    print $places-\u003efr({ place =\u003e 'Virginia', from =\u003e 'en', country =\u003e 'US' });\n\nExtracts the target language from the method name and calls `translate()` internally.\n\nReturns a string containing the translated name if found, or undef if no translation exists.\n\n# AUTHOR\n\nNigel Horne, `\u003cnjh at nigelhorne.com\u003e`\n\n# BUGS\n\nOnly supports places in GB and the US at the moment.\n\nCanterbury no longer translates to Cantorbéry in French.\nThis is a problem with the data, which has this line:\n\n    16324587    2653877 fr      Canterbury      1\n\nwhich overrides the translation by setting the 'isPreferredName' flag\n\nCan't specify below the country level.\nFor example, is Virginia a state, a town in Illinois or one in Minnesota?\n\n# SEE ALSO\n\n- [Test Coverage Report](https://nigelhorne.github.io/Locale-Places/coverage/)\n- [Locale::Country::Multilingual](https://metacpan.org/pod/Locale%3A%3ACountry%3A%3AMultilingual) to translate country names.\n\n# SUPPORT\n\nThis module is provided as-is without any warranty.\n\nYou can find documentation for this module with the perldoc command.\n\n    perldoc Locale::Places\n\nYou can also look for information at:\n\n- MetaCPAN\n\n    [https://metacpan.org/release/Locale-Places](https://metacpan.org/release/Locale-Places)\n\n- GitHub\n\n    [https://github.com/nigelhorne/Locale-Places](https://github.com/nigelhorne/Locale-Places)\n\n- CPANTS\n\n    [http://cpants.cpanauthors.org/dist/Locale-Places](http://cpants.cpanauthors.org/dist/Locale-Places)\n\n- CPAN Testers' Matrix\n\n    [http://matrix.cpantesters.org/?dist=Locale-Places](http://matrix.cpantesters.org/?dist=Locale-Places)\n\n- CPAN Testers Dependencies\n\n    [http://deps.cpantesters.org/?module=Locale::Places](http://deps.cpantesters.org/?module=Locale::Places)\n\n- Geonames Discussion Group\n\n    [https://groups.google.com/g/geonames](https://groups.google.com/g/geonames)\n\n# LICENCE AND COPYRIGHT\n\nCopyright 2020-2026 Nigel Horne.\n\nThis program is released under the following licence: GPL2\n\nThis product uses data from Geonames, available at [http://download.geonames.org](http://download.geonames.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnigelhorne%2Flocale-places","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnigelhorne%2Flocale-places","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnigelhorne%2Flocale-places/lists"}