Help language development. Donate to The Perl Foundation

I18n::Simple cpan:TYIL last updated on 2018-09-04

=begin pod

=NAME    I18n::Simple
=AUTHOR  Patrick Spek <[email protected]>
=VERSION 0.0.0

=head1 Description

A simple internationalisation module.

=head1 Installation

Install this module through L<zef|>:

=begin code :lang<sh>
zef install Text::I18n
=end code

=head1 Using the module

=head1 Examples

Take the following YAML file, and save it in your module's C<resources>
directory. These examples assume the file being saved at

=begin code
foo: This is a template!
bar: This template is for you, $(user).
=end code

Then use the module as follows:

=begin code
use I18n::Simple;

# Load the templates. You can make the `en` part a variable to easily switch
# between different languages in your program.

# Call a template without placeholders
dd i18n("foo"); # "This is a template!"

# Call a template with placeholders
dd i18n("bar", user => "Bob"); # "This template is for you, Bob."
=end code

=head1 License

This module is distributed under the terms of the AGPL-3.0.

=end pod