| 105 | int git_gettext_enabled = 0; |
| 106 | |
| 107 | void git_setup_gettext(void) |
| 108 | { |
| 109 | const char *podir = getenv(GIT_TEXT_DOMAIN_DIR_ENVIRONMENT); |
| 110 | char *p = NULL; |
| 111 | |
| 112 | if (!podir) |
| 113 | podir = p = system_path(GIT_LOCALE_PATH); |
| 114 | |
| 115 | if (!is_directory(podir)) { |
| 116 | free(p); |
| 117 | return; |
| 118 | } |
| 119 | |
| 120 | bindtextdomain("git", podir); |
| 121 | setlocale(LC_MESSAGES, ""); |
| 122 | setlocale(LC_TIME, ""); |
| 123 | init_gettext_charset("git"); |
| 124 | textdomain("git"); |
| 125 | |
| 126 | git_gettext_enabled = 1; |
| 127 | |
| 128 | free(p); |
| 129 | } |
| 130 | |
| 131 | /* return the number of columns of string 's' in current locale */ |
| 132 | int gettext_width(const char *s) |