Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Locale::Object 0.78

    Download button

    No screenshots available
    Downloads: 367  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.2/5)
    4 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Earle Martin | More programs
    Perl Artistic License / FREE
    January 19th, 2008, 02:27 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Locale::Object description

    Locale::Object is an object-oriented representation of locale information.

    Locale::Object is an object-oriented representation of locale information.

    The Locale::Object group of modules attempts to provide locale-related information in an object-oriented fashion. The information is collated from several sources and provided in an accompanying DBD::SQLite database.
    At present, the modules are:

    Locale::Object - make compound objects containing country, currency and language objects
    Locale::Object::Country - objects representing countries
    Locale::Object::Continent - objects representing continents
    Locale::Object::Currency - objects representing currencies
    Locale::Object::Currency::Converter - convert between currencies
    Locale::Object::DB - does lookups for the modules in the database
    Locale::Object::Language - objects representing languages

    For more information, see the documentation for those modules. The database is documented in docs/database.pod. Locale::Object itself can be used to create compound objects containing country, currency and language objects.

    SYNOPSIS

    use Locale::Object;

    my $obj = Locale::Object->new(
    country_code_alpha2 => 'gb',
    currency_code => 'GBP',
    language_code_alpha2 => 'en'
    );

    $obj->country_code_alpha2('af');
    $obj->country_code_alpha3('afg');

    $obj->currency_code('AFA');
    $obj->currency_code_numeric('004');

    $obj->language_code_alpha2('ps');
    $obj->language_code_alpha3('pus');
    $obj->language_name('Pushto');

    my $country = $obj->country;
    my $currency = $obj->currency;
    my $language = $obj->language;

    $obj->empty('language');

    print $obj->sane('country');

    $obj->make_sane(
    attribute => 'country'
    populate => 1
    );

    METHODS

    new()
    my $obj = Locale::Object->new(
    country_code_alpha2 => 'gb',
    currency_code => 'GBP',
    language_code_alpha2 => 'en'
    );

    Creates a new object. With no parameters, the object will be blank. Valid parameters match the method names that follow.

    country_code_alpha2(), country_code_alpha3()

    $obj->country_code_alpha2('af');
    $obj->country_code_alpha3('afg');

    Sets the country attribute in the object by alpha2 and alpha3 codes. Will create a new Locale::Object::Country object and set that as the attribute. Because Locale::Object::Country objects all have single instances, if one has already been created by that code, it will be reused when you do this.

    country_code(), currency_code_numeric()

    $obj->currency_code('AFA');
    $obj->currency_code_numeric('004');

    Serves the same purpose as the previous methods, only for the currency attribute, a Locale::Object::Currency object.

    language_code_alpha2(), language_code_alpha3(), language_name()

    $obj->language_code_alpha2('ps');
    $obj->language_code_alpha3('pus');
    $obj->language_name('Pushto');

    Serves the same purpose as the previous methods, only for the language attribute, a Locale::Object::Language object.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    object-oriented representation | locale information | Perl module | object-oriented | representation | locale

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM