Skip to content

Conversation

StanFromIreland
Copy link
Member

@StanFromIreland StanFromIreland commented Apr 5, 2025

Copy link
Member

@tomasr8 tomasr8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also add a test for multiple input files

@StanFromIreland
Copy link
Member Author

For multiple input it works like so:

2 translated messages.
4 translated messages.

Is this the format we want (It is not the best, but then again the current situation is poor since it just silently passes anyway)? I cannot compare to GNU msgfmt here since it doesn't allow this.

@tomasr8
Copy link
Member

tomasr8 commented Apr 5, 2025

For multiple input it works like so:

2 translated messages.
4 translated messages.

Is this the format we want (It is not the best, but then again the current situation is poor since it just silently passes anyway)? I cannot compare to GNU msgfmt here since it doesn't allow this.

Just an idea, but maybe prefix each line with the filename in case more than one file is given?

@StanFromIreland
Copy link
Member Author

Just an idea, but maybe prefix each line with the filename in case more than one file is given?

I considered that, but then again do we also want that for single files, otherwise there is an even more complex printing system ;-) This will then be inconsistent with GNU msgfmt

@tomasr8
Copy link
Member

tomasr8 commented Apr 5, 2025

Just an idea, but maybe prefix each line with the filename in case more than one file is given?

I considered that, but then again do we also want that for single files, otherwise there is an even more complex printing system ;-) This will then be inconsistent with GNU msgfmt

no, just when more than one file is given, so that it's consistent w/ GNU but still useful in the other case.

@StanFromIreland StanFromIreland requested a review from tomasr8 April 5, 2025 20:29
@StanFromIreland StanFromIreland marked this pull request as draft April 5, 2025 20:39
@StanFromIreland
Copy link
Member Author

I think I need to fix something. I will look into it tomorrow, it seems off.

@StanFromIreland StanFromIreland marked this pull request as ready for review April 5, 2025 20:55
Comment on lines +177 to +181
# Multiple input files
res = assert_python_ok(msgfmt, '--statistics', '-o', 'temp.mo', data_dir / "general.po", data_dir / "fuzzy.po")
out = res.out.decode('utf-8').strip()
self.assertIn('general.po: 8 translated messages, 1 untranslated message.', out)
self.assertIn('fuzzy.po: 0 translated messages.', out)
Copy link
Member Author

@StanFromIreland StanFromIreland Apr 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a test for #53950 :-) Do we want a separate test too?

@python-cla-bot
Copy link

python-cla-bot bot commented Apr 6, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@StanFromIreland
Copy link
Member Author

What do we want to do with this? It is an option in GNU msgfmt @serhiy-storchaka

@StanFromIreland
Copy link
Member Author

Friendly ping @serhiy-storchaka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants