summaryrefslogtreecommitdiff
path: root/strbuf.h
diff options
context:
space:
mode:
authorDimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>2019-07-02 18:22:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-02 19:18:49 (GMT)
commit8f354a1faedba64daf5442c12cbc605441bb60b0 (patch)
treec8ce80e82e5b1ba5529bf14a678a98f8a87fa2b6 /strbuf.h
parent8dca754b1e874719a732bc9ab7b0e14b21b1bc10 (diff)
downloadgit-8f354a1faedba64daf5442c12cbc605441bb60b0.zip
git-8f354a1faedba64daf5442c12cbc605441bb60b0.tar.gz
git-8f354a1faedba64daf5442c12cbc605441bb60b0.tar.bz2
l10n: localizable upload progress messages
Currenly the data rate in throughput_string(...) method is output by simple strbuf_humanise_bytes(...) call and '/s' append. But for proper translation of such string the translator needs full context. Add strbuf_humanise_rate(...) method to properly print out localizable version of data rate ('3.5 MiB/s' etc) with full context. Strings with the units in strbuf_humanise_bytes(...) are marked for translation. Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.h')
-rw-r--r--strbuf.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/strbuf.h b/strbuf.h
index c8d98df..f62278a 100644
--- a/strbuf.h
+++ b/strbuf.h
@@ -373,6 +373,12 @@ void strbuf_addbuf_percentquote(struct strbuf *dst, const struct strbuf *src);
void strbuf_humanise_bytes(struct strbuf *buf, off_t bytes);
/**
+ * Append the given byte rate as a human-readable string (i.e. 12.23 KiB/s,
+ * 3.50 MiB/s).
+ */
+void strbuf_humanise_rate(struct strbuf *buf, off_t bytes);
+
+/**
* Add a formatted string to the buffer.
*/
__attribute__((format (printf,2,3)))