Project

General

Profile

Bug #15819

Make sure ikiwiki generated PO files satisfy the requirements we want check_po to set

Added by u over 1 year ago. Updated 5 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
08/19/2018
Due date:
% Done:

100%

Feature Branch:
Type of work:
Code
Blueprint:
Starter:
Affected tool:
Translation Platform

Description

One related question: does ikiwiki itself generate PO files that satisfy the new requirements introduced by this branch? I hope so but if not, then we have a problem: every time ikiwiki on our live website updates/creates a PO file we will get test suite failures.

First iteration (#16328) will disable checks that are not satisfied by the PO files generated by ikiwiki. And then we can decide which ones of these disabled new checks we really would like to enable, and then we'll have to fix ikiwiki/po4a before we can do that.


Related issues

Related to Tails - Bug #15408: Consider forcing wrapping of po files at 79 chars per line Rejected 03/13/2018
Related to Tails - Feature #16103: Handle translations outside wiki/src WRT check_po: document or opt-out Resolved 11/05/2018
Related to Tails - Feature #16328: Merge a stricter version of check_po whose expectations are realistic into our master branch Resolved 01/08/2019
Related to Tails - Bug #15403: Unify po headers Resolved 08/19/2018

History

#2 Updated by intrigeri about 1 year ago

  • Target version changed from Tails_3.10.1 to Tails_3.11

#3 Updated by u about 1 year ago

  • Assignee changed from u to hefee

@hefee: in order to move this forward, would you be able to look into that?

#4 Updated by u about 1 year ago

  • Related to Bug #15408: Consider forcing wrapping of po files at 79 chars per line added

#5 Updated by hefee about 1 year ago

  • Related to Feature #16102: List of potential checks we might want to do on PO files added

#6 Updated by hefee about 1 year ago

  • Assignee changed from hefee to u
  • QA Check set to Info Needed

To test this I need to understand, what script(s) is/are executed to update the translations.

#7 Updated by u about 1 year ago

  • Assignee changed from u to hefee

I think you should ask intrigeri to get all the information, because I would probably do exactly the same thing :)

#8 Updated by hefee about 1 year ago

  • Assignee changed from hefee to intrigeri

I need some intput how the server build the website and summit git commits, so I can test this locally if the automatical build is breaking the proposed git precommit script.

#9 Updated by u about 1 year ago

All I know is that we have ikiwiki.setup and ikiwiki-cgi.setup at the root of tails.git.
And a script to build the website called "build-website". I don't know if the server uses only this script or if it uses also other things.

#10 Updated by intrigeri about 1 year ago

  • Assignee changed from intrigeri to hefee
  • QA Check deleted (Info Needed)

It's funny, I've documented the production website config on https://tails.boum.org/contribute/how/website/production/ yesterday :) It does not use build-website (that would be arbitrary code exec on the web server by anyone who can push changes to tails.git's master branch). Instead, the website is refreshed on Git push using the pingee ikiwiki plugin (called in a post-update hook).

But anyway, all this info is probably useless to you because there's nothing relevant that's specific to the production website: all you need to check is what PO files are produced by ikiwiki when building the website locally. To force a refresh of those PO files, I think touch'ing the corresponding "master" (sic) pages is enough, e.g.: touch wiki/src/**/*.{html,mdwn} then run ./build-website. Note that you need po4a from Stretch: more recent versions behave differently and we're not quite ready for that.

#11 Updated by intrigeri about 1 year ago

