NAME
WWW::Bund::CLI::Strings - Localized string provider for bund CLI
VERSION
version 0.001
SYNOPSIS
use WWW::Bund::CLI::Strings;
my $strings = WWW::Bund::CLI::Strings->new(
lang => 'en',
strings_dir => 'share/strings',
);
my $msg = $strings->get('title');
my $err = $strings->get('err_unknown_api', 'my_api');
DESCRIPTION
Loads and provides access to localized CLI strings from YAML files. Supports 7 languages: de, en, fr, es, it, nl, pl.
String files are located at {strings_dir}/{lang}.yml and contain key-value pairs. Values can include sprintf-style placeholders for dynamic content.
If a key is not found, the key itself is returned.
lang
Language code (de, en, fr, es, it, nl, pl). Defaults to de.
strings_dir
Directory containing string YAML files (e.g., de.yml, en.yml). Required.
get
my $string = $strings->get($key);
my $string = $strings->get($key, @sprintf_args);
Get localized string by key. If @sprintf_args are provided, applies sprintf formatting to the string.
Returns the key itself if not found in strings file (graceful degradation).
Examples:
$strings->get('title'); # "WWW::Bund CLI"
$strings->get('err_unknown_api', 'foo'); # "Unknown API: foo"
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-www-bund/issues.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <torsten@raudssus.de>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.