The Time left: strings from time_out_countdown_seconds_to_string() are a terrible experience to localize, mostly because of the lack of ngettext, see here: http://live.gnome.org/TranslationProject/DevGuidelines/Plurals. I'll come up with a patch soon.
Reassigning to xfce-time-out-plugin
Created attachment 2467 Use ngettext, simplify logic This seems to do the trick. The pot file contains now a lot fewer strings :). The patch itself uses some string surgery, which is usually not welcomed, but there aren't really any other ways to make two components of a string plural, independently from each other.
I need opinions from translators about know how to solve this. The problem is that a few strings contains several words for which the plural form need to be handled, but the translation system can only support plurals well when only one word has a varying number. There are a few strings, but the typical one is "Time left: %d hours %d minutes %d seconds" Before the patch, only languages that have a form for 1, a form for several, and no other form, are well supported. After the patch, any kind of plural is supported. On the other hand, because the patch splits the string to be able to do that, it becomes impossible to reorder words or to insert link words. In the general case, both solutions may cause problems. But I am wondering about this particular case, with the particular strings we are dealing with here, for the languages we are supporting. Is there any language that could not be properly translated before the patch that becomes possible after it? Is there any language that was properly translated before the patch that will not be after?
"it becomes impossible to reorder words or to insert link words." Translators are supposed to reorder words of time units in these strings: _("Time left: %s %s %s") I hope you too are aware of the possibility to translate this as "%3$s %1$s %2$s", if one wanted to see the order as seconds hours minutes[1]. It might become necessary to use the C_ macro[2] to differentiate the context of "Time left: %s %s" in the cases of hours - minutes, minutes - seconds and hours - seconds so that one can choose to reorder only some of these), but I'd do it only if really needed i.e. asked in another bug. Also, I don't see any link words here, so that's probably not a problem. "Is there any language that could not be properly translated before the patch that becomes possible after it? " Yeah, for example the ones with more than two plural forms, see the Gnome wiki in my original report. [1]: http://www.gnu.org/software/gettext/manual/gettext.html#c_002dformat [2]: http://library.gnome.org/devel/glib/stable/glib-I18N.html#C-:CAPS
Right. I must have been tired when I first read your patch, and somehow though it didn't allow reordering properly. I now see it does, and link words are handled just fine too: "%3$s and %1$s with%2$s is the time left" is possible, if any language needs that. As for the use of the C_ macro, or the possible need to translate any of hours, minutes, seconds differently whether they appear alone or combined, I agree that this can wait for a separate bug to show the actual need. As for asking whether it helps with some languages, I know it does in the general case. I was just wondering if it was the case for this particular string, with the particular languages we are supporting. The reason being that if not, I'd despite the current code being obviously bad, I didn't want to invalidate the work of the translators that had dealt with it anyway. One more person has now complained, so I'll go ahead and apply your patch.
Patch applied, thanks. This will be available in the next release.