Remove INT64_FORMAT in translatable strings

Started by Japin Liabout 4 years ago4 messageshackers
Jump to latest
#1Japin Li
japinli@hotmail.com

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.

Attachments:

v1-0001-Remove-use-of-U-INT64_FORMAT-in-some-translatable.patchtext/x-patchDownload+9-40
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Japin Li (#1)
Re: Remove INT64_FORMAT in translatable strings

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

#3Justin Pryzby
pryzby@telsasoft.com
In reply to: Tom Lane (#2)
Re: Remove INT64_FORMAT in translatable strings

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().

/messages/by-id/20210104025321.GA9712@telsasoft.com
0002-Fix-broken-error-message-on-unseekable-input.patch

--
Justin

#4Japin Li
japinli@hotmail.com
In reply to: Tom Lane (#2)
Re: Remove INT64_FORMAT in translatable strings

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.