Update upstream source from tag 'upstream/4.4.1'
Update to upstream version '4.4.1'
with Debian dir ca8ea36ff70b346eca790e1077544c94d8cff6a3
Norbert Preining
4 years ago
599 | 599 | { |
600 | 600 | const gchar *env_language, *env_lc_time; |
601 | 601 | gchar *string; |
602 | ||
602 | gboolean use_lctime; | |
603 | ||
604 | /* Use LC_TIME if it's set and different than LANGUAGE */ | |
603 | 605 | env_language = g_getenv("LANGUAGE"); |
604 | 606 | env_lc_time = g_getenv("LC_TIME"); |
605 | 607 | |
606 | if (env_language == NULL || env_lc_time == NULL || env_language == env_lc_time) { | |
607 | return g_strdup (format_string); | |
608 | use_lctime = (env_language != NULL) && (env_lc_time != NULL) && (g_strcmp0 (env_language, env_lc_time) != 0); | |
609 | ||
610 | if (use_lctime) { | |
611 | /* Set LANGUAGE to the LC_TIME value, so we can get the right date format via gettext */ | |
612 | g_setenv("LANGUAGE", env_lc_time, TRUE); | |
608 | 613 | } |
609 | 614 | |
610 | g_setenv("LANGUAGE", env_lc_time, TRUE); | |
611 | ||
612 | 615 | string = dgettext(gettext_domain, format_string); |
613 | 616 | |
614 | /* Set back LANGUAGE the way it was before */ | |
615 | g_setenv("LANGUAGE", env_language, TRUE); | |
617 | if (use_lctime) { | |
618 | /* Set back LANGUAGE the way it was before */ | |
619 | g_setenv("LANGUAGE", env_language, TRUE); | |
620 | } | |
616 | 621 | |
617 | 622 | return string; |
618 | 623 | }⏎ |