* [PATCH] i18n: mark progress strings for translation
@ 2012-08-11 11:25 Nguyễn Thái Ngọc Duy
2012-08-12 4:33 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2012-08-11 11:25 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jiang Xin, Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
I know it's late in the cycle so let's queue it for the next one
before I forget it.
I'm after the "done\n" in index-pack but we should also make it
possible to translate units (especially "bytes" which is plural).
There are ellipsis elsewhere in this file but I don't think it's
worth translating.
progress.c | 15 ++++++++-------
1 tập tin đã bị thay đổi, 8 được thêm vào(+), 7 bị xóa(-)
diff --git a/progress.c b/progress.c
index 3971f49..b69d657 100644
--- a/progress.c
+++ b/progress.c
@@ -9,6 +9,7 @@
*/
#include "git-compat-util.h"
+#include "gettext.h"
#include "progress.h"
#define TP_IDX_MAX 8
@@ -117,29 +118,29 @@ static void throughput_string(struct throughput *tp, off_t total,
{
int l = sizeof(tp->display);
if (total > 1 << 30) {
- l -= snprintf(tp->display, l, ", %u.%2.2u GiB",
+ l -= snprintf(tp->display, l, _(", %u.%2.2u GiB"),
(int)(total >> 30),
(int)(total & ((1 << 30) - 1)) / 10737419);
} else if (total > 1 << 20) {
int x = total + 5243; /* for rounding */
- l -= snprintf(tp->display, l, ", %u.%2.2u MiB",
+ l -= snprintf(tp->display, l, _(", %u.%2.2u MiB"),
x >> 20, ((x & ((1 << 20) - 1)) * 100) >> 20);
} else if (total > 1 << 10) {
int x = total + 5; /* for rounding */
- l -= snprintf(tp->display, l, ", %u.%2.2u KiB",
+ l -= snprintf(tp->display, l, _(", %u.%2.2u KiB"),
x >> 10, ((x & ((1 << 10) - 1)) * 100) >> 10);
} else {
- l -= snprintf(tp->display, l, ", %u bytes", (int)total);
+ l -= snprintf(tp->display, l, _(", %u bytes"), (int)total);
}
if (rate > 1 << 10) {
int x = rate + 5; /* for rounding */
snprintf(tp->display + sizeof(tp->display) - l, l,
- " | %u.%2.2u MiB/s",
+ _(" | %u.%2.2u MiB/s"),
x >> 10, ((x & ((1 << 10) - 1)) * 100) >> 10);
} else if (rate)
snprintf(tp->display + sizeof(tp->display) - l, l,
- " | %u KiB/s", rate);
+ _(" | %u KiB/s"), rate);
}
void display_throughput(struct progress *progress, off_t total)
@@ -236,7 +237,7 @@ struct progress *start_progress(const char *title, unsigned total)
void stop_progress(struct progress **p_progress)
{
- stop_progress_msg(p_progress, "done");
+ stop_progress_msg(p_progress, _("done"));
}
void stop_progress_msg(struct progress **p_progress, const char *msg)
--
1.7.12.rc2.18.g61b472e
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] i18n: mark progress strings for translation
2012-08-11 11:25 [PATCH] i18n: mark progress strings for translation Nguyễn Thái Ngọc Duy
@ 2012-08-12 4:33 ` Junio C Hamano
2012-08-12 11:42 ` Nguyen Thai Ngoc Duy
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2012-08-12 4:33 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git, Jiang Xin
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> I know it's late in the cycle so let's queue it for the next one
> before I forget it.
I won't necessarily be queuing this. Not forgetting is a
responsibility of individual developers.
But it is a good idea to show an early iteration for input from
others.
I personally do not think this makes much sense, as half the
progress message you see comes from the other end of the connection,
which does not know nor care what language you speak.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i18n: mark progress strings for translation
2012-08-12 4:33 ` Junio C Hamano
@ 2012-08-12 11:42 ` Nguyen Thai Ngoc Duy
0 siblings, 0 replies; 3+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2012-08-12 11:42 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Jiang Xin
On Sun, Aug 12, 2012 at 11:33 AM, Junio C Hamano <gitster@pobox.com> wrote:
> I personally do not think this makes much sense, as half the
> progress message you see comes from the other end of the connection,
> which does not know nor care what language you speak.
That's something we should fix too (either make it entirely in English
or a native language). Still there are commands where all progress
messages come from local side and it should not show "done" in English
in such cases.
--
Duy
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-12 11:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-11 11:25 [PATCH] i18n: mark progress strings for translation Nguyễn Thái Ngọc Duy
2012-08-12 4:33 ` Junio C Hamano
2012-08-12 11:42 ` Nguyen Thai Ngoc Duy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).