GNOME Bugzilla – Bug 41455
Add thousands separator to directory counts > 999
Last modified: 2008-03-06 04:23:21 UTC
Currently huge directory counts get no "comma" separators (the quotes implying localization). It's not terrible the way it is, but it would be nicer to do some number-formatting on these strings. The worst case is in the deep directory counts shown in the Properties window. ------- Additional Comments From sullivan@eazel.com 2000-06-23 18:48:10 ---- Not sure if there are canned routines available to do this nicely. ------- Additional Comments From eli@eazel.com 2000-10-16 19:38:45 ---- Batch-assigning QA ownership of remaining bugs to eli@eazel.com ------- Additional Comments From eli@eazel.com 2001-02-21 11:12:42 ---- QA Assigning to brett. Sorry for the spam. ------- Additional Comments From eli@eazel.com 2001-03-26 11:11:23 ---- QA Assigning to self. ------- Bug moved to this database by unknown@bugzilla.gnome.org 2001-09-09 20:33 -------
According to the sprintf manual page, SUSv2 specifies that the flag character ' (single-quote) will perform the desired grouping. However, I am unable to produce the desired result with a simple test program. This may be a gcc or glibc bug. gcc 2.95 yields the potential warning indicated by the manual page. gcc versions 3.0 and 3.1 do not yield the warning. glibc is version 2.2.5. LC_NUMERIC is en_US and should have the comma separator according to `locale`.
My simple test program apparently was incorrect. After calling (for example) setlocale(LC_NUMERIC, ""); the printf's work according to SUSv2. I'll prepare a patch.
Created attachment 9889 [details] [review] Enable thousands separators in user visible strings.
If you are worried about the portability of printf features, you might want to lobby for bug 79488, which proposes to include a good, feature-complete printf implementation in glib, for use on lacking systems.
Moving to 2.2 to filter out from the far-future stuff.
Alex committed this patch.
Actually, it looks like I'm wrong, sorry.
I would not trust this to work. The support is very locale dependent. Most have not been set up to support it. It is also libc dependent and I would be surprised if there were not several that would end up rendering the '. We have routines to handle this in gnumeric if you'd like to pilfer.
Apologies for the spam- I'm removing 'bugsquad' from some keywords via the web interface. This is a one-time only thing before I re-add bugsquad via the SQL interface, which will generate no mail. Apologies again.
The patch hasn't been merged yet (2.2.3).
Still not merged yet as of 2004-01-20.
The file that this patch was for, <file:///cvs/gnome/nautilus/components/hardware/nautilus-hardware-view.c>, no longer exists.
Dave, I'd recommend marking this patch obsolete, since the HW view is gone. Not sure if you want to keep the bug open for any of the new 'computer' stuff or not.
Comment on attachment 9889 [details] [review] Enable thousands separators in user visible strings. marked needs-work, see jody's comment
Created attachment 45604 [details] [review] Proposed patch against HEAD.
Comment on attachment 45604 [details] [review] Proposed patch against HEAD. What's the current status of the "'" support? Are Jody's comments still valid? It works fine on my linux system with the default locale, but I guess that doesn't mean too much. Does glib provide the support? It seemed to do at some point with a 3rd party lib but I'm not sure it still does.
My comments are unchanged the only difference is the year. If we can trust libc more, or are willing to assume that glibc is the only reasonable target then it's probably safe to assume that the \' will not be rendered. I'm still betting there are locales where it will not work. eg "C" The result would be no worse than what's already there so the patch may be reasonable if we trust libc.
Jody, could you point out the functions you use in gnumeric for this? It sounds like we might to have to pilfer :)
The code now lives in libgoffice and is significantly more powerful that what is needed here. goffice/goffice/utils/format.c : go_render_number
Created attachment 102299 [details] [review] Localize integers in user-visible strings Updated for latest code from trunk
sidenote: all these 3rd/2nd/1st strings must die from a l10n point of view, e.g. static const char untranslated_x12th_copy_duplicate_format[] = N_("%s (%dth copy)%s"); english is the only boring language that needs such hacks. it does not work for *any* other language.
Commited.
(In reply to comment #17) in my older apple libc, the ' is all i'm getting i don't know if this is would happen with newer ones