Jenkins::i18n::Properties - a subclass of Config::Properties
use Jenkins::i18n::Properties; # reading... open my $fh, '<', 'my_config.props' or die "unable to open configuration file"; my $properties = Config::Properties->new(); $properties->load($fh); $value = $properties->getProperty($key); # saving... open my $fh, '>', 'my_config.props' or die "unable to open configuration file for writing"; $properties->setProperty($key, $value); $properties->format('%s => %s'); $properties->store($fh, $header );
Jenkins::i18n::Properties is a subclass of Config::Properties and works pretty much the same, except regarding the save method, which is overrided.
Jenkins::i18n::Properties
save
None by default.
This is an overrided method from the parent class.
It expects to receive the following positional parameters:
A opened file handle created with open.
open
An array reference with the license content to include in the properties file.
Both are required.
This method, differently from the original of the parent class, does not include a timestamp with localtime.
localtime
This method does not closes the given filehand at the end of the writting.
Remove escape characters from a string.
Expects a single string parameter, changing it in place.
This is a method overrided from the superclass.
Process a single line retrieved from the Java properties file, saving the key and value internally.
Returns 1 if everything goes fine.
1
This method was overrided to allow the key value to retain it's escape characters, as required by Jenkins translation files.
Additionally, this method will not attempt to fix UTF-8 BOM from very old perl interpreters (version 5.6.0).
Config::Properties
Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
This software is copyright (c) 2022 of Alceu Rodrigues de Freitas Junior, arfreitas@cpan.org
This file is part of Jenkins Translation Tool project.
Jenkins Translation Tool is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Jenkins Translation Tool is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Jenkins Translation Tool. If not, see (http://www.gnu.org/licenses/).
The original translation-tool.pl script was licensed through the MIT License, copyright (c) 2004-, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributors. Translations files generated by the Jenkins Translation Tool CLI are distributed with the same MIT License.
translation-tool.pl
To install Jenkins::i18n, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Jenkins::i18n
CPAN shell
perl -MCPAN -e shell install Jenkins::i18n
For more information on module installation, please visit the detailed CPAN module installation guide.