Also, as part of our release process check_po is used against PO files that come from Transifex, e.g. for tails.git:po/*.po and our custom packages (tails-greeter, tails-installer, etc.). So if check_po suddenly starts rejecting all those files, we'll have a problem. I suggest creating a sibling ticket to check that :)

#12 Updated by hefee about 1 year ago

intrigeri wrote:

Also, as part of our release process check_po is used against PO files that come from Transifex, e.g. for tails.git:po/*.po and our custom packages (tails-greeter, tails-installer, etc.). So if check_po suddenly starts rejecting all those files, we'll have a problem. I suggest creating a sibling ticket to check that :)

We have two modes for the new check_po script one is like before, and than we have a extended check mode that checks additional stuff. So it should be fine. Plese send updates for this issue to #16103.

#13 Updated by hefee about 1 year ago

  • Related to Feature #16103: Handle translations outside wiki/src WRT check_po: document or opt-out added

#14 Updated by hefee about 1 year ago

  • Assignee changed from hefee to intrigeri
  • QA Check set to Info Needed

intrigeri wrote:

It's funny, I've documented the production website config on https://tails.boum.org/contribute/how/website/production/ yesterday :) It does not use build-website (that would be arbitrary code exec on the web server by anyone who can push changes to tails.git's master branch). Instead, the website is refreshed on Git push using the pingee ikiwiki plugin (called in a post-update hook).

okay thanks.

But anyway, all this info is probably useless to you because there's nothing relevant that's specific to the production website: all you need to check is what PO files are produced by ikiwiki when building the website locally. To force a refresh of those PO files, I think touch'ing the corresponding "master" (sic) pages is enough, e.g.: touch wiki/src/**/*.{html,mdwn} then run ./build-website. Note that you need po4a from Stretch: more recent versions behave differently and we're not quite ready for that.

the touch wiki/src/**/*.{html,mdwn} then run ./build-website was successfull - no change was requested from ikiwiki. I think this is mostly successful, because Ikiwiki/Plugins/po.pm using msgmerge to merge pot file with po file. And if the pot file is the same, the po file is not touched (msgmerge --previous -q -U --backup=none pofile potfile). So a simple rebuild won't break anything.

But what you haven't described:
  • If the rebuild of the website updates the po files, how these are commited? E.g. activating a new langauge and the rebuild will create the new po files and wants to push them back to main git. Can we somehow execute unify headers in that case?
    One thing could be done if, we modify the msgmerge call and add -w 79 for the line length. But we also want control the po headers and I don't see where ikiwiki sets those headers for new created files.

#15 Updated by intrigeri about 1 year ago

  • Assignee changed from intrigeri to hefee
  • QA Check changed from Info Needed to Dev Needed
  • If the rebuild of the website updates the po files, how these are commited? E.g. activating a new langauge and the rebuild will create the new po files and wants to push them back to main git. Can we somehow execute unify headers in that case?

One could surely extend the po plugin to do that.

One thing could be done if, we modify the msgmerge call and add -w 79 for the line length. But we also want control the po headers and I don't see where ikiwiki sets those headers for new created files.

Then I guess that's done by po4a.

#16 Updated by hefee about 1 year ago

  • Assignee changed from hefee to intrigeri
  • QA Check changed from Dev Needed to Info Needed

intrigeri wrote:

  • If the rebuild of the website updates the po files, how these are commited? E.g. activating a new langauge and the rebuild will create the new po files and wants to push them back to main git. Can we somehow execute unify headers in that case?

One could surely extend the po plugin to do that.

Can you point me to the correct place to modify, or do this on your own? As I'm not very familiar with perl it would take a while to implement it.

One thing could be done if, we modify the msgmerge call and add -w 79 for the line length. But we also want control the po headers and I don't see where ikiwiki sets those headers for new created files.

Then I guess that's done by po4a.

I think the most easiest way it to just allow to run our unify script before the push, that is at least also a good solution for other teams, that have other ideas how they what to format their po files. IMO we should concentrate on running the unifiy script instead of fixing Ikiwi's creation of PO files.

#17 Updated by intrigeri about 1 year ago

  • Assignee changed from intrigeri to hefee

intrigeri wrote:

  • If the rebuild of the website updates the po files, how these are commited? E.g. activating a new langauge and the rebuild will create the new po files and wants to push them back to main git. Can we somehow execute unify headers in that case?

One could surely extend the po plugin to do that.

Can you point me to the correct place to modify, or do this on your own? As I'm not very familiar with perl it would take a while to implement it.

