Locale::Places - Translate places between different languages using http://download.geonames.org/
Version 0.08
Translates towns and cities between different languages, for example London is Londres in French.
Create a Locale::Places object.
Takes one optional parameter, directory, which tells the object where to find the file GB.sql If that parameter isn't given, the module will attempt to find the databases, but that can't be guaranteed. Any other options are passed to the underlying database driver.
Translate a city into a different language. Takes one mandatory argument: 'place'. It also takes two other arguments: 'from' and 'to', at least one of which must be given. If neither $to nor $from is given, the code makes a best guess based on the environment. If no translation can be found, returns place in the original language.
use Locale::Places; # Prints "Douvres" print Locale::Places->new()->translate({ place => 'Dover', from => 'en', to => 'fr' }); # Prints "Douvres" if we're working on a French system print Locale::Places->new()->translate('Dover');
Nigel Horne, <njh at bandsman.co.uk>
<njh at bandsman.co.uk>
Only supports towns and cities in GB at the moment.
Canterbury no longer translates to Cantorbéry in French. This is a problem with the data, which has this line:
16324587 2653877 fr Canterbury 1
which overrides the translation by setting the 'isPreferredName' flag
Locale::Country::Multilingual to translate country names.
You can find documentation for this module with the perldoc command.
perldoc Locale::Places
You can also look for information at:
MetaCPAN
https://metacpan.org/release/Locale-Places
GitHub
https://github.com/nigelhorne/Locale-Places
CPANTS
http://cpants.cpanauthors.org/dist/Locale-Places
CPAN Testers' Matrix
http://matrix.cpantesters.org/?dist=Locale-Places
CPAN Testers Dependencies
http://deps.cpantesters.org/?module=Locale::Places
Geonames Discussion Group
https://groups.google.com/g/geonames
Copyright 2020-2023 Nigel Horne.
This program is released under the following licence: GPL2
This product uses data from geonames, http://download.geonames.org.
To install Locale::Places, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Locale::Places
CPAN shell
perl -MCPAN -e shell install Locale::Places
For more information on module installation, please visit the detailed CPAN module installation guide.