NAME
Data::Localize::Format::Sprintf - Format strings using regular sprintf
SYNOPSIS
use Data::Localize;
use Data::Localize::Format::Sprintf;
my $loc = Data::Localize->new;
$loc->add_localizer(
class => 'YAML', # or any other
path => 'i18n/*.yaml',
formatter => Data::Localize::Format::Sprintf->new,
);
DESCRIPTION
This is an extremely simple module which lets you use sprintf syntax in your translation strings.
Using this formatter has following advantages:
this format is widely known so you don't have to learn it
it's a single sprintf call, so it is bound to be faster than any custom solutions
it lets you use full range on characters (unlike Maketext formatter, which currently doesn't let you use square brackets)
Please note that sprintf also lets you specify the number of parameter which you want to use with syntax %1$s
, %2$s
etc.
SEE ALSO
Data::Localize::Format::Maketext
AUTHOR
Bartosz Jarzyna <bbrtj.pro@gmail.com>
COPYRIGHT AND LICENSE
Copyright (C) 2025 by Bartosz Jarzyna
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.