[Bug localedata/14641] New: Add a strftime()-like function for formatting human names

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug localedata/14641] New: Add a strftime()-like function for formatting human names

maiku.fabian at gmail dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=14641



             Bug #: 14641

           Summary: Add a strftime()-like function for formatting human

                    names

           Product: glibc

           Version: unspecified

            Status: NEW

          Severity: enhancement

          Priority: P2

         Component: localedata

        AssignedTo: [hidden email]

        ReportedBy: [hidden email]

                CC: [hidden email]

    Classification: Unclassified





It’s useful that glibc’s locale data collects together diff
erent locales’ ways

of formatting names as name_fmt (lh.2xlibre.net/values/name_fmt/). However,

this is difficult to use, and requires programs to implement their own pars
er

for the field descriptors. This causes duplication of code and means all the

programs have to be kept up-to-date with any changes to the set of allowed

field descriptors.



Would it be possible to add a function similar to strftime() which will par
se a

*name* format string and substitute values for its field descriptors?



--

Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email

------- You are receiving this mail because: -------

You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

Re: [Bug localedata/14641] New: Add a strftime()-like function for formatting human names

Keld Simonsen-2
On Fri, Sep 28, 2012 at 11:33:42AM +0000, bugzilla at tecnocode dot co.uk wrote:

>
> http://sourceware.org/bugzilla/show_bug.cgi?id=14641
>
>              Bug #: 14641
>            Summary: Add a strftime()-like function for formatting human
>                     names
>            Product: glibc
>            Version: unspecified
>             Status: NEW
>           Severity: enhancement
>           Priority: P2
>          Component: localedata
>         AssignedTo: [hidden email]
>         ReportedBy: [hidden email]
>                 CC: [hidden email]
>     Classification: Unclassified
>
>
> It???s useful that glibc???s locale data collects together different locales??? ways
> of formatting names as name_fmt (lh.2xlibre.net/values/name_fmt/). However,
> this is difficult to use, and requires programs to implement their own parser
> for the field descriptors. This causes duplication of code and means all the
> programs have to be kept up-to-date with any changes to the set of allowed
> field descriptors.
>
> Would it be possible to add a function similar to strftime() which will parse a
> *name* format string and substitute values for its field descriptors?

yes, this is possible. I think it would be better to have one standardized way than several
homegrown. Coul we find out what are the different current APIs vailable in different
implementations?


Reply | Threaded
Open this post in threaded view
|

[Bug localedata/14641] Add a strftime()-like function for formatting human names

maiku.fabian at gmail dot com
In reply to this post by maiku.fabian at gmail dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=14641



--- Comment #1 from keld at keldix dot com <keld at keldix dot com> 2012-09-28 12:05:59 UTC ---

On Fri, Sep 28, 2012 at 11:33:42AM +0000, bugzilla at tecnocode dot co.uk

wrote:

>

> http://sourceware.org/bugzilla/show_bug.cgi?id=14641

>

>              Bug #: 14641

>            Summary: Add a strftime()-like function for formatting human

>                     names

>            Product: glibc

>            Version: unspecified

>             Status: NEW

>           Severity: enhancement

>           Priority: P2

>          Component: localedata

>         AssignedTo: [hidden email]

>         ReportedBy: [hidden email]

>                 CC: [hidden email]

>     Classification: Unclassified

>

>

> It???s useful that glibc???s locale data collects together different locales??? ways

> of formatting names as name_fmt (lh.2xlibre.net/values/name_fmt/). However,

> this is difficult to use, and requires programs to implement their own parser

> for the field descriptors. This causes duplication of code and means all the

> programs have to be kept up-to-date with any changes to the set of allowed

> field descriptors.

>

> Would it be possible to add a function similar to strftime() which will parse a

> *name* format string and substitute values for its field descriptors?



yes, this is possible. I think it would be better to have one standardized way

than several

homegrown. Coul we find out what are the different current APIs vailable in

different

implementations?



--

Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email

------- You are receiving this mail because: -------

You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug localedata/14641] Add a strftime()-like function for formatting human names

maiku.fabian at gmail dot com
In reply to this post by maiku.fabian at gmail dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=14641



Rich Felker <bugdal at aerifal dot cx> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

                 CC|                            |bugdal at aerifal dot cx



--- Comment #2 from Rich Felker <bugdal at aerifal dot cx> 2012-09-28 12:21:06 UTC ---

I think this feature is fundamentally misguided. There is no universal way to

represent a "broken down" human name; the whole "first name last name" or

"family name" concept is rooted in particular cultures and does not even apply

to others. I don't think glibc has any business perpetuating the concept that

it's reasonable for applications to store names like this.



Properly written applications should simply be storing a single "name" field as

one string, possibly tagged with a subrange of the string to be used as a

primary sort key. Other useful tagging would be rules specific to the named

persons' culture for how to transform their name into a salutation, etc. But

this is specific to the culture of the person being named, not the locale.



--

Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email

------- You are receiving this mail because: -------

You are on the CC list for the bug.