Subject: Patch impacting translation (was Re: bug#58880: 'guix gc' does not round the amount of disk space freed)

From: zimoun <[email-masked]>
Date: Sun, 22 Jan 2023 15:49:55 +0100

Hi,

On Sat, 21 Jan 2023 at 17:52, Remco van 't Veer <[email-masked]> wrote:

>>> * guix/scripts/gc.scm (guix-gc): Round MiBs in user feedback.
>>> * po/*/*.po (guix/scripts/gc.scm)a: Round MiBs in user feedback.
>>
>> If the way to go with the translation dance?
>
> I don't know.  I figured since the translation key was changed this
> would be the best way to do this but to be honest I don't understand how
> to do this using "weblate" (from info:guix#Translating Guix).

Julien, WDYT?

>> The only change is:
>>
>>> diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm
>>> index 5e775c5cdb..2bbfb26d5d 100644
>>> --- a/guix/scripts/gc.scm
>>> +++ b/guix/scripts/gc.scm
>>> @@ -260,10 +260,10 @@ (define-command (guix-gc . args)
>>>      ;; Attempt to have at least SPACE bytes available in STORE.
>>>      (let ((free (free-disk-space (%store-prefix))))
>>>        (if (> free space)
>>> -          (info (G_ "already ~h MiBs available on ~a, nothing to do~%")
>>> +          (info (G_ "already ~,2h MiBs available on ~a, nothing to do~%")
>>>                  (/ free 1024. 1024.) (%store-prefix))
>>>            (let ((to-free (- space free)))
>>> -            (info (G_ "freeing ~h MiBs~%") (/ to-free 1024. 1024.))
>>> +            (info (G_ "freeing ~,2h MiBs~%") (/ to-free 1024. 1024.))
>>>              (collect-garbage store to-free)))))
>>>
>>>    (define (delete-generations store pattern)
>>> @@ -327,10 +327,10 @@ (define-command (guix-gc . args)
>>>               (ensure-free-space store free-space))
>>>              (min-freed
>>>               (let-values (((paths freed) (collect-garbage store min-freed)))
>>> -              (info (G_ "freed ~h MiBs~%") (/ freed 1024. 1024.))))
>>> +              (info (G_ "freed ~,2h MiBs~%") (/ freed 1024. 1024.))))
>>>              (else
>>>               (let-values (((paths freed) (collect-garbage store)))
>>> -              (info (G_ "freed ~h MiBs~%") (/ freed 1024. 1024.)))))))
>>> +              (info (G_ "freed ~,2h MiBs~%") (/ freed 1024. 1024.)))))))
>>>          ((list-roots)
>>>           (assert-no-extra-arguments)
>>>           (list-roots))
>>
>> and captured by G_ so does this only to be applied and then all the
>> msgid updated by the translation process?
>
> Yes, this is the only change.  The old keys will be orphaned though and
> remain in the po files.  I'd be happy to drop the po/*/*.po part of the
> patch if that helps.

Julien, what is the best solution?  Apply a patch touching all PO files
or apply a patch touching only the messages captured by G_ and then
update separately the translations?

Cheers,
simon