I'm happy to do whatever work we need for this project on the PO plugin, as long as it's not urgent. But I feel the need to formalize things: I've been spending quite time on this project with no formally defined role/budget; it's been a while since the last time I was told by u "please do task X, clock and report your time"; this makes it hard for me to organize my work (I have no clue whether I should book some time for this project, how much and when; every request comes as a surprise and at the moment and don't particularly need surprise bonus work :)

I would act as an external consultant so we would need to agree on a timeline and budget (so it probably needs to go through your team lead for budgeting matters).

One thing could be done if, we modify the msgmerge call and add -w 79 for the line length. But we also want control the po headers and I don't see where ikiwiki sets those headers for new created files.

Then I guess that's done by po4a.

I think the most easiest way it to just allow to run our unify script before the push, that is at least also a good solution for other teams, that have other ideas how they what to format their po files. IMO we should concentrate on running the unifiy script instead of fixing Ikiwi's creation of PO files.

So if I understand/guess correctly, we would need to add a new setting to the PO plugin (or ikiwiki as a whole), whose value is an arbitrary command line, and then between refreshing stuff and pushing (or between committing and pushing), ikiwiki would run that command, commit resulting changes, and refresh the website again. Is that what you have in mind?

Happy to discuss this further once my role here has been clarified :)

#18 Updated by hefee about 1 year ago

intrigeri wrote:

every request comes as a surprise and at the moment and don't particularly need surprise bonus work :)

well for me it is like stepping deeper and deeper into the dark and beeing surprised, how things are actually done, because I'm not familiar with the Tails infrastructure. I thoght that the ikiwiki pushes changes to PO files is a script that can be easily modified...

One thing could be done if, we modify the msgmerge call and add -w 79 for the line length. But we also want control the po headers and I don't see where ikiwiki sets those headers for new created files.

Then I guess that's done by po4a.

I think the most easiest way it to just allow to run our unify script before the push, that is at least also a good solution for other teams, that have other ideas how they what to format their po files. IMO we should concentrate on running the unifiy script instead of fixing Ikiwi's creation of PO files.

So if I understand/guess correctly, we would need to add a new setting to the PO plugin (or ikiwiki as a whole), whose value is an arbitrary command line, and then between refreshing stuff and pushing (or between committing and pushing), ikiwiki would run that command, commit resulting changes, and refresh the website again. Is that what you have in mind?

The other solution would be to replace the pingee plugin with a script, with that we can control the git commit by ourselves.

#19 Updated by hefee about 1 year ago

  • Assignee changed from hefee to u

intrigeri wrote:

I'm happy to do whatever work we need for this project on the PO plugin, as long as it's not urgent. But I feel the need to formalize things: I've been spending quite time on this project with no formally defined role/budget; it's been a while since the last time I was told by u "please do task X, clock and report your time"; this makes it hard for me to organize my work (I have no clue whether I should book some time for this project, how much and when; every request comes as a surprise and at the moment and don't particularly need surprise bonus work :)

@u: can your clearify this?

#20 Updated by u about 1 year ago

  • Assignee changed from u to hefee

See my email :)

#21 Updated by CyrilBrulebois 12 months ago

  • Target version changed from Tails_3.11 to Tails_3.12

#22 Updated by intrigeri 11 months ago

  • Related to Feature #16328: Merge a stricter version of check_po whose expectations are realistic into our master branch added

#23 Updated by intrigeri 11 months ago

  • Subject changed from Make sure ikiwiki generated PO files satisfy check_po's requirements to Make sure ikiwiki generated PO files satisfy the requirements we want check_po to set
  • Description updated (diff)
  • Assignee deleted (hefee)
  • Target version deleted (Tails_3.12)
  • QA Check deleted (Info Needed)
  • Type of work changed from Test to Code

#27 Updated by intrigeri 9 months ago

  • Parent task deleted (#15403)

#28 Updated by intrigeri 9 months ago

#29 Updated by intrigeri 5 months ago

  • Related to deleted (Feature #16102: List of potential checks we might want to do on PO files)

#30 Updated by intrigeri 5 months ago

  • Blocks Feature #16102: List of potential checks we might want to do on PO files added

#31 Updated by intrigeri 5 months ago

  • Blocks deleted (Feature #16102: List of potential checks we might want to do on PO files)

#32 Updated by intrigeri 5 months ago

  • Blocked by Feature #16102: List of potential checks we might want to do on PO files added

#33 Updated by hefee 5 months ago

  • Blocked by deleted (Feature #16102: List of potential checks we might want to do on PO files)

#34 Updated by hefee 5 months ago

  • Status changed from Confirmed to Resolved
  • % Done changed from 0 to 100
  • Affected tool set to Translation Platform

The scripts are got updated life now and the files from ikiwki are satisfying our needs.

Also available in: Atom PDF