While discussing on potentially thread-unsafe getenv() call in gettext() for LANGUAGE, Bruno Haible suggested to add an API that is equivalent to the envvar setting, in a lower layer than gettext(): https://lists.gnu.org/archive/html/bug-gettext/2016-05/msg00009.html At first it seems a bit overkill to me though (because the only user is currently gettext()), the concept itself seems not uncommon: W3C ltli[1] defines the term "language priority list" and ICU4J provides a class LocalePriorityList[2] so multilingual applications might benefit from the API. My current suggestion is to add the following two functions to <locale.h> as a GNU extension: /* Sets the language priority list for the calling thread to LANGUAGES. LANGUAGES may be a colon-separated list of language codes. If LANGUAGES is NULL, use the one inferred from the environment variable 'LANGUAGE'. The effect of the language priority list is application dependent. However, supporting applications should give priority to the language priority list over the locale settings. This returns an opaque string that corresponds to the current language priority list. */ const char * set_language_priority_list (const char *languages); /* Returns the language priority list for the calling thread. This returns NULL if the list is not set yet, or an opaque string that corresponds to the current language priority list. */ const char * get_language_priority_list (void); [1] https://www.w3.org/TR/ltli/ [2] http://icu-project.org/apiref/icu4j/com/ibm/icu/util/LocalePriorityList.html