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

Suppress "The amount of entries differ between files: Y is not X" #156

Closed
ip1981 opened this issue Nov 1, 2018 · 8 comments
Closed

Suppress "The amount of entries differ between files: Y is not X" #156

ip1981 opened this issue Nov 1, 2018 · 8 comments

Comments

@ip1981
Copy link

ip1981 commented Nov 1, 2018

I'd like to suppress "The amount of entries differ between files: Y is not X" where Y > X, when invoking po4a-translate.

Here is the use case:

  1. po4a-updatepo allows updating one PO file with many original (untranslated) files, e. g. po4a-updatepo -f xhtml -M utf8 -m _site/en/about.html -m _site/en/archive.html -m _site/en/contact.html -m _site/en/index.html -m _site/en/posts/2015-08-12-spqr.html -m _site/en/posts/2015-10-07-rosa-rosa-rosam.html -m _site/en/posts/2015-11-28-carpe-diem.html -m _site/en/posts/2015-12-07-tu-quoque.html -p po/ru.po.
  2. Then I use po4a-tranlate to translate individual files. I think this is the only way to do so (according to the man page). Anyway, in my case I can only translate one file at a time.
  3. Unfortunately, the number of to-be-translated strings in the original file is much less than in the PO file. Hence the confusing message.

Having a single PO file for many original (untranslated) file is a very useful feature for translators (more context), also it de-duplicates common strings in many files, especially useful in static WWW sites where each page follows the same template with headers, footers, etc.

Example PO:

#. type: Attribute 'lang' of: <html>
#: _site/en/about.html:2 _site/en/archive.html:2 _site/en/contact.html:2
#: _site/en/index.html:2 _site/en/posts/2015-08-12-spqr.html:2
#: _site/en/posts/2015-10-07-rosa-rosa-rosam.html:2
#: _site/en/posts/2015-11-28-carpe-diem.html:2
#: _site/en/posts/2015-12-07-tu-quoque.html:2
msgid "en"
msgstr "ru"
#...
#. type: Content of: <html><body><main><h1>
#: _site/en/archive.html:23
msgid "Archives"
msgstr "Архив"
#...
#. type: Content of: <html><body><footer>
#: _site/en/about.html:33 _site/en/archive.html:49 _site/en/contact.html:28
#: _site/en/index.html:59 _site/en/posts/2015-08-12-spqr.html:41
#: _site/en/posts/2015-10-07-rosa-rosa-rosam.html:43
#: _site/en/posts/2015-11-28-carpe-diem.html:41
#: _site/en/posts/2015-12-07-tu-quoque.html:43
msgid ""
"Site proudly generated by <a href=\"http://jaspervdj.be/hakyll\">Hakyll</a>"
msgstr ""
"Сайт создан с помощью <a href=\"http://jaspervdj.be/hakyll\">Hakyll</a>"
@mquinson
Copy link
Owner

mquinson commented Nov 4, 2018

Hello Igor, thanks for this feedback.
I'm wondering: is this warning really a warning, or does it prevent the work from being done? In the former case, this should be fixed ASAP, but in the latter case, this is probably less critical.

Thanks,

@ip1981
Copy link
Author

ip1981 commented Nov 4, 2018

Oh, it is just a warning, it does not prevent translation.

@mquinson
Copy link
Owner

mquinson commented Apr 2, 2020

Hello,
sorry for the very long delay here. My personal advise would be to go for the full po4a binary instead of using po4a-translate. The later script is much more limited indeed.

@mquinson
Copy link
Owner

I'm closing this issue because the more I think about it, the more I dislike the idea of removing a warning that is useless but harmless in the scenario that you describe while it could be very useful in other scenarios (ie, when there is actually an issue).

@ip1981
Copy link
Author

ip1981 commented Jul 1, 2020

it could be very useful in other scenarios (ie, when there is actually an issue).

Out of curiosity, do you know of any such scenario?

And after all, I think there is not just inconvenience, but internal inconsistency: there is a legit scenario when data (translations) is created and another legit scenario when the data is used, but the first causes a warning in the second :)

@mquinson
Copy link
Owner

mquinson commented Jul 1, 2020

Hello,

I think that this can happen when you use the wrong pot file for your translation, couldn't it?

@ip1981
Copy link
Author

ip1981 commented Jul 1, 2020

I think that this can happen when you use the wrong pot file for your translation, couldn't it?

There will be much louder errors like "only 5% translated, rejecting", won't it? :)

@mquinson
Copy link
Owner

mquinson commented Jul 1, 2020

Shit, you're right :)

@mquinson mquinson reopened this Jul 1, 2020
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

No branches or pull requests

2 participants