<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># NAME

Lingua::String - Class to contain a string in many different languages

# VERSION

Version 0.01

# SYNOPSIS

Hold many strings in one object.

    use Lingua::String;

    my $str = Lingua::String-&gt;new();

    $str-&gt;fr('Bonjour Tout le Monde');
    $str-&gt;en('Hello, World');

    $ENV{'LANG'} = 'en_GB';
    print "$str\n";     # Prints Hello, World
    $ENV{'LANG'} = 'fr_FR';
    print "$str\n";     # Prints Bonjour Tout le Monde
    $LANG{'LANG'} = 'de_DE';
    print "$str\n";     # Prints nothing

# METHODS

## new

Create a Lingua::String object.

    use Lingua::String;

    my $str = Lingua::String-&gt;new({ 'en' =&gt; 'Here', 'fr' =&gt; 'Ici' });

## set

Sets a string in a language.

    $str-&gt;set({ string =&gt; 'House', lang =&gt; 'en' });

Autoload will do this for you as

    $str-&gt;en('House');

## as\_string

Returns the string in the language requested in the parameter.
If that parameter is not given, the system language is used.

    my $string = Lingua::String-&gt;new(en =&gt; 'boat', fr =&gt; 'bateau');
    print $string-&gt;as_string(), "\n";
    print $string-&gt;as_string('fr'), "\n";
    print $string-&gt;as_string({ lang =&gt; 'en' }), "\n";

## encode

Turns the encapsulated strings into HTML entities

    my $string = Lingua::String-&gt;new(en =&gt; 'study', fr =&gt; 'Ă©tude')-&gt;encode();
    print $string-&gt;fr(), "\n";  # Prints &amp;eacute;tude

# AUTHOR

Nigel Horne, `&lt;njh at bandsman.co.uk&gt;`

# BUGS

There's no decode() (yet) so you'll have to be extra careful to avoid
double encoding.

# SEE ALSO

# SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Lingua::String

You can also look for information at:

- MetaCPAN

    [https://metacpan.org/release/Lingua-String](https://metacpan.org/release/Lingua-String)

- RT: CPAN's request tracker

    [https://rt.cpan.org/NoAuth/Bugs.html?Dist=Lingua-String](https://rt.cpan.org/NoAuth/Bugs.html?Dist=Lingua-String)

- CPANTS

    [http://cpants.cpanauthors.org/dist/Lingua-String](http://cpants.cpanauthors.org/dist/Lingua-String)

- CPAN Testers' Matrix

    [http://matrix.cpantesters.org/?dist=Lingua-String](http://matrix.cpantesters.org/?dist=Lingua-String)

- CPAN Ratings

    [http://cpanratings.perl.org/d/Lingua-String](http://cpanratings.perl.org/d/Lingua-String)

- CPAN Testers Dependencies

    [http://deps.cpantesters.org/?module=Lingua-String](http://deps.cpantesters.org/?module=Lingua-String)

# LICENCE AND COPYRIGHT

Copyright 2021 Nigel Horne.

This program is released under the following licence: GPL2 for personal use on
a single computer.
All other users (for example Commercial, Charity, Educational, Government)
must apply in writing for a licence for use from Nigel Horne at \`&amp;lt;njh at nigelhorne.com&gt;\`.
</pre></body></html>