Re: Best way to format a name string in Folks



Hi Laurent

2012-08-04 10:18 keltezéssel, Contzen Laurent írta:
Hello,

I'm currently adding a new display-name property in FolksIndividual as
discussed in bug #651672
(https://bugzilla.gnome.org/show_bug.cgi?id=651672). One of the possible
values we'd like to set this value to would use the given_name and the
family_name of the contact. Currently, I'm simply doing

     var name = structured_name.given_name + " "
+ structured_name.family_name;

which outputs a string containing exactly "$given_name $family_name".

Is this the best way of doing this or should, for example, the string
format be translatable?


This should be translatable.

For example, the standard name order in Hungarian is $family_name $given_name, so your solution would not work for my language and for a few more, see: http://en.wikipedia.org/wiki/Name_order#Name_order

Probably "%s %s" with a comment about their meaning and how to switch the order is enough, like:

Translators: first %s is the given name of the contact, the second %s is the family name. To change the order, use "%2$s %1$s"

Thanks for asking!
Gabor Kelemen


Thanks in advance for your opinions on this.


Best regards,

Laurent Contzen



_______________________________________________
gnome-i18n mailing list
gnome-i18n gnome org
https://mail.gnome.org/mailman/listinfo/gnome-i18n




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]