Based on work by Dan Cîrnaț in pkgsrc-wip. Changes: - Add default input source for fr_BE - Add default keyboard layout for Indonesia - Add utility function to start a transient systemd scope - Allow /etc/alternatives in bubblewrap sandbox (#92, Simon McVittie) - Avoid using g_type_class_add_private() - Blacklist seccomp on riscv64 architecture as its not supported yet - Change default Japanish input source to KCC - Disable gvfs in thumbnailer sandboxes - Display locale @modifiers properly (#50, Gunnar Hjalmarsson) - Don't run locale tests at build time (#159, Simon McVittie) - Fix a compile-time error on x32 - Fix a crash in xkb info handling (#785320) - Fix a memory leak in the display handling code - Fix a use-after-free in the thumbnailer - Fix bubblewrap sandbox on s390x (!82, Simon McVittie) - Fix crash in idle monitor - Fix crashes in thumbnailers (#785963) - Fix detection of builtin display on NVIDIA (Jeremy Soller) - Fix memory leak - Fix multiple bugs in sandboxed thumbnailer handling, - Fix multiple bugs in thumbnailing - Fix regressions from intltool removal - Fix regressions introduced by g_autoptr usage - Fix slow thumbnailer due to missing font cache (#90) - Fix some thumbnailer sandboxing issues - Fix time display issue with Japanese translation (Tianhao Chai) - Fix uninitialized memory in the thumbnailer (#784915) - Fix various wall clock regressions - GnomeBGSlideShow filename property replaced with a file property (Marco Trevisan) - Honor XKB_CONFIG_ROOT environment variable - Improve error reporting in thumbnailers - Miscellaneous improvements to the thumbnailer code - Modernize autotools configuration a bit - Port buildsystem to meson - Remove some obsolete API's in thumbnailer - Remove unused API not compatible with wayland - Remove unused gnome_desktop_thumbnail_has_uri() - Replace GdkColor methods with GdkRGBA methods - Require gio-unix-2.0 - Several fixes for compilation warnings - Support common_name in ISO 639 (#49, Gunnar Hjalmarsson) - Thumbnailers are now sandboxed (#7744970, #785197) - Translation updates - Use GLib fixed-width types (#168, Christopher Chavez) - Use LC_TIME for time format string translations - gnome-bg: Handle exif orientations (#516177) - gnome-languages: Use uselocale to avoid threadsafety issues (#105) - gnome_bg_slide_show_get_current_slide: add NULL check (#169, Mike Gorse) - idle-monitor fixes - languages: Fix encoding issue when translating locale modifiers (#156) - remove unused direct x11 dependency - rr: add color transform functions - systemd: Change naming scheme to conform to systemd convention - systemd: Default to garbage collect failed scopes - tests/wall*: Do not fail if some of the locales is missing - thumbnail: Update documentation - thumbnailer: Correctly cleanup stale thumbnailer directories - thumbnailer: fix incomplete TIOCSTI filtering (#112) - thumbnails: keep the orignal file name (#154) - wall-clock: Immediately react to show-weekday changes - wall-clock: Tweak the clock format - wall-clock: respect new clock-show-weekday setting - wallclock: am/pm is always available now (#780877) - wallclock: don't update needlessly (#780861)
120 lines
4.2 KiB
C
120 lines
4.2 KiB
C
$NetBSD: patch-libgnome-desktop_gnome-languages.c,v 1.1 2020/11/04 12:12:48 nia Exp $
|
|
|
|
Replace usage of uselocale() - not available on NetBSD
|
|
|
|
--- libgnome-desktop/gnome-languages.c.orig 2020-10-05 19:11:19.070822700 +0000
|
|
+++ libgnome-desktop/gnome-languages.c
|
|
@@ -303,16 +303,13 @@ language_name_get_codeset_details (const
|
|
gboolean *is_utf8)
|
|
{
|
|
locale_t locale;
|
|
- locale_t old_locale;
|
|
const char *codeset = NULL;
|
|
|
|
locale = newlocale (LC_CTYPE_MASK, language_name, (locale_t) 0);
|
|
if (locale == (locale_t) 0)
|
|
return;
|
|
|
|
- old_locale = uselocale (locale);
|
|
-
|
|
- codeset = nl_langinfo (CODESET);
|
|
+ codeset = nl_langinfo_l (CODESET, locale);
|
|
|
|
if (pcodeset != NULL) {
|
|
*pcodeset = g_strdup (codeset);
|
|
@@ -324,7 +321,6 @@ language_name_get_codeset_details (const
|
|
*is_utf8 = strcmp (normalized_codeset, "UTF-8") == 0;
|
|
}
|
|
|
|
- uselocale (old_locale);
|
|
freelocale (locale);
|
|
}
|
|
|
|
@@ -703,14 +699,11 @@ get_translated_language (const char *cod
|
|
name = NULL;
|
|
if (language != NULL) {
|
|
const char *translated_name;
|
|
- locale_t loc = 0;
|
|
- locale_t old_locale = 0;
|
|
+ g_autofree char *old_locale = NULL;
|
|
|
|
if (locale != NULL) {
|
|
- loc = newlocale (LC_MESSAGES_MASK, locale, (locale_t) 0);
|
|
- if (loc == (locale_t) 0)
|
|
- return NULL;
|
|
- old_locale = uselocale (loc);
|
|
+ old_locale = g_strdup (setlocale (LC_MESSAGES, NULL));
|
|
+ setlocale (LC_MESSAGES, locale);
|
|
}
|
|
|
|
if (is_fallback_language (code)) {
|
|
@@ -723,8 +716,7 @@ get_translated_language (const char *cod
|
|
}
|
|
|
|
if (locale != NULL) {
|
|
- uselocale (old_locale);
|
|
- freelocale (loc);
|
|
+ setlocale (LC_MESSAGES, locale);
|
|
}
|
|
}
|
|
|
|
@@ -761,15 +753,12 @@ get_translated_territory (const char *co
|
|
name = NULL;
|
|
if (territory != NULL) {
|
|
const char *translated_territory;
|
|
- locale_t loc;
|
|
- locale_t old_locale = 0;
|
|
+ g_autofree char *old_locale = NULL;
|
|
g_autofree char *tmp = NULL;
|
|
|
|
if (locale != NULL) {
|
|
- loc = newlocale (LC_MESSAGES_MASK, locale, (locale_t) 0);
|
|
- if (loc == (locale_t) 0)
|
|
- return NULL;
|
|
- old_locale = uselocale (loc);
|
|
+ old_locale = g_strdup (setlocale(LC_MESSAGES, NULL));
|
|
+ setlocale(LC_MESSAGES, locale);
|
|
}
|
|
|
|
translated_territory = dgettext ("iso_3166", territory);
|
|
@@ -777,8 +766,7 @@ get_translated_territory (const char *co
|
|
name = capitalize_utf8_string (tmp);
|
|
|
|
if (locale != NULL) {
|
|
- uselocale (old_locale);
|
|
- freelocale (loc);
|
|
+ setlocale (LC_MESSAGES, old_locale);
|
|
}
|
|
}
|
|
|
|
@@ -1358,17 +1346,13 @@ gnome_get_translated_modifier (const cha
|
|
{
|
|
char *retval;
|
|
GHashTable *modifiers_map;
|
|
- locale_t loc;
|
|
- locale_t old_locale;
|
|
+ g_autofree char *old_locale = NULL;
|
|
|
|
g_return_val_if_fail (modifier != NULL, NULL);
|
|
|
|
if (translation != NULL) {
|
|
- loc = newlocale (LC_MESSAGES_MASK, translation, (locale_t) 0);
|
|
- if (loc == (locale_t) 0) {
|
|
- return NULL;
|
|
- }
|
|
- old_locale = uselocale (loc);
|
|
+ old_locale = g_strdup (setlocale (LC_MESSAGES, NULL));
|
|
+ setlocale (LC_MESSAGES, translation);
|
|
}
|
|
|
|
/* Modifiers as listed in glibc's SUPPORTED file:
|
|
@@ -1408,8 +1392,7 @@ gnome_get_translated_modifier (const cha
|
|
g_hash_table_destroy (modifiers_map);
|
|
|
|
if (translation != NULL) {
|
|
- uselocale (old_locale);
|
|
- freelocale (loc);
|
|
+ setlocale (LC_MESSAGES, old_locale);
|
|
}
|
|
|
|
return retval;
|