5 Star 31 Fork 6

Gitee 极速下载/Git-for-Windows

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/git-for-windows/git
克隆/下载
gettext.h 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
Johannes Schindelin 提交于 2023-03-11 20:47 . Sync with 2.33.8
/*
* 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
#ifndef NO_GETTEXT
# include <libintl.h>
#else
# ifdef gettext
# undef gettext
# endif
# define gettext(s) (s)
# ifdef ngettext
# undef ngettext
# endif
# define ngettext(s, p, n) ((n == 1) ? (s) : (p))
#endif
#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
#ifndef NO_GETTEXT
extern int git_gettext_enabled;
void git_setup_gettext(void);
int gettext_width(const char *s);
#else
#define git_gettext_enabled (0)
static inline void git_setup_gettext(void)
{
}
static inline int gettext_width(const char *s)
{
return strlen(s);
}
#endif
static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
{
if (!*msgid)
return "";
if (!git_gettext_enabled)
return msgid;
return gettext(msgid);
}
static inline FORMAT_PRESERVING(1) FORMAT_PRESERVING(2)
const char *Q_(const char *msgid, const char *plu, unsigned long n)
{
if (!git_gettext_enabled)
return n == 1 ? msgid : plu;
return ngettext(msgid, plu, n);
}
/* Mark msgid for translation but do not translate it. */
#define N_(msgid) msgid
const char *get_preferred_languages(void);
int is_utf8_locale(void);
#endif
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/Git-for-Windows.git
git@gitee.com:mirrors/Git-for-Windows.git
mirrors
Git-for-Windows
Git-for-Windows
main

搜索帮助

D67c1975 1850385 1daf7b77 1850385