MCPcopy Index your code
hub / github.com/git/git / get_preferred_languages

Function get_preferred_languages

gettext.c:50–67  ·  view source on GitHub ↗

* Guess the user's preferred languages from the value in LANGUAGE environment * variable and LC_MESSAGES locale category if NO_GETTEXT is not defined. * * The result can be a colon-separated list like "ko:ja:en". */

Source from the content-addressed store, hash-verified

48 * The result can be a colon-separated list like "ko:ja:en".
49 */
50const char *get_preferred_languages(void)
51{
52 const char *retval;
53
54 retval = getenv("LANGUAGE");
55 if (retval && *retval)
56 return retval;
57
58#ifndef NO_GETTEXT
59 retval = setlocale(LC_MESSAGES, NULL);
60 if (retval && *retval &&
61 strcmp(retval, "C") &&
62 strcmp(retval, "POSIX"))
63 return retval;
64#endif
65
66 return NULL;
67}
68
69#ifndef NO_GETTEXT
70__attribute__((format (printf, 1, 2)))

Callers 1

write_accept_languageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected