GNOME Bugzilla – Bug 750902
Puzzling strings together makes it hard to translate to a correct date-interval.
Last modified: 2016-08-12 10:29:18 UTC
In the Shotwell translation to Swedish, it was noticed that the following part makes it harder to correctly write the date-interval format in Swedish (and I guess, in some other languages). #. / Locale-specific starting date format for multi-date strings, #. / i.e. the "Tue Mar 08" in "Tue Mar 08 - 10, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #. / Locale-specific calendar date format for multi-month strings, #. / i.e. the "Tue Mar 08" in "Tue Mar 08 to Mon Apr 06, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: ../src/Resources.vala:794 ../src/Resources.vala:804 msgid "%a %b %d" msgstr "%a %d %b" #. / Locale-specific ending date format for multi-date strings, #. / i.e. the "10, 2006" in "Tue Mar 08 - 10, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: ../src/Resources.vala:799 msgid "%d, %Y" msgstr "%d, %Y" This could, for an translation point of view, be easier solved if all this was translatable in one string. It's also something that is recommended by DevGuideLines https://wiki.gnome.org/TranslationProject/DevGuidelines/Never%20split%20sentences.
Uh. I have to check why it was done that way. In the meantime, can you provide me an example of a swedish timespan?
If you merge two "events" spanning several days, then the date span is shown below the key photo and in the event browser (see http://shotwell-project.org/dav/datespan.png) I also understood the splitting now, it is used to create different span texts such as "Sat, July 4 - 5, 20X6" for two consecutive days, "Sat, July 4 - Mon, July 6, 20X6" for consecutive days in the same month in the same year and the full-blown string.
I finally found an example. The main problem is in multi-date strings. While in english the month comes before day, that's is not true to some languages, including (Brazilian/European) Portuguese. So, in the multi-date strings the currently result doesn't make much sense: en = Tue Mar 08 - 10, 2006 pt_BR = Ter 08 de Mar - 10, 2006 Please notice how I wrongly translated the first part of multi-date strings, "%a %b %d" only taking in consideration the placeholders in this string, which ended up messing the result. For multi-month, I don't see much issue in my native language, but it could be for other languages: en = Tue Mar 08 - Mon Apr 06, 2006 pt_br = Ter, 08 de Mar - Seg, 06 de Abr de 2006 ps: The example written in the comment doesn't seem to be correct as multi-month strings currently use a dash between start and end date, not "to". IMHO, the reporter has a point. :-)
> ps: The example written in the comment doesn't seem to be correct as > multi-month strings currently use a dash between start and end date, not > "to". Yep. > > IMHO, the reporter has a point. :-) Not disagreeing. So I will provide three strings for the three formats separately and it should be fine, right?
Yep, that's it.
> I finally found an example. The main problem is in multi-date strings. While > in english the month comes before day, that's is not true to some languages, > including (Brazilian/European) Portuguese. So, in the multi-date strings the > currently result doesn't make much sense: > > en = Tue Mar 08 - 10, 2006 > pt_BR = Ter 08 de Mar - 10, 2006 Out of interest - What would be the correct translation?
Actually it's quite hard to strftime two times into one format string -.- But looking at the German translation (which has the same issue) - isn't the issue rather that the two start strings, because being identical, cannot be translated differently, so wouldn't using C_/NC_ on the parts make more sense?
> Out of interest - What would be the correct translation? Ter 08 - 10 de Mar, 2006, or Ter 08/Mar - 10/Mar (I normally use '<day> de <month>', but 'de' is not mandatory) Maybe another option, but just that I fail to express the range with "08 de Mar - 10" > Actually it's quite hard to strftime two times into one format string -.- > > But looking at the German translation (which has the same issue) - isn't the > issue rather that the two start strings, because being identical, cannot be > translated differently, so wouldn't using C_/NC_ on the parts make more > sense? Splitting starting strings would allow more flexibility for the translator to set different formation of the original, e.g.: %b in the end string, instead of keeping in the start string - that's a workaround. But also, the translator has to figure out that "%a %b %d" combines with "%d, %Y" and, in pt_BR situation %b (month) has to be after both %d's. Of course you could add a big warning to translators, but there is always a probability of some translators would miss this information.
Created attachment 331739 [details] [review] i18n: Disambiguate start strings of date groups Signed-off-by: Jens Georg <mail@jensge.org>
First throw, results in pot below. Probabl still not perfect. # . / Locale-specific time format for 12-hour time with seconds, i.e. 8:31:42 PM #. / Precede modifier with a dash ("-") to pad with spaces, otherwise will pad with zeroes #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: src/Resources.vala:777 msgid "%-I:%M:%S %p" msgstr "" #. / Locale-specific calendar date format, i.e. "Tue Mar 08, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: src/Resources.vala:781 msgid "%a %b %d, %Y" msgstr "" #. / Locale-specific starting date format for multi-date strings, #. / i.e. the "Tue Mar 08" in "Tue Mar 08 - 10, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: src/Resources.vala:786 msgctxt "MultidayFormat" msgid "%a %b %d" msgstr "" #. / Locale-specific ending date format for multi-date strings, #. / i.e. the "10, 2006" in "Tue Mar 08 - 10, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: src/Resources.vala:791 msgid "%d, %Y" msgstr "" #. / Locale-specific calendar date format for multi-month strings, #. / i.e. the "Tue Mar 08" in "Tue Mar 08 to Mon Apr 06, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: src/Resources.vala:796 msgctxt "MultimonthFormat" msgid "%a %b %d" msgstr ""
Yep, this works, although not perfect, as you mentioned. However, it would be interesting to add a 'msgctxt "MultidayFormat"' to 'msgid "%d, %Y"' in order to make sure that the translator understand the connection between the start-string and the end-string. With this patch, I translated like this (please notice month went down to the end-string of MultidayFormat): #. / Locale-specific starting date format for multi-date strings, #. / i.e. the "Tue Mar 08" in "Tue Mar 08 - 10, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: src/Resources.vala:786 msgctxt "MultidayFormat" msgid "%a %b %d" msgstr "%a, %d" #. / Locale-specific ending date format for multi-date strings, #. / i.e. the "10, 2006" in "Tue Mar 08 - 10, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: src/Resources.vala:791 msgid "%d, %Y" msgstr "%d de %b, %Y" #. / Locale-specific calendar date format for multi-month strings, #. / i.e. the "Tue Mar 08" in "Tue Mar 08 to Mon Apr 06, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: src/Resources.vala:796 msgctxt "MultimonthFormat" msgid "%a %b %d" msgstr "%a, %d de %b"
Created attachment 333032 [details] [review] i18n: Disambiguate start strings of date groups Signed-off-by: Jens Georg <mail@jensge.org>
I applied your suggestion and in addition added a separate string for the multimonth date format instead of re-using the long date format string: #. / Locale-specific starting date format for multi-date strings, #. / i.e. the "Tue Mar 08" in "Tue Mar 08 - 10, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: src/Resources.vala:787 msgctxt "MultidayFormat" msgid "%a %b %d" msgstr "" #. / Locale-specific ending date format for multi-date strings, #. / i.e. the "10, 2006" in "Tue Mar 08 - 10, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: src/Resources.vala:792 msgctxt "MultidayFormat" msgid "%d, %Y" msgstr "" #. / Locale-specific calendar date format for multi-month strings, #. / i.e. the "Tue Mar 08" in "Tue Mar 08 to Mon Apr 06, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: src/Resources.vala:797 msgctxt "MultimonthFormat" msgid "%a %b %d" msgstr "" #. / Locale-specific calendar date format for multi-month strings, #. / i.e. the "Mon Apr 06, 2006" in "Tue Mar 08 to Mon Apr 06, 2006" #. / See http://developer.gnome.org/glib/2.32/glib-GDateTime.html#g-date-time-format #: src/Resources.vala:802 msgctxt "MultimonthFormat" msgid "%a %b %d, %Y" msgstr ""
Attachment 333032 [details] pushed as 4e1c2ec - i18n: Disambiguate start strings of date groups