[cosmetics] ADM_durationToString: space missing between hours and minutes

Started by eumagga0x2a, September 03, 2016, 10:31:58 PM

Previous topic - Next topic

eumagga0x2a

Currently there is no space between hours and minutes of remaining time in the encoding and processing dialogs, which shows the string from ADM_durationToString in avidemux_core/ADM_core/src/ADM_prettyPrint.cpp:

diff --git a/avidemux_core/ADM_core/src/ADM_prettyPrint.cpp b/avidemux_core/ADM_core/src/ADM_prettyPrint.cpp
index 86dc499..16131cc 100644
--- a/avidemux_core/ADM_core/src/ADM_prettyPrint.cpp
+++ b/avidemux_core/ADM_core/src/ADM_prettyPrint.cpp
@@ -53,11 +53,11 @@ bool ADM_durationToString(uint32_t durationInMs, std::string &outputString)
         outputString=myMinutes(mm+1);
         return true;
     }
-    outputString=myHour(hh)+myMinutes(mm+1);
+    outputString=myHour(hh)+" "+myMinutes(mm+1);
     return true;
     
}       
         


-// EOF
\ No newline at end of file
+// EOF


By the way,

static std::string myHour(int m)
{
        char buffer[1024];
        sprintf(buffer,QT_TRANSLATE_NOOP("adm","%d hours"),m);
        return std::string(buffer);
}


is not really translatable in languages which use different forms of plural (and singular) depending on the number of items like German, Polish, Russian and many other...

Jan Gruuthuse

Are you speaking about "hours", you could use "hour(s)" Or just leave in English, most video users have an understanding of time in English (Technical Term). Only "Language Purists" would fall over this.

eumagga0x2a

A string "1 hours1 minutes" (without the patch ;)) doesn't look natural even in English, so hour(s) and minute(s) definitely look better and should be this way on purpose of supporting translation infrastructure provided by the toolkit. The deeper problem is that the QT_TRANSLATE_NOOP macro seems to be unable to handle plurals. The corresponding bug report dates back to 2009 and is still not fixed.

Quote from: Jan Gruuthuse on September 04, 2016, 05:38:06 AM
Only "Language Purists" would fall over this.

Aim for absolute perfection, the life will ensure there are plenty of defects on its own ;D
Translations target users who may be unable to even read latin letters while being sufficiently literate in their native script.