NAME

jtt - CLI to help internationalization for Jenkins

USAGE

jtt --lang=xx

options:
  --dir=directory    -> source folder for searching files, optional
  --help             -> print this help message and exits
  --man              -> provides this CLI manpage and exits
  --lang=xx          -> language code to use
  --add              -> optional, generate new files and add new keys to existing
                        files if present
  --remove           -> optional, remove unused key/value pair for existing files
                        if present
  --counter          -> optional, to each translated key, unique value is added
                        to easily identify match missing translation with value
                        in source code if present
  --target=directory -> optional, target directory for writing files
  --search=regex     -> optional, search for a given regular expression in the
                        translation content
  --debug            -> optional, print debugging messages to STDOUT when they
                        are available

OPTIONS

--lang is mandatory and it has to be different to English. If it is the only option provided, all files in the provided language code will be analyzed and a report will be provided at the end of it, without modifying a single translation file.

--dir and --target are optional and the default values for each one is the current directory. This probably the best configuration if you're going to use a Git repository to support the changes.

Some examples:

  • Look for Spanish files with incomplete keys in the current directory:

    jtt --lang=es
  • Remove all orphaned keys from German files which are in the current directory:

    jtt --lang=de --remove .

DESCRIPTION

CLI to generate missing translation keys and missing properties files and to remove unused keys.

  1. It recursively looks for files in a folder, and analyzes them to extract the keys being used in the application.

  2. If --add, it generates the appropriate file for the desired language and adds these keys to it, adding the English text as a reference. If the properties file already exists the script update it with the new keys.

  3. When --remove and there are unused keys in our file, the script removes them.

  4. If an editor is passed as argument, the script edits each modified file after adding new keys.

Note, while the migration to Jenkins this file will report the keys which should point to Jenkins instead of the old name.

AUTHOR

  • Original translation-tool.pl: Manuel Carrasco.

  • Fork to jtt: Alceu Rodrigues de Freitas Junior.

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.