After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750902 - Puzzling strings together makes it hard to translate to a correct date-interval.
Puzzling strings together makes it hard to translate to a correct date-interval.
Status: RESOLVED FIXED
Product: shotwell
Classification: Other
Component: Internationalization
unspecified
Other Linux
: Normal normal
: 0.24
Assigned To: Shotwell Maintainers
Shotwell Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-13 15:02 UTC by Josef Andersson
Modified: 2016-08-12 10:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
i18n: Disambiguate start strings of date groups (1.67 KB, patch)
2016-07-18 18:14 UTC, Jens Georg
none Details | Review
i18n: Disambiguate start strings of date groups (3.06 KB, patch)
2016-08-09 20:33 UTC, Jens Georg
committed Details | Review

Description Josef Andersson 2015-06-13 15:02:46 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.
Comment 1 Jens Georg 2016-04-23 19:22:18 UTC
Uh. I have to check why it was done that way. In the meantime, can you provide me an example of a swedish timespan?
Comment 2 Jens Georg 2016-07-03 07:53:09 UTC
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.
Comment 3 Rafael Fontenelle 2016-07-12 15:42:22 UTC
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. :-)
Comment 4 Jens Georg 2016-07-12 17:04:28 UTC
> 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?
Comment 5 Rafael Fontenelle 2016-07-14 16:31:57 UTC
Yep, that's it.
Comment 6 Jens Georg 2016-07-15 17:33:01 UTC
> 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?
Comment 7 Jens Georg 2016-07-15 18:01:12 UTC
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?
Comment 8 Rafael Fontenelle 2016-07-16 14:52:55 UTC
> 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.
Comment 9 Jens Georg 2016-07-18 18:14:23 UTC
Created attachment 331739 [details] [review]
i18n: Disambiguate start strings of date groups

Signed-off-by: Jens Georg <mail@jensge.org>
Comment 10 Jens Georg 2016-07-18 18:16:38 UTC
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 ""
Comment 11 Rafael Fontenelle 2016-08-03 19:30:46 UTC
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"
Comment 12 Jens Georg 2016-08-09 20:33:34 UTC
Created attachment 333032 [details] [review]
i18n: Disambiguate start strings of date groups

Signed-off-by: Jens Georg <mail@jensge.org>
Comment 13 Jens Georg 2016-08-09 20:35:01 UTC
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 ""
Comment 14 Jens Georg 2016-08-12 10:28:58 UTC
Attachment 333032 [details] pushed as 4e1c2ec - i18n: Disambiguate start strings of date groups