[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: String formatting with APR_INT64_T etc. & gettext localization

From: Mattias Engdegňrd <mattiase_at_bredband.net>
Date: Fri, 25 Apr 2014 22:31:53 +0200

25 apr 2014 kl. 18.53 skrev Julian Foad:

> 1. Use PRIu64 etc. from <inttypes.h>.

Good, if you can get it all to work on Windows.

> 2. Use a helper function to format an integer as a string; insert
> the result with "%s".

Probably the most practical solution for the time being.

> 3. Double-formatting, using "...%%%s..." to insert the correct
> format specifier.

In addition to the problems you mentioned with this approach, it
yields unnecessarily messy strings for the translators to deal with,
and possibly misunderstand.

> 4. Modify 'gettext' to expand or recognize these macros.
> 5. Pre-process the source to expand these macros.

Sounds fragile, and again, it needs to be verified on Windows.

> + -e 's/APR_SSIZE_T_FMT/"ld"/g' \
> + -e 's/APR_SIZE_T_FMT/"lu"/g' \
> + -e 's/APR_OFF_T_FMT/"ld"/g' \

Surely these must be wrong on IL32P64 platforms? (Why not use z?)

> +# For each file name on standard input, process the file's content
> into a
> +# new file and write the new file's name on standard output.

Perhaps I have misunderstood your patch entirely, but will that really
produce the right file names in the resulting .pot file?
Received on 2014-04-25 22:32:27 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.