From: Peter Krefting Date: Wed, 02 Jun 2010 09:12:29 GMT Subject: Re: [PATCH/RFC v4 1/7] Add infrastructure for translating Git with gettext Message-ID: In-Reply-To: <1275440764-26153-2-git-send-email-avarab@gmail.com> Ævar Arnfjörð Bjarmason: > + color_fprintf_ln(s->fp, c, _("# (use \"git rm --cached ...\" to unstage)")); > + color_fprintf_ln(s->fp, c, _("# (use \"git add/rm ...\" as appropriate to mark resolution)")); > + color_fprintf_ln(s->fp, c, _("#")); This is a multi-line string, and should be translated as such. The trailing "#" should either be part of the translated multi-line string, or be added explicitely, and untranslated, at the end. > + color_fprintf_ln(s->fp, c, _("# (use \"git rm --cached ...\" to unstage)")); > + color_fprintf_ln(s->fp, c, _("#")); Determine how to handle the trailing "#" as above. > + color_fprintf_ln(s->fp, c, _("# (use \"git add/rm ...\" to update what will be committed)")); > + color_fprintf_ln(s->fp, c, _("# (use \"git checkout -- ...\" to discard changes in working directory)")); Multi-line. > + color_fprintf_ln(s->fp, c, _("# (commit or discard the untracked or modified content in submodules)")); > + color_fprintf_ln(s->fp, c, _("#")); Trailing "#". > + color_fprintf_ln(s->fp, c, _("# (use \"git %s ...\" to include in what will be committed)"), how); > + color_fprintf_ln(s->fp, c, _("#")); Ditto. > + case 1: how = _("both deleted:"); break; > + case 2: how = _("added by us:"); break; > + case 3: how = _("deleted by them:"); break; > + case 4: how = _("added by them:"); break; > + case 5: how = _("deleted by us:"); break; > + case 6: how = _("both added:"); break; > + case 7: how = _("both modified:"); break; > } > - color_fprintf(s->fp, c, "%-20s%s\n", how, one); > + color_fprintf(s->fp, c, _("%-20s%s\n"), how, one); does color_fprintf() gracefully handle cutting text for multi-byte encodings, and text width? Otherwise I can see this bite us for all non-ASCII locales in general (if long translated are needed), and for CJK locales in particular (for variable character widths). > - color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "%s", extra.buf); > + color_fprintf(s->fp, color(WT_STATUS_HEADER, s), _("%s"), extra.buf); Should not be in _() > - fprintf(s->fp, "\n"); > + fprintf(s->fp, _("\n")); Ditto. > + color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), _("#")); > + color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), _("# Initial commit")); > + color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), _("#")); Either a multi-line string, or untranslate the "#"s. -- \\// Peter - http://www.softwolves.pp.se/