Thread: Remove INT64_FORMAT in translatable strings

Remove INT64_FORMAT in translatable strings

From
Japin Li
Date:
Hi,

I found the following lines in pg_backup_tar.c.

    if (len != th->fileLen)
    {
        char        buf1[32],
                    buf2[32];

        snprintf(buf1, sizeof(buf1), INT64_FORMAT, (int64) len);
        snprintf(buf2, sizeof(buf2), INT64_FORMAT, (int64) th->fileLen);
        fatal("actual file length (%s) does not match expected (%s)",
              buf1, buf2);
    }

we can rely on %lld/%llu and we decided to use them in translatable strings.
See 6a1cd8b.

However, I am not sure how to update the *.po files under the pg_dump/po
directory. Any suggestions?

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.


Attachment

Re: Remove INT64_FORMAT in translatable strings

From
Tom Lane
Date:
Japin Li <japinli@hotmail.com> writes:
> we can rely on %lld/%llu and we decided to use them in translatable strings.

Seems like good cleanup, so pushed.  I think though that project style
is to use "long long" or "unsigned long long", without the unnecessary
"int" --- it certainly makes little sense to do it both ways in the
same patch.

> However, I am not sure how to update the *.po files under the pg_dump/po
> directory. Any suggestions?

The translation team manages those files.  We don't normally touch them
during code development.

            regards, tom lane



Re: Remove INT64_FORMAT in translatable strings

From
Justin Pryzby
Date:
On Fri, Mar 18, 2022 at 01:12:40PM -0400, Tom Lane wrote:
> Japin Li <japinli@hotmail.com> writes:
> > we can rely on %lld/%llu and we decided to use them in translatable strings.
> 
> Seems like good cleanup, so pushed.  I think though that project style
> is to use "long long" or "unsigned long long", without the unnecessary
> "int" --- it certainly makes little sense to do it both ways in the
> same patch.

This seemed familiar - it's about the same thing I sent here, while fixing
ftello().

https://www.postgresql.org/message-id/flat/20210104025321.GA9712@telsasoft.com
0002-Fix-broken-error-message-on-unseekable-input.patch

-- 
Justin



Re: Remove INT64_FORMAT in translatable strings

From
Japin Li
Date:
On Sat, 19 Mar 2022 at 01:12, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Japin Li <japinli@hotmail.com> writes:
>> we can rely on %lld/%llu and we decided to use them in translatable strings.
>
> Seems like good cleanup, so pushed.  I think though that project style
> is to use "long long" or "unsigned long long", without the unnecessary
> "int" --- it certainly makes little sense to do it both ways in the
> same patch.
>
>> However, I am not sure how to update the *.po files under the pg_dump/po
>> directory. Any suggestions?
>
> The translation team manages those files.  We don't normally touch them
> during code development.
>

Thank you for pushing the patch.


--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.