The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Jenkins::i18n::ProcOpts - process files definitions based on CLI options

SYNOPSIS

  use Jenkins::i18n::ProcOpts;

DESCRIPTION

This module define how the translation files should be processed based on the collected CLI options.

EXPORT

None by default.

METHODS

new

Creates a new instance.

Expects as positional parameters:

  1. A string representing the path where the files should be reviewed.

  2. A string representing the path where the processed files should be written to.

  3. A boolean (in Perl terms) if a counter is to be used.

  4. A boolean (in Perl terms) if deprecated files should be removed.

  5. A boolean (in Perl terms) if new files should be added.

  6. A boolean (in Perl terms) if CLI is running in debug mode.

  7. A string identifying the chosen language for processing.

  8. An optional string of a regular expression to match the content of the translated properties.

Returns true (1) or false (0) if there is a defined term to search on the translated properties values.

search_term

Returns the compiled regular expression that will be used to match terms in the translated properties values.

get_language

Returns a string identifying the chosen language for processing.

get_source

Returns string of the path where the translation files should be looked for.

get_target

Returns a string of the path where the reviewed translation files should be written to.

inc

Increments the processed files counter.

use_counter

Returns true (1) or false (0) if the processed counter is in use.

get_counter

Returns an integer representing the number of translation files already processed.

is_remove

Returns true (1) or false (0) if the outdated translation files should be removed.

is_add

Returns true (1) or false (0) if the translation files should be added.

is_debug

Returns true (1) or false (0) if the CLI is running in debug mode.

define_files

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:

  1. The path to the current language file location.

  2. The path to the English file location.

AUTHOR

Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>

COPYRIGHT AND LICENSE

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.