nvaccess / mrconfig

'myrepos' configuration files for nvda translations and addons
GNU General Public License v3.0
6 stars 14 forks source link

Update `SRT/global.t2tconf` automatically #70

Closed CyrilleB79 closed 1 year ago

CyrilleB79 commented 2 years ago

In the screenreader translations SVN repo, the global.t2tconf file is updated for each release with the new release version and updated copyright years if needed. The part of the file which is updated are the following lines:

% Language neutral defines
% We need to do this one as PostProc so it gets converted for the title.
%!PostProc: NVDA_VERSION 2022.1-dev
%!PreProc: NVDA_URL https://github.com/nvaccess/nvda/
%!PreProc: NVDA_COPYRIGHT_YEARS 2006-2021

Today it seems that this updates are done manually by @josephsl (a.k.a. nvdakor in SVN) for each release. Moreover, I do not know if it is documented somewhere; @josephsl is it?

It would be interesting to have it automated. In this repo, it could by handled in the nvda2svn processing:

There are many ways to solve this issue:

  1. Implement automatic update and document it
  2. Only document the current process but do not automate anything in mrconfig; automation may be implemented in the add-on store when it becomes a reality
  3. Do nothing if documentation of the current process already exists
josephsl commented 2 years ago

Hi, I update copyright year as soon as it is updated on NVDA source code itself, and I don’t think this process is documented. Thanks.

XLTechie commented 1 year ago

@seanbudd what is the status of this? With @josephsl retiring/retired, who is managing this now? I know it is planned to move away from this system, but until that happens (and many things could delay it), if this is still undocumented/unautomated ...

michaelDCurran commented 1 year ago

From my understanding, in actual NVDA builds, each translated t2t file includes user_docs/global.t2tConf. Note this is different to the global.t2tConf in the srt repository. I think (but am not sure) that the srt global.t2tConf is only used when compiling translations to html within the translation system for proof reading. The global.t2tConf in NVDA's user_docs dir, does not directly define any version macros, rather it includes build.t2tConf, which is populated by NVDA's sconstruct with the version macros set to the version values for the current build. Thus, the srt/global.t2tConf does not at all affect releases of NVDA. For ease of administration and clearer understanding, perhaps srt/global.t2tConf should hardcode these version strings as something like "translation test <svn revision number>". Is anyone able to verify my assumptions here?

CyrilleB79 commented 1 year ago

From my understanding, in actual NVDA builds, each translated t2t file includes user_docs/global.t2tConf. Note this is different to the global.t2tConf in the srt repository. I think (but am not sure) that the srt global.t2tConf is only used when compiling translations to html within the translation system for proof reading.

This is correct. In the log, we can see that the version has not always been updated for each actual NVDA version.

Thus, the srt/global.t2tConf does not at all affect releases of NVDA. For ease of administration and clearer understanding, perhaps srt/global.t2tConf should hardcode these version strings as something like "translation test <svn revision number>".

Yes, this makes sense to me. Since there is no direct link between NVDA's repo content and the version and copyright year, there is no point to keep it up-to-date. Something different such as "Proofing version" makes things clearer.

seanbudd commented 1 year ago

I guess this can be closed then?

CyrilleB79 commented 1 year ago

We should only close this issue when a decision is made (and implemented) on how to keep SVN's global.t2tconf up-to-date. There are 3 possibilities:

The solution with the SVN commit number seems the nicest to me. But I have no idea on how to implement it, and such a small problem is not worth spending time researching and implementing a solution. If someone already has an idea on how to get the SVN commit and include it in the file, go ahead!

XLTechie commented 1 year ago

I think the only way to get the SVN revision number included, would be to use a script called by a post-commit-hook, which would encode the last revision number. I.e. because committing the revised global.t2tconf would be itself a revision, the hook could only know the revision which triggered it, not the very last which would be its own update of the version macro.

And the hook would have to make sure that it did not trigger itself by its own revision--e.g. by checking something returned by $(svn info).

Seems tricky, and could become recursive if not careful.

Alternative:

How often are the HTML files built? It would seem easier to have a cron job on NV Access servers, that just updates a date in a file every day, or every 12 hours, or whatever.

E.g. replace the "NVDA_VERSION" macro in global.t2tconf with:

%!Includeconf: version.t2tconf

Then have a cron job on the NV Access server run a script like this as a daily task:

#!/bin/bash
cd "SRT_root_directory_here"
svn lock -q version.t2tconf
date '+%%!PostProc: NVDA_VERSION TranslationTestOn%Y-%m-%d' > version.t2tconf
svn commit -q -m "Automated version.t2tconf update"

Or, expand the date reference in the above to include a time, and run it as part of the translatoBot, if it needs to be updated more than daily.

michaelDCurran commented 1 year ago

Lets go with option 1 (no revision information) as the alternative is too complicated and not worth the time or risk.

seanbudd commented 1 year ago

I've now updated the values in srt/global.t2tconf

New snippet:

% We need to do this one as PostProc so it gets converted for the title.
% These values are only used in the translation system, not the release system.
%!PostProc: NVDA_VERSION "translation preview version"
%!PreProc: NVDA_URL https://www.nvaccess.org/
%!PreProc: NVDA_COPYRIGHT_YEARS 2006-2023