1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-03 01:23:49 +00:00

x11/lightdm: Fix locale selection

- Allow locale selection on login screen. First, lightdm must be patched
  to correctly detect utf8 locales, which have a UTF-8 suffix on FreeBSD
  instead of utf8 like on Linux systems. Secondly, we have to use locale
  codes in the language menuitem as FreeBSD doesn't have support for
  locale naming (missing _NL_IDENTIFICATION_LANGUAGE implementation).

- Use @sample for lightdm-gtk-greeter config file to prevent it from
  being overwritten when the package is reinstalled / upgraded.

PR:		220614
Submitted by:	pawel
MFH:		2017Q3
This commit is contained in:
Ben Woods 2017-07-24 12:47:45 +00:00
parent 9d5d212aa1
commit 2300533f55
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=446523
5 changed files with 69 additions and 5 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= lightdm-gtk-greeter
PORTVERSION= 2.0.2
PORTREVISION= 1
CATEGORIES= x11
MASTER_SITES= https://launchpad.net/${PORTNAME}/${PORTVERSION:R}/${PORTVERSION}/+download/
@ -20,4 +21,8 @@ USE_GNOME= cairo gdkpixbuf2 gtk30 intltool
USE_XFCE= libexo
USE_XORG= x11
post-install:
(cd ${STAGEDIR}${PREFIX}/etc/lightdm && ${MV} lightdm-gtk-greeter.conf \
lightdm-gtk-greeter.conf.sample)
.include <bsd.port.mk>

View File

@ -0,0 +1,15 @@
--- src/lightdm-gtk-greeter.c.orig 2017-06-08 17:51:50 UTC
+++ src/lightdm-gtk-greeter.c
@@ -2930,11 +2930,7 @@ main (int argc, char **argv)
gchar *label;
GtkWidget *radiomenuitem;
- country = lightdm_language_get_territory (language);
- if (country)
- label = g_strdup_printf ("%s - %s", lightdm_language_get_name (language), country);
- else
- label = g_strdup (lightdm_language_get_name (language));
+ label = g_strdup (lightdm_language_get_code (language));
code = lightdm_language_get_code (language);
gchar *modifier = strchr (code, '@');

View File

@ -1,4 +1,4 @@
etc/lightdm/lightdm-gtk-greeter.conf
@sample etc/lightdm/lightdm-gtk-greeter.conf.sample
sbin/lightdm-gtk-greeter
%%PORTDOCS%%%%DOCSDIR%%/sample-lightdm-gtk-greeter.css
share/icons/hicolor/scalable/places/budgie-desktop_badge-symbolic.svg

View File

@ -3,7 +3,7 @@
PORTNAME= lightdm
PORTVERSION= 1.20.0
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= x11
MASTER_SITES= https://launchpad.net/${PORTNAME}/${PORTVERSION:R}/${PORTVERSION}/+download/

View File

@ -1,8 +1,52 @@
https://bugs.launchpad.net/lightdm/+bug/790186
--- liblightdm-gobject/language.c.orig 2016-12-09 01:04:48 UTC
--- liblightdm-gobject/language.c.orig 2016-09-30 03:23:52 UTC
+++ liblightdm-gobject/language.c
@@ -248,10 +248,16 @@ lightdm_language_get_name (LightDMLangua
@@ -36,6 +36,12 @@ G_DEFINE_TYPE (LightDMLanguage, lightdm_language, G_TY
static gboolean have_languages = FALSE;
static GList *languages = NULL;
+static gboolean
+is_utf8 (const gchar *code)
+{
+ return g_strrstr (code, ".utf8") || g_strrstr (code, ".UTF-8");
+}
+
static void
update_languages (void)
{
@@ -72,7 +78,7 @@ update_languages (void)
continue;
/* Ignore the non-interesting languages */
- if (strcmp (command, "locale -a") == 0 && !g_strrstr (code, ".utf8"))
+ if (strcmp (command, "locale -a") == 0 && !is_utf8 (code))
continue;
language = g_object_new (LIGHTDM_TYPE_LANGUAGE, "code", code, NULL);
@@ -88,12 +94,6 @@ update_languages (void)
have_languages = TRUE;
}
-static gboolean
-is_utf8 (const gchar *code)
-{
- return g_strrstr (code, ".utf8") || g_strrstr (code, ".UTF-8");
-}
-
/* Get a valid locale name that can be passed to setlocale(), so we always can use nl_langinfo() to get language and country names. */
static gchar *
get_locale_name (const gchar *code)
@@ -133,7 +133,7 @@ get_locale_name (const gchar *code)
for (i = 0; avail_locales[i]; i++)
{
gchar *loc = avail_locales[i];
- if (!g_strrstr (loc, ".utf8"))
+ if (!is_utf8 (loc))
continue;
if (g_str_has_prefix (loc, language))
{
@@ -227,10 +227,16 @@ lightdm_language_get_name (LightDMLanguage *language)
if (locale)
{
gchar *current = setlocale (LC_ALL, NULL);
@ -19,7 +63,7 @@ https://bugs.launchpad.net/lightdm/+bug/790186
if (language_en && strlen (language_en) > 0)
priv->name = g_strdup (dgettext ("iso_639_3", language_en));
@@ -291,10 +297,16 @@ lightdm_language_get_territory (LightDML
@@ -270,10 +276,16 @@ lightdm_language_get_territory (LightDMLanguage *langu
if (locale)
{
gchar *current = setlocale (LC_ALL, NULL);