=encoding UTF-8

=head1 NAME

String::Locale::Object - display text locally.

=head1 VERSION

Version 0.05

=cut

=head1 SYNOPSIS

Quick summary of what the module does:

	use String::Locale::Object;

	my $locales = String::Locale::Object->new({
		locale => 'ja_JP',
		locales => {
			stranger => {
				en_GB => 'Hello stranger',
				en_US => 'Howdy stranger',
				ja_JP => 'こんにちは見知らぬ人'
			},
		}
	});

	say $locales->stranger;

=head1 SUBROUTINES/METHODS

=head2 new

Instantiate a new String::Locale::Object object.

	String::Locale::Object->new

=head2 has_language

has_language will return true if language accessor has a value.

	$obj->has_language

=head2 convert_locale

Split a locale into locale and language.

	$obj->convert_locale($locale, $fb)

=head2 add

Add an item into the locales. This method expects a reference $key that should be a Str and a locales HashRef where the keys are locales and the values are the text string.

	locales->add('stranger', {
		en_US => 'Howdy stranger!'
	});
	

=head2 string

call string method. Expects param $key to be a Str, param $locale to be a Str, param $lang to be a Str, param $fb to be a Str.

	$obj->string($key, $locale, $lang, $fb)

=head1 ACCESSORS

=head2 fb

The fallback locale/language that is used when no value in the locales hash matches the objects locale or language. You can get or set this attribute and it expects a Str value. This attribute will default to be 'en'.

	$obj->fb;

	$obj->fb($value);

=head2 locale

The locale that will be checked for first when stringiying. You can get or set this attribute and it expects a Str value. This attribute will default to use Posix::setlocale

	$obj->locale;

	$obj->locale($value);

=head2 language

The language that will be checked for second when stringifying. You can get or set this attribute and it expects a Str value. This attribute will be defaulted to be the first part of a locale.

	$obj->language;

	$obj->language($value);

=head2 locales

The hash reference of strings that map to each locale.

	$obj->locales({ 
		stranger => {
			en_US => 'Howdy stranger!'
		}
	})
	

=head1 AUTHOR

LNATION, C<< <email at lnation.org> >>

=head1 BUGS

Please report any bugs or feature requests to C<bug-string::locale::object at rt.cpan.org>, or through
the web interface at L<https://rt.cpan.org/NoAuth/ReportBug.html?Queue=String-Locale-Object>.  I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.

=head1 SUPPORT

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

    perldoc String::Locale::Object

You can also look for information at:

=over 4

=item * RT: CPAN's request tracker (report bugs here)

L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=String-Locale-Object>

=item * AnnoCPAN: Annotated CPAN documentation

L<http://annocpan.org/dist/String-Locale-Object>

=item * CPAN Ratings

L<https://cpanratings.perl.org/d/String-Locale-Object>

=item * Search CPAN

L<https://metacpan.org/release/String-Locale-Object>

=back

=head1 ACKNOWLEDGEMENTS

=head1 LICENSE AND COPYRIGHT

This software is Copyright (c) 2020 by LNATION.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)

=cut

 
