Jenkins::i18n::ProcOpts - process files definitions based on CLI options
use Jenkins::i18n::ProcOpts; my $proc = Jenkins::i18n::ProcOpts->new({ source_dir => $source, target_dir => $target, use_counter => 1, is_remove => 1, is_add => 1, is_debug => 0, lang => 'pt_BR', search => 'foobar' });
This module define how the translation files should be processed based on the collected CLI options.
None by default.
Creates a new instance.
Expects a hash reference as parameter, with the following keys:
source_dir: a string representing the path where the files should be reviewed.
source_dir
target_dir: a string representing the path where the processed files should be written to.
target_dir
use_counter: A boolean (in Perl terms) if a counter is to be used.
use_counter
is_remove: A boolean (in Perl terms) if deprecated files should be removed.
is_remove
is_add: a boolean (in Perl terms) if new files should be added.
is_add
is_debug: a boolean (in Perl terms) if CLI is running in debug mode.
is_debug
lang: a string identifying the chosen language for processing.
lang
search: optional, an string of a regular expression to match the content of the translated properties, with you want to use that. Otherwise, just provide undef as a value.
search
undef
Returns true (1) or false (0) if there is a defined term to search on the translated properties values.
Returns the compiled regular expression that will be used to match terms in the translated properties values.
Returns a string identifying the chosen language for processing.
Returns string of the path where the translation files should be looked for.
Returns a string of the path where the reviewed translation files should be written to.
Increments the processed files counter.
Returns true (1) or false (0) if the processed counter is in use.
Returns an integer representing the number of translation files already processed.
Returns true (1) or false (0) if the outdated translation files should be removed.
Returns true (1) or false (0) if the translation files should be added.
Returns true (1) or false (0) if the CLI is running in debug mode.
Based on complete path to a translation file as input, defines the resulting expected translation files and their locations, even if they don't yet exist.
Expects as parameter the complete path to a translation file (Jelly or Java Properties).
Returns an array with the following elements:
The path to the current language file location.
The path to the English Properties file location.
The path to the corresponding Jelly file.
All three items are formed based on convention, that doesn't mean that any of them actually exists in the file system.
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.