diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-16 15:30:32 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-16 15:30:32 +0100 |
| commit | fc56dc97103d00437843a31e1ef0c4915900ad1a (patch) | |
| tree | 958c909b14b3c9c2f2ec08dd30e5b06e214db1b5 /src | |
| parent | 94201bd2a5a4cb391b7f2bdeba56b928fed7cfe1 (diff) | |
| parent | 4861afbaab9c3710152d80f15c7a239c26deb74b (diff) | |
Merge master.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/util.cc | 51 | ||||
| -rw-r--r-- | src/wx/po/fr_FR.po | 6 |
2 files changed, 43 insertions, 14 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc index d04f195af..837f3cdf3 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -146,25 +146,54 @@ seconds_to_approximate_hms (int s) m -= (h * 60); stringstream ap; - - if (h > 0) { - if (m > 30) { + + bool const hours = h > 0; + bool const minutes = h < 10 && m > 0; + bool const seconds = m < 10 && s > 0; + + if (hours) { + if (m > 30 && !minutes) { ap << (h + 1) << N_(" ") << _("hours"); } else { + ap << h << N_(" "); if (h == 1) { - ap << N_("1 ") << _("hour"); + ap << _("hour"); + } else { + ap << _("hours"); + } + } + + if (minutes | seconds) { + ap << N_(" "); + } + } + + if (minutes) { + /* Minutes */ + if (s > 30 && !seconds) { + ap << (m + 1) << N_(" ") << _("minutes"); + } else { + ap << m << N_(" "); + if (m == 1) { + ap << _("minute"); } else { - ap << h << N_(" ") << _("hours"); + ap << _("minutes"); } } - } else if (m > 0) { - if (m == 1) { - ap << N_("1 ") << _("minute"); + + if (seconds) { + ap << N_(" "); + } + } + + if (seconds) { + /* Seconds */ + ap << s << N_(" "); + if (s == 1) { + ap << _("second"); } else { - ap << m << N_(" ") << _("minutes"); + ap << _("seconds"); } - } else { - ap << s << N_(" ") << _("seconds"); } return ap.str (); diff --git a/src/wx/po/fr_FR.po b/src/wx/po/fr_FR.po index 924004eb1..247d7fcd8 100644 --- a/src/wx/po/fr_FR.po +++ b/src/wx/po/fr_FR.po @@ -262,7 +262,7 @@ msgstr "Espace Couleurs" #: src/wx/config_dialog.cc:805 msgid "Config|Timing" -msgstr "Configuration|Temps" +msgstr "Temps" #: src/wx/film_editor.cc:134 msgid "Container" @@ -600,7 +600,7 @@ msgstr "" #: src/wx/kdm_dialog.cc:99 msgid "KDM|Timing" -msgstr "KDM|Temps" +msgstr "Temps" #: src/wx/film_editor.cc:297 msgid "Keep video in sequence" @@ -1013,7 +1013,7 @@ msgstr "Timeline..." #: src/wx/timing_panel.cc:36 msgid "Timing|Timing" -msgstr "Temps|Temps" +msgstr "Temps" #: src/wx/video_panel.cc:110 msgid "Top crop" |
