Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support several input parameters for pofilter (and other commands) #4979

Open
SimonHeimberg opened this issue Jul 28, 2023 · 0 comments · May be fixed by #5011
Open

support several input parameters for pofilter (and other commands) #4979

SimonHeimberg opened this issue Jul 28, 2023 · 0 comments · May be fixed by #5011

Comments

@SimonHeimberg
Copy link

I want to run pofilter only for some po files and not all in the directory structure (like a/xx.po d/xx.po). But only one --input parameter is considered. (I can give many --exclude parameters which are all considered, but this gets too complicated with many files.)
So I suggest to support several input parameters for pofilter (and other commands).

How

To change this, inputoption must have action="append" in

inputoption = optparse.Option(

If it is not supposed to be for all commands, it must be changed in another place. (For pofilter only, adapt it in translate/filter/pofilter.py by adding method setformats() calling the super method and then adapting the option.)

More info

The code supports array for input:

if isinstance(options.input, list) and len(options.input) == 1:

I monkey-patched pofilter and it runs as expected.

  • the input files or directories are used
  • to create the output directories, the common ancestor directory of the input is used as base

Other commands could profit as well from this idea. (All those accepting a directory as input.) I did not check all commands, but converters (checked po2tiki and po2xliff) do, pocompile and poclean do, ...
I do not get if pomerge does, I do not understand the message.

I am happy to send a patch, but I would like to know for where because I do not have experience with most of the commands.

SimonHeimberg added a commit to SimonHeimberg/translate that referenced this issue Aug 31, 2023
@SimonHeimberg SimonHeimberg linked a pull request Aug 31, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant