The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

slackget10::Local - A class to load the locales

VERSION

Version 1.0.0

SYNOPSIS

This class' purpose is to load and export the local.

    use slackget10::Local;

    my $local = slackget10::Local->new();
    $local->Load('/usr/local/share/slack-get/local/francais/LC_MESSAGES');
    print $local->Get('__SETTINGS') ;

CONSTRUCTOR

new

Can take an argument : the LC_MESSAGES file. In this case the constructor automatically call the Load() method.

        my $local = new slackget10::Local();
        or
        my $local = new slackget10::Local('/usr/local/share/slack-get/local/francais/LC_MESSAGES');

FUNCTIONS

Load

Load the local from a given file

        $local->Load('/usr/local/share/slack-get/local/francais/LC_MESSAGES') or die "unable to load local\n";

Return undef if something goes wrong, 1 else.

get_indexes

Return the list of all index of the current loaded local. Dependending of the context, this method return an array or an arrayref.

        # Return a list
        foreach ($local->get_indexes) {
                print "$_ : ",$local->Get($_),"\n";
        }
        
        # Return an arrayref
        my $index_list = $local->get_indexes ;

Get

Return the localized message of a given token :

        my $error_on_modification = $local->Get('__ERR_MOD') ;

Return undef if the token doesn't exist.

name

Accessor for the name pf the Local (langpack).

        print "The current langpack name is : ", $local->name,"\n";
        $local->name('Japanese'); # Set the name of the langpack to 'Japanese'.

AUTHOR

DUPUIS Arnaud, <a.dupuis@infinityperl.org>

BUGS

Please report any bugs or feature requests to bug-slackget10-networking@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=slackget10. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2005 DUPUIS Arnaud, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.