-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ab/i18n-basic: i18n: "make distclean" should clean up after "make pot" i18n: Makefile: "pot" target to extract messages marked for translation i18n: add stub Q_() wrapper for ngettext i18n: do not poison translations unless GIT_GETTEXT_POISON envvar is set i18n: add GETTEXT_POISON to simulate unfriendly translator i18n: add no-op _() and N_() wrappers commit, status: use status_printf{,_ln,_more} helpers commit: refer to commit template as s->fp wt-status: add helpers for printing wt-status lines Conflicts: builtin/commit.c
- Loading branch information
Showing
6 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright (c) 2010 Ævar Arnfjörð Bjarmason | ||
*/ | ||
|
||
#include "git-compat-util.h" | ||
#include "gettext.h" | ||
|
||
int use_gettext_poison(void) | ||
{ | ||
static int poison_requested = -1; | ||
if (poison_requested == -1) | ||
poison_requested = getenv("GIT_GETTEXT_POISON") ? 1 : 0; | ||
return poison_requested; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2010-2011 Ævar Arnfjörð Bjarmason | ||
* | ||
* This is a skeleton no-op implementation of gettext for Git. | ||
* You can replace it with something that uses libintl.h and wraps | ||
* gettext() to try out the translations. | ||
*/ | ||
|
||
#ifndef GETTEXT_H | ||
#define GETTEXT_H | ||
|
||
#if defined(_) || defined(Q_) | ||
#error "namespace conflict: '_' or 'Q_' is pre-defined?" | ||
#endif | ||
|
||
#define FORMAT_PRESERVING(n) __attribute__((format_arg(n))) | ||
|
||
#ifdef GETTEXT_POISON | ||
extern int use_gettext_poison(void); | ||
#else | ||
#define use_gettext_poison() 0 | ||
#endif | ||
|
||
static inline FORMAT_PRESERVING(1) const char *_(const char *msgid) | ||
{ | ||
return use_gettext_poison() ? "# GETTEXT POISON #" : msgid; | ||
} | ||
|
||
static inline FORMAT_PRESERVING(1) FORMAT_PRESERVING(2) | ||
const char *Q_(const char *msgid, const char *plu, unsigned long n) | ||
{ | ||
if (use_gettext_poison()) | ||
return "# GETTEXT POISON #"; | ||
return n == 1 ? msgid : plu; | ||
} | ||
|
||
/* Mark msgid for translation but do not translate it. */ | ||
#define N_(msgid) (msgid) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/git.pot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters